MySQL v. SQLite

Much of the Rails world is ga-ga for SQLite, but I've always had MySQL-something installed on my development machine for other reasons. Lately, though, those other reasons have been melting away, so I decided to try out SQLite.

I have a rather complicated Web app whose tests have always run long (around a minute for the full suite), so I ran one last test with MySQL, then switched over to SQLite for a comparison run.

MySQL SQLite
Unit 8.95 11.16
Functional 25.64  
Integration 21.38  

I don't have an exact measurement of the functional or integration tests, because they stalled out. I left the machine running for minutes (no other major processes) and it had made no progress through the functional tests (no ...s appeared, just a line saying "Started".

This isn't a scientific comparison, but it's enough to scare me away for now. And, it's in tune with my last attempt to use SQLite (on a resource limited VPS that couldn't manage MySQL at all, SQLite took minutes for some fairly simple queries).

Permalink

Comments:

jay wrote (Fri Jun 1, 2007 – 2:44 pm):

did mysql paid you anything for this ?

i hope you do better compare

Joshua wrote (Fri Jun 1, 2007 – 2:50 pm):

Uh, no?

Chris Dolan wrote (Sat Jun 2, 2007 – 5:02 pm):

I'm not sure who that 'jay' was, but he clearly has a chip on his shoulder. Sheesh, how rude.

I too have a preference for MySQL over SQLite. SQLite has the following advantages:

  • database files are portable
  • don't need to run a separate database server
  • sqlite3 pre-installed on every Mac

SQLite has the following disadvantages:

  • only one process can write to the database at a time
  • some familiar SQL syntax is not supported (e.g. set-style insert statements, like "insert into foo set id=1", which are more readable than values-style inserts IMHO)

I use DBIx::Class and SQL::Translator for all my SQL, so the latter point is merely an irritation rather than a problem.

As for performance, I've found SQLite to be plenty speedy for dev work, where I'm the only user and concurrency is nil. I've never deployed a live, SQLite based site so I don't have hard, real-world numbers.

Post Your Comment:

  • [required]

« Back to front< PreviousNext >