views:

247

answers:

4

Quick question: is it a good idea to use sqlite while developing a Django project, and use MySQL on the production server?

+3  A: 

Why would you want to do that?

  • SQLite has no stored procedure support yet.
  • SQLite is typeless. You can end up with a lot of typecast problems when running MySQL.
  • Also SQLite doesn't support RIGHT join yet.
Pentium10
+2  A: 

In short, no; unless you want to unnecessarily double development time.

Steve
+6  A: 

I'd highly recommend using the same database backend in production as in development, and all stages in between. Django will abstract the database stuff, but having different environments will leave you open to horrible internationalisation, configuration issues, and nasty tiny inconsistencies that won't even show up until you push it live.

Personally, I'd stick to mysql, but I never got on with postgres :)

Aquarion
ok glad i didn't walk down that road yet. maybe i'll take a look at postgres as i can install it in cygwin. getting mysql to work in there has proven more trouble than its worth.
Jason Miesionczek
why bother with cygwin, both mysql and postgres have native win32 packages? :)
Dmitry Shevchenko
I know this is a bit late but using XAMPP with Django has been a dream -- mixes well for me. I had some trouble with MySQLdb but I googled around and found compiled libraries. Cheers, all! :-)
Frank V
+2  A: 

I second all previous answers, adding some explicit reasons:

  • MySQL issues Warning exception when you try to store string longer that field width - you won't get them in SQLite, so not only you're string will be different between dev and production, but also program behaviour
  • bugs in both backends are different - I remember that once I tried SQLite for dev and MySQL for production, but it turned out that I discovered a bug in MySQL backend which was not present in SQLite one. So I filed a ticket for it and switched to MySQL for testing :-)

And you can even try to compete with SQLite in terms of speed, take a look at my answer for other question:

http://stackoverflow.com/questions/2025011/increase-speed-for-mysql-table-creation-in-django/2029105#2029105

Tomasz Zielinski
+1 - Excellent contributions.
Frank V