Previous | Next --- Slide 17 of 54
Back to Lecture Thumbnails
jrgallag

How would the consistency problem with replicating databases be resolved? Is there something analogous to locking or MESI protocol for databases - or would doing this be too expensive?

blairwaldorf

@jrgallag: If there are multiple nodes handling requests, there would need to be a protocol to ensure that the timelines of all these databases are aligned. The implementation/protocol would be different across different types of databases. One way of doing this would be via a Distributed Lock Manager which uses locking.

I found this interesting article about ways of maintaining consistency -- https://mariadb.org/eventually-consistent-databases-state-of-the-art/

1pct

Since most of the transactions will be reads rather than writes, we can create multiple replica of the database that only handles reads. But at some point, there will be writes. The problem is that the database that can handle write will need to update all the other database which give rise to consistency problems.

msfernan

As mentioned in lecture, scaling out a database may work for things such as updates to newsfeeds. It doesn't matter too much the time an update is written to someones newsfeed databse. However, the consistency problem can get tricky for bank accounts as the various databases that store bank account information have to be updated instantaneously.