0

I have a database (PostgreSQL), which I need to update from time to time (every 6 hours). I don't want partial updates to appear on the output, so my idea is:

We use two databases, let them be named prod and update. prod is all the time on duty, while update is being updated every 6 hours and then it should pass changes (or change places) to (with) prod.

How can I implement such behaviour in Django? I know, that there are migrations and db_to_write, db_to_read variants, but they stay not clear to me from the tutorial.

vladfau
  • 1,003
  • 11
  • 22
  • 1
    To prevent partial updates you could use transactions as well :) Writing a custom database backend should do the trick as well. And there's even the option of just using master/slave replication in Postgres – Wolph Feb 21 '15 at 22:56
  • 1
    Doing master/slave replication in Postgres would be the way to go. This is a common problem that databases have solved well. Trying to write your own back end or solve it in Python seems like it would be very easy to get wrong. – alexp Feb 21 '15 at 23:39

0 Answers0