Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is SQLite suitable for use in a production website?

Tags:

sqlite

mysql

I'm rewriting a PHP+MySQL site that averages 40-50 hits a day using Django.

Is SQLite a suitable database to use here? Are there any advantages/disadvantages between them?

I'm just using the db to store a blog and the users who can edit it. I am using fulltext search for the blog search, but no complex joins anywhere.

like image 289
Rich Bradshaw Avatar asked Nov 26 '08 14:11

Rich Bradshaw


People also ask

Is it OK to use SQLite in production?

SQLite works great as the database engine for most low to medium traffic websites (which is to say, most websites). The amount of web traffic that SQLite can handle depends on how heavily the website uses its database. Generally speaking, any site that gets fewer than 100K hits/day should work fine with SQLite.

Why you should not use SQLite?

High write volumes: SQLite allows only one write operation to take place at any given time, which significantly limits its throughput. If your application requires lots of write operations or multiple concurrent writers, SQLite may not be adequate for your needs.

Is SQLite good for big projects?

Sqlite is ok for mobile application and small applications but I would avoid it for larger projects. Go for something like MySQL, SQL Server (Windows) or Postgre. SQLite can be really slow in big projects. It depends on what are your wanting to do and what a "large project" in your view is.

Can I use SQLite in production Django?

It is not impossible to use Django with Sqlite as database in production, primarily depending on your website/webapp traffic and how hard you hit your db (alongside what kind of operations you perform on it i.e. reads/writes/etc).


2 Answers

40-50 hits per day is very small and SQLLite can be used without any problem.

MySql might be better once you will get more hit because it handles in a better way multiple connexion (lock isn't the same with MySql and SqlLite).

like image 171
Patrick Desjardins Avatar answered Oct 05 '22 12:10

Patrick Desjardins


The major problem with sqlite is concurrency. If you expect 40-50 hits a day, that's probably a non-issue. However, if that load increases you should be ready to migrate to a database daemon such as MySQL - better abstract your database specific code to make such a switch as painless as possible.

The performance section of the SQLite wiki might be of use to you.

like image 35
Eran Galperin Avatar answered Oct 05 '22 12:10

Eran Galperin