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?
@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/
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.
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.