How to protect my database?

How to protect my database?

Postby e151761 » 2013-11-18 19:54:11

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?
e151761
 
Posts: 25
Joined: 2013-05-23 07:05:33

Re: How to protect my database?

Postby kari » 2013-11-19 10:27:03

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
kari
Techila Staff
Techila Staff
 
Posts: 50
Joined: 2012-07-18 11:14:09

Re: How to protect my database?

Postby nirali31 » 2019-03-12 11:20:09

The reference link was useful ..!!!
nirali31
 
Posts: 6
Joined: 2019-02-09 09:01:17


Return to Python

cron