使用SQLite作为生产数据库,坏主意,但 [英] Using SQLite as production database, bad idea but

查看:413
本文介绍了使用SQLite作为生产数据库,坏主意,但的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们目前在rails,大数据库中使用postgresql作为我们的生产数据库,但是我正在构建围绕SQLite的新版本的应用程序。事实上,我们不使用postgres的高级函数,如全文搜索或PL / SQL。考虑到SQLite,我喜欢移动数据库只使用一个文件,它在服务器和Rails中的简单集成的想法,并且性能看起来非常好 - > 基准

We are currently using postgresql for our production database in rails, great database, but I am building the new version of our application around SQLite. Indeed, we don't use advanced functions of postgres like full text search or PL/SQL. Considering SQLite, I love the idea to move the database playing with just one file, its simple integration in a server and in Rails, and the performance seems really good -> Benchmark

我们的应用程式流量比较高,每天只有1 200 000次浏览。因此,我们从数据库中进行了很多读取,但我们做了一些写。

Our application's traffic is relatively high, we got something like 1 200 000 views/day. So, we make a lot of read from the database, but we make a few writes.

你觉得怎么样?

推荐答案

如果你做了大量的读取和几个写入然后结合SQLite它与某种内存缓存机制( memcache redis 真的很好用)。这将有助于最小化对数据库的访问(读取)的数量。这种方法有助于任何多读取少写的环境,它有助于不打击SQLite的缺陷 - 在你的具体情况下。

If you do lots of reads and few writes then combine SQLite it with some sort of in-memory cache mechanism (memcache or redis are really good for this). This would help to minimize the number of accesses (reads) to the database. This approach helps on any many-reads-few-writes environment and it helps to not hit SQLite deficiencies - in your specific case.

这篇关于使用SQLite作为生产数据库,坏主意,但的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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