pythonmysqldjangotarantool

Usage of Tarantool and MySQL with Django


How can I use Tarantool in conjunction with Django and MySQL for caching (instead of i.e. Redis) and/or in the sense that all read transaction go to Tarantool (after insured MySQL replication) and all writes go into MySQL (preferred option) Would anyone have a sample?


Solution

  • Well. Tarantool does not have a Django plugin. That means you have to introduce it first. By the way, tarantool has python 2.71 and python 3.x1 libraries, so it may be useful for integration.

    How it could be implemented? You have to use taranool's python library and also MySQL's python library for creating some Django / Python plugin.

    Also. About MySQL replication. Tarantool has this feature, you can get codes from GH repo[2].

    I'm not sure that Django's sample could be found.

    Afterword. It's the pretty big task :)

    1 https://github.com/tarantool/tarantool-python

    [2] https://github.com/tarantool/mysql-tarantool-replication

    UPD: February 2021:

    The Django-Tarantool Database Backend was introduced as django-tarantool PyPi package and can be used for Django 1.10-3.1 versions.

    pip install django-tarantool
    

    Feel free to contribute to the package https://github.com/artembo/django-tarantool