some (important) database concepts
TRANSCRIPT
![Page 1: Some (important) database concepts](https://reader036.vdocuments.us/reader036/viewer/2022082523/5878f89d1a28ab49608b5f85/html5/thumbnails/1.jpg)
Some (important) database concepts
Ishan AgrawalFounder and CTO, Ondago.tv
@ishanagr
![Page 2: Some (important) database concepts](https://reader036.vdocuments.us/reader036/viewer/2022082523/5878f89d1a28ab49608b5f85/html5/thumbnails/2.jpg)
Prerequisites
• Basic understanding of how databases work.
• Basic understanding the why and how of SQL and NoSQL databases.
• Basic understanding of distributed computing.
![Page 3: Some (important) database concepts](https://reader036.vdocuments.us/reader036/viewer/2022082523/5878f89d1a28ab49608b5f85/html5/thumbnails/3.jpg)
Distributed Databases
• Most popular databases have distributed implementations
• DynamoDB• Cassandra• Riak• Couchbase• Redis• Aerospike
![Page 4: Some (important) database concepts](https://reader036.vdocuments.us/reader036/viewer/2022082523/5878f89d1a28ab49608b5f85/html5/thumbnails/4.jpg)
Distributed Databases
• Replication• Redundancy• Backups• Parallelism• Availability• Consistency• Sharding
![Page 5: Some (important) database concepts](https://reader036.vdocuments.us/reader036/viewer/2022082523/5878f89d1a28ab49608b5f85/html5/thumbnails/5.jpg)
Brewer’s CAP theorem (1998)It is impossible for a distributed computer system to simultaneously provide all three of the following guarantees:
• Consistency – A read is guaranteed to return the most recent write for a given client.
• Availability - A non-failing node will return a reasonable response within a reasonable amount of time (no error or timeout).
• Partition Tolerance - The system will continue to function when network partitions occur.
![Page 6: Some (important) database concepts](https://reader036.vdocuments.us/reader036/viewer/2022082523/5878f89d1a28ab49608b5f85/html5/thumbnails/6.jpg)
Partition Tolerance
• Not much of an option
![Page 7: Some (important) database concepts](https://reader036.vdocuments.us/reader036/viewer/2022082523/5878f89d1a28ab49608b5f85/html5/thumbnails/7.jpg)
CP
• Consistency over Availability
• Disallow any updates to the system.
![Page 8: Some (important) database concepts](https://reader036.vdocuments.us/reader036/viewer/2022082523/5878f89d1a28ab49608b5f85/html5/thumbnails/8.jpg)
AP
• Availability over Consistency
• Allow updates in both – inconsistency
• Eventual Consistency
![Page 9: Some (important) database concepts](https://reader036.vdocuments.us/reader036/viewer/2022082523/5878f89d1a28ab49608b5f85/html5/thumbnails/9.jpg)
CA? (2012)
• We cannot have full consistency with full availability.
• A bit of both?
• Read from all, block updates.• Asynchronous syncs – eventual consistency.
![Page 10: Some (important) database concepts](https://reader036.vdocuments.us/reader036/viewer/2022082523/5878f89d1a28ab49608b5f85/html5/thumbnails/10.jpg)
Recommended Readings
• Designing Data-Intensive Applications – Martin Kleppmann
• Dynamo – Amazon’s Highly Available KV store
• CAP theorem revisited – Robert Griener
![Page 11: Some (important) database concepts](https://reader036.vdocuments.us/reader036/viewer/2022082523/5878f89d1a28ab49608b5f85/html5/thumbnails/11.jpg)
Shameless Plug
• Extreme Engineering Mumbai• http://www.meetup.com/Extreme-Engineering-Mu
mbai/
• Scalable Engineering• Book Chapters• Research Papers• Tech conference post-mortem’s
Ps: If you are Business person looking for a tech co-founder please try another meetup!
![Page 12: Some (important) database concepts](https://reader036.vdocuments.us/reader036/viewer/2022082523/5878f89d1a28ab49608b5f85/html5/thumbnails/12.jpg)
Shameless Plug #2
• Evens This Week Mumbai• http://bit.ly/mumbaieventsthisweek
• Every Monday, all cool events
![Page 13: Some (important) database concepts](https://reader036.vdocuments.us/reader036/viewer/2022082523/5878f89d1a28ab49608b5f85/html5/thumbnails/13.jpg)
Thanks for your time!@ishanagr