用于重读生产网站的SQLite数据库

时间:2021-10-29 05:33:18

I have a Ruby on Rails web application that will require about 50 writes to the database to configure itself. Then the rest of the life of the application it will be involved with reading the database. The database will have around 50 rows.

我有一个Ruby on Rails Web应用程序,需要大约50次写入数据库才能自行配置。然后应用程序的其余部分将涉及读取数据库。该数据库将有大约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? Or would it be wise to go with MySQL server? (Also is it possible to ask Ruby on Rails to preload the entire content of the SQLite database into memory?)

SQLite数据库是否足以在生产服务器上处理这一数量的数据,每小时可能达到10万次点击?或者使用MySQL服务器是明智的吗? (还有可能要求Ruby on Rails将SQLite数据库的整个内容预加载到内存中吗?)

Thanks

谢谢

1 个解决方案

#1


0  

Would SQLite work? Yes, but it would be slower than a dedicated PostGreSQL or MySQL database. 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. With a SQL solution, you could also do one giant read at application startup and throw it in memory using memcache or redis. But redis is persistent so if you went that route, you could just use redis and avoid SQL all together.

SQLite会起作用吗?是的,但它比专用的PostGreSQL或MySQL数据库慢。你无法真正解决这个问题。老实说,如果您的数据库太小而且您担心速度,请在内存解决方案中使用reddis或其他内容。使用SQL解决方案,您还可以在应用程序启动时执行一次巨大的读取操作,并使用memcache或redis将其放入内存中。但redis是持久的,所以如果你走这条路,你可以只使用redis并避免SQL一起使用。

#1


0  

Would SQLite work? Yes, but it would be slower than a dedicated PostGreSQL or MySQL database. 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. With a SQL solution, you could also do one giant read at application startup and throw it in memory using memcache or redis. But redis is persistent so if you went that route, you could just use redis and avoid SQL all together.

SQLite会起作用吗?是的,但它比专用的PostGreSQL或MySQL数据库慢。你无法真正解决这个问题。老实说,如果您的数据库太小而且您担心速度,请在内存解决方案中使用reddis或其他内容。使用SQL解决方案,您还可以在应用程序启动时执行一次巨大的读取操作,并使用memcache或redis将其放入内存中。但redis是持久的,所以如果你走这条路,你可以只使用redis并避免SQL一起使用。