Django allows auto database routing. It is possible to have different databases for test and production. The default for test is sqlite3. Will migrating from sqlite3 to couchdb will have any significant time improvement for unittests which take more than 10 mins. to run?
What other if any test db optimization can be done?
Not sure that you could successful replace SQLite with CouchDB and save all his features unless your SQLite usage is very basic. Knowing how much sqlite allows to do, that couldn’t be so easy.
CouchDB could speedup your tests if only you’re using quite trivial SQL queries or you have complex computations on query results. Since CouchDB views stores ready-to-use results with update-on-demand request semantic this could save you some CPU time.
However, have you tried to use :memory: storage? Or work with test db on tmpfs? Also note, that with CouchDB your tests may suffer from network latency – HTTP requests are not so cheap as function calls through driver (sqlite is just database driver, not complete RDBMS).
P.S. Note, that I’m not talking from position of Django ORM or others since normally they couldn’t provide good effectiveness as native libraries. For example, SQLite allows custom
SELECTqueries, whileviewsare rarely used while CouchDB works better with predefinedviewsrather than custom queries (temporary views).