Upload
elvis-saravia
View
71
Download
0
Embed Size (px)
Citation preview
"The primary online data store for an application is the worst place to take a risk with
new technology." Adam D' Angelo - Quora CEO
CAP Theorem
"Of three properties of shared-data systems-data Consistency, system Availability and tolerance to
network Partitions - only two can be achieved at any given moment in time."
- 2000 Prof. Eric Brewer, PoDC Conference Keynote- 2002 Seth Gilbert and Nancy Lynch, ACM SIGACT News 33(2)
How Do I choose the right Database?
How do elephants make decisions?
They make the smartest decisions, hence no sacrifices are needed.
Requirement #4: What about Transactions?
● Transactions ensure that you atomically make changes to your database.
Requirement #5: What about Consistency?
● Achieved through ACID transactions.
● Consistency is about ensuring that all clients have the same view of the data.
Requirement #6: How about Scaling?
● Option 1: I assume we can scale as we go...
● Option2: How about implementing Layers (Memecached) on top of Relational DBs. (Facebook, Twitter and Airbnb)
● Option 3: If scaling is urgent, how about partitioning at the application level. (FriendFeed)
Use Case: Kuai List
● We use PostgreSQL for writing and updating listings only.
● For retrieving at desirable speeds we use Amazon Elasticache (Redis - in-memory cache) on top of our core relational database.
● NoSQL (MongoDB) for storing listings that never change.
Scaling Challenge #1: Host in the cloud
● We migrated our core database to Amazon RDS (with zero downtime).
● Amazon RDS makes it easy to use replication to enhance availability and reliability for production workloads.