Using memSQL and MariaDB in Django projects
memSQL is a new database engine offering high efficiency thanks to RAM oriented data storage design and query compilation (check the FAQ). It's not related to MySQL but it offers a MySQL compatible client - that allows quick and easy way to check it.
Download the database package and follow the instructions given on the page. When you extract the database you can check system requirements:
Server is working on port 3307. MySQL by default will be on 3306. To connect to the memSQL server you can do this:You can create a test database - "CREATE DATABASE test;".
There is no memSQL backend for Django (yet), but to some extent the MySQL backend may be used. Database configuration would look like so:
DEBUG needs to be turned off to avoid exceptions on "mysql" warnings (and we will get some on syncdb like: "Feature 'REFERENCES' is not supported by MemSQL. Execution will continue, but the feature will be ignored."). The database configuration has the port and host pointing it to the memSQL and not to the local MySQL server.
If you have a MySQL 5.0.3 or newer and recent Django version you will have to disable SAVEPOINT usage by Django MySQL backend (You will get "Feature 'SAVEPOINT' is not supported by MemSQL" exception with memSQL). Do disable it edit Django backend code django/db/backends/mysql/base.py and find:Set it to False: Now syncdb, fixtures loading and most/all queries should work. I've tested memSQL with my blog applications and everything seems to be working. I didn't compared performance as there aren't any complex queries that could make a difference.
memSQL may be an interesting solution for some web applications having problems with database scalability. Using the mysql backend can be handy for some tests, but usage in production environments would rather require dedicated backend for memsql.
MariaDB is a MySQL fork, binary compatible with it. This database server can be used as a drop in replacement for MySQL. The difference is in some extra features and extra storage engines added to MariaDB. You can check documentation to find out more. No backend hacking is required in this case.