No SQL Databases FRO M SQL TO NOS
No. SQL Databases FRO M SQL TO NOS QL , DI FFERENCES, TRANSIT IO N, HYBRID SYS TEMS
Overview • Introduction • The issues of cloud computing • General principle • Data modeling • Existing No. SQL Data stores • Conclusion
Introduction
Introduction • Expansion of cloud computing and data-intensive services • Vertical scaling is not a solution • No. SQL databases buzz ! • Scalability support challenge
The issues of cloud computing FACE BOOK, TWITTE R,
Horizontal scaling (scale-out) VS. Vertical scaling (scale-up)
Shared-nothing architecture
Horizontal scaling (scale-out) VS. Vertical scaling (scale-up)
Horizontal scaling (scale-out) VS. Vertical scaling (scale-up)
What are we looking for ? • Data consistency • Availability • Scalability
General principle ACID, CA P, B ASE
Atomicity, Consistency, Isolation, Durability (ACID properties) • Those properties are verified by relational databases • We don’t need them in all cases • Corporate cloud databases ≠ Consumer cloud databases • No. SQL databases do not provide ACIP properties !
Consistency, Availability, Partition Tolerance (The CAP theorem)
Basically Available, Soft State, Eventually consistent • The application works basically all the time • It is not consistent all the time • If there is no new updates, all accesses will return the latest value
No. SQL • First, it was for No SQL • It is now considered as being Not Only SQL • Alternative approach for data storage • Loss of a flexible query language • Mostly do not use SQL as their query language • Do not support JOIN and ORDER BY operation • Can be implemented client-side
Data modeling FACE BOOK, TWITTE R,
Data model transformation: A challenging task • Logic, user oriented model intuitively described in No. SQL data stores • Mostly Combination of (key, value) • Example: Name: "Jack", Address: "Malte zske n. 25, 118 00 Praha 1“ Grandchildren: {Claire: "7", Barbara: "6", "Magda: "3", "Kirsten: "1", "Otis: "3", Richard: "1"} • Grandchildren: Barbara = 6
Intuitive data model • Example: JPA (Java Persistence API) has a limit ! • Duplication/Denormalization is now allowed and even recommended to increase availability
Existing No. SQL data stores FACE BOOK, TWITTE R,
1. Key-value stores • Based on a programmer defined key • Insert, delete, and index searching • No secondary indexes or keys • Most famous: Redis, Memcached • Example: User information on a web application
2. Document stores • More complex data are supported • Support several indexes • Support nested documents • Most famous: Mongo. DB, Couch. DB • Example: E-commerce product
3. Extensible record stores / Wide column stores • Horizontal and vertical partitioning • Columns are distributed by using column groups • Rows are split through sharding on the primary key • Most famous: Big. Table (Google), Cassandra (Apache) • Example: Similar to Document stores
Querying a No. SQL Database • Restricted SQL language • Typical API: • Get(key) • Put(key, value) • Delete(key) • Execute(key, operations, parameters)
Conclusion THE BA D A RTISTS STEA L, THE G REA T AR TISTS IMITA TE
Conclusion • No. SQL is provide another point of view on data storage • No. SQL will not replace relational databases ! • Horizontal scalability is more easily achieved using No. SQL databases
- Slides: 26