问题描述
我想这已经提出了很多次,但我再次提出来!
无论如何...在Ruby on Rails Sqlite3已经设置,不需要额外的挑选和切片,但...
在这里和其他地方的许多读数后,有人说它不可扩展,而其他人说实际上可以相当不错。有人说MySQL对于更大的项目是更好的,而其他人认为,只是去与PostgreSQL。
我有兴趣听取您的意见。在两种情况下。你在哪里开始一个小网站的新闻发布网站,如CNN新闻,和其他情况下,你创建一个类似于Twitter的网站?
I guess this has been brought up many times, but I'm bringing it up again!!!Anyway... In Ruby on Rails Sqlite3 is already setup and no extra picking and slicing is needed, but...after numerous readings here and other places, some say it's not scalable while others say it can actually be quite good at that. Some say MySQL is much better for bigger projects, while others think, just go with PostgreSQL.I'm interested in hearing your opinion on this. In two scenarios. One where you are starting a little website for news publishing website like CNN news, and the other scenario where you're creating a website similar to Twitter?
推荐答案
高度取决于您的应用程序。
Highly depends on your application.
通常,任何写入操作到sqlite数据库都很慢。即使是plain:update_attribute或:create也可能需要0.5秒。但是,如果你的应用程序不写多少(杀手对 sqlite:写到DB每个请求!),SQlite是大多数网络应用程序的坚实选择。它被证明处理小到中等量的交通。此外,它是开发过程中非常好的选择,因为它需要零配置。它在内存模式的测试中也非常好(除了你有成千上万的迁移,因为它每次从头开始重建)。此外,从sqlite切换到,例如MySQL,如果它的性能不再足够了,大多是无缝的。
Generally spoken, any write operation into a sqlite database is slow. Even a plain :update_attribute or :create may take upto 0.5 seconds. But if your App doesn't write much (killer against sqlite: write to DB on every request!), SQlite is a solid choice for most web apps out there. It is proven to handle small to medium amounts of traffic. Also, it is a very good choice during development, since it needs zero configuration. It performs also very well in your testsuite with the in-memory mode (except you have thousands of migrations, since it rebuilds from scratch every time). Also, it is mostly seamless to switch from sqlite to, eg MySQL if it's performance ins't enough any longer.
MySQL是一个坚实的选择。未来将告诉Oracle在Oracle下发生了什么。
MySQL is currently a rock-solid choice. Future will tell what happens to MySQL under Oracle.
PostgreSQL是我知道的最快的,但我还没有在生产中使用它。也许别人可以告诉更多。
PostgreSQL is the fastest one as far as i know, but i didn't use it in production yet. maybe others can tell more.
这篇关于Sqlite3对比Postgres对Mysql - Rails的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!