SQLite作为低流量站点的生产数据库? [英] SQLite as a production database for a low-traffic site?

查看:114
本文介绍了SQLite作为低流量站点的生产数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑使用SQLite作为一个网站的生产数据库,可能会接收到20个同时的用户,但潜在的峰值可能是其许多倍数(因为该网站将在开放互联网和总有一种可能性,人们会在某处发布一个链接,可能会驱使许多人同时在网站上)。



SQLite是可能吗?



我知道这不是一个理想的生产场景。我只是问这是否是一个现实可能性的范围。

解决方案

SQLite不支持任何类型的并发,所以你可能有问题在生产网站上运行它。如果你正在寻找一个较轻的数据库,也许可以考虑尝试一个当代的对象 - 文档存储像CouchDB。



SQLlite,你可能很好,最初使用它。



SQLlite的作者解决了这个问题


SQLite通常可以作为低到中等流量网站的数据库引擎(也就是说,99.9%的网站)。 SQLite可以处理的网络流量的数量当然取决于网站使用其数据库的严重程度。一般来说,任何获得少于100K命中/天的网站应该与SQLite工作正常。 100K命中/天的数字是保守的估计,而不是硬上界。 SQLite已经被证明可以使用10倍的流量。



SQLite通常可以正常工作作为数据库后端到网站。但是如果你的网站太忙,你想把数据库组件分离到一个单独的机器上,那么你应该考虑使用企业级的客户端/服务器数据库引擎,而不是SQLite。


所以我认为它的长短是,去吧,如果它不能很好地工作,使转换到企业级数据库是相当微不足道。






这里是一个线程,围绕使用SQLite生产Web应用程序的一些更独立的注释。

编辑(2014):您可以使用以下搜索结果:



自此回答发布后,SQLite现在推出了多线程模式提前记录模式,这可能会影响您对它的适用性的评估适用于中低交通地点。



Charles Leifer写了关于SQLite的WAL(预写日志记录)功能的博客帖子,以及一些对合适的用例程序的良好考虑的意见。


I'm considering using SQLite as a production database for a site that would receive perhaps 20 simultaneous users, but with the potential for a peak that could be many multiples of that (since the site would be accessible on the open internet and there's always a possibility that someone will post a link somewhere that could drive many people to the site all at once).

Is SQLite a possibility?

I know it's not an ideal production scenario. I'm only asking if this is within the realm of being a realistic possibility.

解决方案

SQLite doesn't support any kind of concurrency, so you may have problems running it on a production website. If you're looking for a 'lighter' database, perhaps consider trying a contemporary object-document store like CouchDB.

By all means continue to develop against SQLlite, and you're probably fine to use it initially. If you find your application has more users down the track, you're going to want to transition to postgres or mysql however.

The author of SQLlite addresses this on the website:

SQLite usually will work great as the database engine for low to medium traffic websites (which is to say, 99.9% of all websites). The amount of web traffic that SQLite can handle depends, of course, on how heavily the website uses its database. Generally speaking, any site that gets fewer than 100K hits/day should work fine with SQLite. The 100K hits/day figure is a conservative estimate, not a hard upper bound. SQLite has been demonstrated to work with 10 times that amount of traffic.

SQLite will normally work fine as the database backend to a website. But if you website is so busy that you are thinking of splitting the database component off onto a separate machine, then you should definitely consider using an enterprise-class client/server database engine instead of SQLite.

So I think the long and short of it is, go for it, and if it's not working well for you, making the transition to an enterprise class database is fairly trivial anyway. Do take care over your schema however, and design your database with growth and efficiency in mind.


Here's a thread with some more independent comments around using SQLite for a production web application. It sounds like it has been used with some mixed results.


Edit (2014):

Since this answer was posted, SQLite now features a multi-threaded mode and write ahead logging mode which may influence your evaluation of it's suitability for low-medium traffic sites.

Charles Leifer has written a blog post about SQLite's WAL (write ahead logging) feature and some well considered opinions on appropriate usecases.

这篇关于SQLite作为低流量站点的生产数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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