A Django app to create and manage live replications of SQL database tables.
Project description
Pantograph Database Replicator
Flexible Database replication system compatible with most SQL databases
Table of Contents
About The Project
PDR is a standalone Django app for establishing a reliable, high-performance, cross-platform, live mirror of any table[s] in an SQL database server to any other SQL database server.
Pantograph database replication is event driven, not time driven, ie. it doesn’t update the whole mirror database periodically; Instead, it updates each individual group of affected records in the affected table in the mirror at the moment it's modified in the original database. Which results in a more speedy instant update, yet consumes less bandwidth and server resources.
Pantograph database replication is also perfectly reliable because the server listening for changes doesn’t has to be online at the moment changes occur. Instead, the host server creates notification channels where changes are stacked awaiting the listening server’s action to read notification, and update its replications in remote servers.
A list of commonly used resources that I find helpful are listed in the acknowledgements.
Features
- Can replicate data to multiple tables in separate databases.
- Can replicate data into a new structure, yet, keep it live.
- Can replicate data from any kind of SQL database.
- Very reliable as pdr events are created by native SQL trigger functions inside source databases.
- High in performance as it’s event-driven.
- One-way data replication can be used to join data from multiple different tables in multiple different databases into one live table.
- Provides a simple easy to use GUI to configure replications.
- Distributed as a standalone Django app wrapped in a PyPi package so you can easily integrate it with any existing Django Project.
Built With
The project is based on Django, the popular python framework, SQLAlchemy, A wonderful open-source SQL abstraction layer for the Python programing language, and native SQL trigger functions.
Quick start
- Add "reflector" and "django_ace" to your INSTALLED_APPS setting like this::
INSTALLED_APPS = [
...
'django_ace',
'reflector',
]
- Include the admin URLs anywhere in your project urls.py like this::
from django.contrib import admin
urlpatterns = [
path('admin/', admin.site.urls),
]
-
Run
python manage.py makemigrations
and thenpython manage.py migrate
to create the reflector models. -
Start the development server and visit http://127.0.0.1:8000/admin/ to setup Databases, SourceTables and then Reflections.
Roadmap
See the open issues for a list of proposed features (and known issues).
Contributing
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
Distributed under the Apache 2 License. See LICENSE
for more information.
Contact
Meena (Menas) Erian - menas@portacode.com
Project Link: https://github.com/meena-erian/pdr
Acknowledgements
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.