Page 1 of 1

How to protect my database?

PostPosted: 2013-11-18 19:54:11
by e151761
I have a worker code (Python) which reads data from a SQL database in the cloud.

If I scale down my computing capacity using the Techila Deployment Tool there is a risk that one of the dying workers are currently performing a database operation. If this happens, my database can break. Are there any mechanisms which I could use to to protect my database? Can I somehow ask Techila to wait until the worker has finished the db operation?

Re: How to protect my database?

PostPosted: 2013-11-19 10:27:03
by kari
You will need to use transactions with the database. Before making any database operations you begin a transaction and when all the operations are complete you either commit or rollback the whole transaction. This will ensure that the database operations are always either completely performed or not at all and therefore the database won't break.

https://en.wikipedia.org/wiki/Database_transaction
https://en.wikipedia.org/wiki/ACID

Re: How to protect my database?

PostPosted: 2019-03-12 11:20:09
by nirali31
The reference link was useful ..!!!