简体   繁体   English

用于大量只读生产网站的SQLite数据库

[英]SQLite database for heavy read only production website

I have a Ruby on Rails web application that will require about 50 writes to the database to configure itself. 我有一个Ruby on Rails Web应用程序,它将需要对数据库进行大约50次写入来配置自身。 Then the rest of the life of the application it will be involved with reading the database. 然后,将在应用程序的整个剩余生命中参与读取数据库。 The database will have around 50 rows. 该数据库将有大约50行。

Would a SQLite database be enough to handle this amount of data on a production server that may get up to 100 thousand hits an hour? SQLite数据库是否足以在每小时可能达到10万次命中的生产服务器上处理此数量的数据? Or would it be wise to go with MySQL server? 还是选择MySQL服务器明智? (Also is it possible to ask Ruby on Rails to preload the entire content of the SQLite database into memory?) (还可以要求Ruby on Rails将SQLite数据库的全部内容预加载到内存中吗?)

Thanks 谢谢

Would SQLite work? SQLite可以工作吗? Yes, but it would be slower than a dedicated PostGreSQL or MySQL database. 是的,但是它比专用的PostGreSQL或MySQL数据库要慢。 You can't really get around that. 您无法真正解决这个问题。 Honestly, if your database is so small and you're worried about speed, use reddis or another in memory solution. 老实说,如果您的数据库太小并且担心速度,请使用reddis或其他内存解决方案。 With a SQL solution, you could also do one giant read at application startup and throw it in memory using memcache or redis. 使用SQL解决方案,您还可以在应用程序启动时进行一次大型读取,然后使用memcache或redis将其扔到内存中。 But redis is persistent so if you went that route, you could just use redis and avoid SQL all together. 但是redis是持久性的,因此,如果走那条路,就可以使用redis并避免使用SQL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM