jeudi 26 mars 2015

How to handle to many inserts?


I have a database which are accessed from remote locations in the world wit very long delays and poor transfer speeds. I currently transfer the data using a transaction since either all or no data should be inserted. Currently the values are inserted one at the time and it takes a total of about 37 seconds for 200 inserts before the commit.


The problem is that there may be 10 sites continuously trying to insert data wit a 2 minutes interval. If they fail they will retry until they succeeded. This adds up to an impossible situation as they will start growing a backlog.


I have understand I can use snapshot as Isolation level to allow reads in parallel. But how should I handle the parallel insets? How do banks and other system do it since they should also get a backlog if they do it in a queue?





Aucun commentaire:

Enregistrer un commentaire