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

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

问题描述

我接触过很多 NoSQL 数据库和 SQL 数据库.有不同的参数来衡量这些数据库的优势和劣势,可扩展性就是其中之一.横向和纵向扩展这些数据库有什么区别?

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?

推荐答案

水平扩展意味着您可以通过向资源池中添加更多机器来扩展,而 垂直扩展意味着您可以通过以下方式扩展为现有机器增加更多功率(CPU、RAM).

记住这一点的一种简单方法是将机器想象成服务器机架上的机器,我们在水平方向添加更多机器,并在垂直方向向机器添加更多资源强>方向.

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.

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

In the database world, horizontal-scaling is often based on the 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.

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

Good examples of horizontal scaling are Cassandra, MongoDB, Google Cloud Spanner .. and a good example of 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.

内存中数据网格,例如 GigaSpaces XAPCoherence 等通常针对水平和垂直缩放进行优化,因为它们没有绑定到磁盘.通过分区实现水平扩展,通过多核支持实现垂直扩展.

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.

您可以在我之前的帖子中阅读有关此主题的更多信息:横向扩展与纵向扩展NOSQL 替代方案背后的共同原则

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

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

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