数据库可扩展性适用于高负载应用? [英] DB Scalability for a high load application?

查看:151
本文介绍了数据库可扩展性适用于高负载应用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到应用程序拥有集群式Web服务器(如10到20个服务器),具有可扩展性,可以在Web服务器之间分配
负载。但我总是看到所有使用单个数据库的网络服务器。

I have seen application to have clustered web server(like 10 to 20 server) to have scalability where they can distribute the load among webservers. But i have always seen all webserver using single DB.

现在考虑任何电子商务或铁路网络应用程序,其中有百万用户在任何时间点击应用程序。
要在Web服务器端扩展,我们可以有服务器集群,但我们如何扩展数据库?由于我们不能像多个网络服务器那样拥有多个数据库,因为一个dB将具有与其他数据库不同的状态:)

Now consider any ecommerce or railways web application where million users are hitting the application at any point of time. To scale at webserver side, we can have server clustering but how we can scale DB ? As we can not have multiple DB like multiple webserver as one dB will have different state than other one :)

更新: -
在关系型DBMS中扩展数据库是不可能的,但只能在没有SQL数据库的mongo db等中进行扩展?

UPDATE:- Is scaling the db not possible in relational DBMS but only in NO SQL DB like mongo db etc ?

推荐答案

有两个不同数据库端的可扩展性。一个是读可伸缩性,另一个是写可伸缩性。您可以通过垂直缩放来实现这两个目的,即在某个级别添加更多CPU和RAM。但是,如果您需要扩展超过单个计算机限制的非常大的数据,则应使用只读副本来满足读取可伸缩性和分页以实现写入可伸缩性。

There is two differend kind of scalability on database side. One is read-scalability and other one is write scalability. You can do both with scaling vertically means adding more CPU and RAM to some level. But if you need to scale on very large data more than the limit of a single machine you should use read replicas for need of read-scalability and sharding for write-scalability.

Sharding不像将一些实体(鞋子)放到一台服务器上而其他服务器(T恤衫)放到另一台服务器上。它的工作方式就像将一些鞋子和一些T恤衫放在一台机器上,并为其他实体做这件事。

Sharding is not working like putting some entities(shoes) to one server and others(t-shirts) to another servers. It works like putting some of shoes and some of t-shirts to one machine and doing that for the rest of entities also.

另一种高容量数据管理解决方案正在使用微服务与你的例子更相似。我的意思是为鞋子提供另一项T恤服务。使用微服务,您可以将代码和数据划分到不同的项目以及不同的应用程序和数据库服务器。因此,您可以以不同方式处理不同部分数据的可伸缩性。

Another solution for high volume data management is using microservices which is more similar to your example. I mean having a service for shoes another service for t-shirts. With microservices you divide your code and data to different projects and to different application and database servers. So you can deal with scalability of different part of your data differently.

这篇关于数据库可扩展性适用于高负载应用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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