performance 你能推荐一个水平扩展的数据库吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/42649/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Can you recommend a database that scales horizontally?
提问by John Channing
Generally the database server is the biggest, most expensive box we have to buy as scaling vertically is the only option. Are there any databases that scale well horizontally (i.e. across multiple commodity machines) and what are the limitations in this approach?
通常,数据库服务器是我们必须购买的最大、最昂贵的机器,因为垂直扩展是唯一的选择。是否有任何数据库可以很好地横向扩展(即跨多个商用机器),这种方法有哪些限制?
采纳答案by Nick Retallack
Don't worry, good solutions are coming!
别担心,好的解决方案来了!
Couchdband Hypertableare open source and still in alpha, but they are clearly designed to make scaling on commodity software simple. They work pretty well, and may change how you think about databases.
Couchdb和Hypertable是开源的并且仍处于 alpha 阶段,但它们显然旨在简化商品软件的扩展。它们工作得很好,并且可能会改变您对数据库的看法。
Also, if it's okay to let someone else do the distributing for you, Google AppEngineand Amazon SimpleDBare extremely cheap distributed database services, though they're both in beta right now so strict limitations are imposed.
此外,如果让其他人为您分发是可以的,Google AppEngine和Amazon SimpleDB是非常便宜的分布式数据库服务,尽管它们现在都处于测试阶段,因此施加了严格的限制。
回答by yanky
Oracle RAC is not horizontally scalable at all, because all Oracle instances share the same data storage. Yes, with SAN stuff u can get a large size DB, but it's just not scalable at all. In other words, Oracle RAC is still a scale-up approach. So for scaling-out or horizontally scaling, you have to partition your data by function that means put different groups of tables in different databases; or partition your data per table that means partition one table into multiple subtables with the same schema but store in different databases. In this way, you get a scaling-out solution. There are many resources on that. Shardinghas been a buzz word for a while in web 2.0 website architecture blog sphere. Because Sharding is not directly supported by database itself, you have to build your own solution. But as I said, there are many lessons already. For oracle, partitioning table is possible. For mysql, check this question
Oracle RAC 根本没有水平可扩展性,因为所有 Oracle 实例共享相同的数据存储。是的,使用 SAN 的东西,您可以获得大型数据库,但它根本无法扩展。换句话说,Oracle RAC 仍然是一种向上扩展的方法。因此,对于横向扩展或横向扩展,您必须按功能对数据进行分区,这意味着将不同的表组放在不同的数据库中;或者对每个表的数据进行分区,这意味着将一个表划分为多个具有相同架构但存储在不同数据库中的子表。通过这种方式,您可以获得横向扩展解决方案。有很多资源。分片在 web 2.0 网站架构博客领域一直是一个流行词。由于数据库本身不直接支持分片,因此您必须构建自己的解决方案。但正如我所说,已经有很多教训了。对于oracle,分区表是可能的。对于mysql,检查这个问题
回答by Mark Harrison
Oracle RAC -- Real Application Cluster
Oracle RAC——真正的应用集群
This works nicely, you just add boxes to your cluster. You can fail over from one box to the other. It's not replication, all the boxes are part of the same logical unit.
这很好用,您只需将框添加到集群中即可。您可以从一个盒子故障转移到另一个盒子。这不是复制,所有的盒子都是同一个逻辑单元的一部分。
It's pretty spendy, of course.
当然,这很浪费。
回答by Guy
Oracle RAC is the Rolls Royce of databases allowing extra hardware nodes to be added relatively easily and hardware failover.
Oracle RAC 是数据库的劳斯莱斯,允许相对容易地添加额外的硬件节点和硬件故障转移。
However, your commodity hardware costs will be dwarfed by the licence costs.
但是,您的商品硬件成本将与许可成本相形见绌。
Why dod you feel you need horizontal scaling. A multi CPU core server with 40GB RAM and SAN storage can support very sizeable DB installation.
为什么你觉得你需要水平缩放。具有 40GB RAM 和 SAN 存储的多 CPU 核心服务器可以支持非常大的 DB 安装。
Can you provide any sizing and expected activity information to allow better understanding of your problem?
您能否提供任何规模和预期活动信息,以便更好地了解您的问题?
回答by Darren Hague
There are storage techniques such as JavaSpaces (or a commercial implementation such as Gigaspaces) which provide highly scalable, fast & secure access to objects.
有一些存储技术,如 JavaSpaces(或商业实现,如 Gigaspaces),可提供对对象的高度可扩展、快速和安全的访问。
There are also distributed cacheing systems such as memcached, which offer a similar approach.
还有分布式缓存系统,例如 memcached,它们提供了类似的方法。
Of course, neither of these are true databases, but they are things that can work in conjunction with databases to offer a large amount of horizontal scalability, given a suitable architecture. The real problem is that if you want all of the ACID goodness that comes with a database, there are certain unavoidable performance penalties. The only way out is to figure out the bits where you don't need ACID, and use other technologies to service those bits.
当然,这些都不是真正的数据库,但它们可以与数据库一起工作,以提供大量水平可扩展性,给定合适的架构。真正的问题是,如果您想要数据库随附的所有 ACID 优点,则存在某些不可避免的性能损失。唯一的出路是找出不需要 ACID 的位,并使用其他技术来服务这些位。
回答by Codek
If you do go down the RAC route it's worth remembering that it doesnt scale horizontally forever. Even the sales guys admit 90% of rac customers are 4 nodes or less. Once you go more than that you get diminishing returns. So rac may work for you, but it's not guaranteed to be the answer.
如果您确实沿着 RAC 路线走下去,请记住它不会永远横向扩展。甚至销售人员也承认 90% 的 rac 客户是 4 个或更少节点。一旦你做得更多,你就会得到递减的回报。所以 rac 可能对你有用,但不能保证它是答案。
回答by nathan
MySQL: http://www.mysql.com/why-mysql/scaleout.html
MySQL:http: //www.mysql.com/why-mysql/scaleout.html
Limitations are that it works best with read-mostly workloads. You typically have one 'master' that receives all the writes, and many 'slaves' that replicate the writes. Then you distribute the reads over all the databases.
局限性在于它最适合以读取为主的工作负载。您通常有一个接收所有写入的“主”,以及许多复制写入的“从”。然后将读取分配到所有数据库。
MySQL replication is asynchronous, so you will probably have to deal with time lag problems (you write to the master, and then read from a slave before the write has been replicated).
MySQL 复制是异步的,因此您可能必须处理时间延迟问题(您写入主服务器,然后在复制写入之前从从服务器读取)。
回答by jason saldo
回答by Nick Pierpoint
The Oracle route for scaling across multiple machines is called Real Application Clusters (Oracle RAC). There's no end of documentation on this elsewhere; you might try starting at http://www.oracle.com/database/rac_home.html.
用于跨多台机器扩展的 Oracle 路线称为 Real Application Clusters (Oracle RAC)。其他地方没有关于这方面的文件。您可以尝试从http://www.oracle.com/database/rac_home.html开始。
回答by stevechol
Oracle Real Application Clusters. If you want the best then take a look at it.
Oracle 真正应用集群。如果你想要最好的,那就看看它。

