I have a Python/Django Application where we want to horizontal scale based on load. Once scaled up, we will have multiple Django servers (running on different VMs) and single postgreSQL server.
How should the transaction management take place between these servers who don't share any state/information between them?
Should we explicitly take a lock on the row/table etc when we want to commit a transaction?
How should the transaction management take place between these servers who don't share any state/information between them?
That's what your database already does for you.
Should we explicitly take a lock on the row/table etc when we want to commit a transaction?
Why? Your database already does this for you.
Just use the ordinary Django transaction features.
https://docs.djangoproject.com/en/1.3/topics/db/transactions/
A single database is already the simplest horizontally scalable solution. Nothing more to worry about.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With