当前位置: 首页 > 工具软件 > Scalr > 使用案例 >

Scalr和mysql in cloud的自动扩展

蓬祺
2023-12-01

http://scalr.net/


知道这个工具是因为在《high performance mysql》中mysql on cloud提到了这个工具:

The cloud isn’t inherently scalable just because it’s a cloud, and choosing a scalable platform doesn’t automatically make your application scalable.

The other siren call of the cloud is the dream of auto-scaling—that is, spinning up more instances in response to increased demand, and shutting them down again when demand reduces. Although this is feasible with stateless parts of the stack such as web servers, it’s very hard to do with the database server, because it is stateful. For special cases, such as read-mostly applications, you can get a limited form of auto-scaling by adding replicas,1 but this is not a one-size-fits-all solution. In practice, although many applications use auto-scaling in the web tier, MySQL isn’t natively capable of running across a shared-nothing cluster of servers that all assume peer roles. You could do it with a sharded architecture that automatically reshards and grows or shrinks, but MySQL itself just isn’t able to auto-scale.

其中在1处有一个注解:

“A popular open source service for auto-scaling MySQL replication in the cloud isScalr

正如文中住处的,mysql本身并不能自动扩展,即使被部署到了云上也不行。

Scalr所实现的数据库自动扩展分为两个方面:

1,当原数据库读操作过多时,sclar自动在云上创建另外的数据库实例,这些新建出来的实例称为slave。同时将数据复制到所有的slave上,然后将读操作分布到复制出来的各个数据库上。原数据库称为master。只有master数据库接受写操作,同时写操作会被同步到所有slave机器上。

2,当原数据库有很多写操作并快过载时,sclar自动创建一个更大的(或性能更优的数据库实例),然后用新的实例替代原实例。


正如书中所说,For special cases, such as read-mostly applications, you can get a limited form of auto-scaling by adding replicas。

最后关于mysql在云上的扩展,书中说:在云上扩展mysql的方式,和不在云上扩展mysql的方式并没有多大不同。

 类似资料: