数据库的水平和垂直缩放之间的差异 [英] Difference between scaling horizontally and vertically for databases

查看:773
本文介绍了数据库的水平和垂直缩放之间的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到过许多NoSQL数据库和SQL数据库。有不同的参数来测量这些数据库的强度和弱点,可扩展性是其中之一。

解决方案

水平缩放意味着您可以通过添加更多的机器添加到您的资源池中,而垂直伸缩意味着您可以通过向现有计算机添加更多功率(CPU,RAM)来扩展



<记住这一点的一个简单方法是将服务器机架上的机器,在水平方向添加更多机器,并在垂直向机器添加更多资源>方向。



               



在数据库世界中,水平缩放通常基于数据的分区,即每个节点仅包含部分在垂直放大数据时,数据驻留在单个节点上,并且通过多核即扩展该机器的CPU和RAM资源之间的负载来进行缩放。



使用水平扩展,通过在现有池中添加更多机器通常更容易扩展 - 垂直扩展通常限于单个机器的容量,超出该容量的扩展通常涉及停机时间并带有上限。 / p>

水平扩展的一个好例子是Cassandra,MongoDB ..垂直扩展的一个很好的例子是MySQL - Amazon RDS(MySQL的云版本)。它提供了一种简单的方法,通过从小到大的机器切换垂直。此过程通常涉及停机时间。



内部数据网格,例如 GigaSpaces XAP Coherence 等。经常针对水平和垂直缩放进行优化,因为它们不绑定到磁盘。水平扩展通过分区和垂直扩展通过多核支持。



您可以在我之前的帖子中阅读关于此主题的更多信息:
横向扩展VS纵向扩展 NOSQL替代方法背后​​的常见原则


I have come across many NoSQL databases and SQL databases. There are varying parameters to measure the strength and weaknesses of these databases and scalability is one of them. What is the difference between horizontally and vertically scaling these databases?

解决方案

Horizontal scaling means that you scale by adding more machines into your pool of resources whereas Vertical scaling means that you scale by adding more power (CPU, RAM) to an existing machine.

An easy way to remember this is to think of a machine on a server rack, we add more machines across the horizontal direction and add more resources to a machine in the vertical direction.

                 

In a database world horizontal-scaling is often based on partitioning of the data i.e. each node contains only part of the data , in vertical-scaling the data resides on a single node and scaling is done through multi-core i.e. spreading the load between the CPU and RAM resources of that machine.

With horizontal-scaling it is often easier to scale dynamically by adding more machines into the existing pool - Vertical-scaling is often limited to the capacity of a single machine, scaling beyond that capacity often involves downtime and comes with an upper limit.

A good example for horizontal scaling is Cassandra , MongoDB .. and a good example for vertical scaling is MySQL - Amazon RDS (The cloud version of MySQL). It provides an easy way to scale vertically by switching from small to bigger machines. This process often involves downtime.

In-Memory Data Grids such as GigaSpaces XAP, Coherence etc.. are often optimized for both horizontal and vertical scaling simply because they're not bound to disk. Horizontal-scaling through partitioning and vertical-scaling through multi-core support.

You can read more on this subject on my earlier posts: Scale-out vs Scale-up and The Common Principles Behind the NOSQL Alternatives

这篇关于数据库的水平和垂直缩放之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆