NoSQL Systems @ RomaTreatzeni.dia.uniroma3.it › didattica › BD › 20112012 › NoSQLSOS.pdf ·...
Transcript of NoSQL Systems @ RomaTreatzeni.dia.uniroma3.it › didattica › BD › 20112012 › NoSQLSOS.pdf ·...
![Page 2: NoSQL Systems @ RomaTreatzeni.dia.uniroma3.it › didattica › BD › 20112012 › NoSQLSOS.pdf · Usage example {matricola = ”281283”, nome = “Luca”, cognome = ”Rossi”,](https://reader035.fdocuments.in/reader035/viewer/2022063000/5f0f333a7e708231d442fb5d/html5/thumbnails/2.jpg)
• What is NoSQL – “One size does not fit all” – Main themes – Timeline – Adop1on
• SOS -‐ Save Our Systems – NoSQL Issues – What we are working on
Outline
![Page 3: NoSQL Systems @ RomaTreatzeni.dia.uniroma3.it › didattica › BD › 20112012 › NoSQLSOS.pdf · Usage example {matricola = ”281283”, nome = “Luca”, cognome = ”Rossi”,](https://reader035.fdocuments.in/reader035/viewer/2022063000/5f0f333a7e708231d442fb5d/html5/thumbnails/3.jpg)
• Mismatch between RDBMS features and applica1ons requirements – Some features are unneeded – Others are lacking (and desirable)
• Choose the right tool for your needs
“One size does not fit all”
![Page 4: NoSQL Systems @ RomaTreatzeni.dia.uniroma3.it › didattica › BD › 20112012 › NoSQLSOS.pdf · Usage example {matricola = ”281283”, nome = “Luca”, cognome = ”Rossi”,](https://reader035.fdocuments.in/reader035/viewer/2022063000/5f0f333a7e708231d442fb5d/html5/thumbnails/4.jpg)
• Unneeded complexity – Rigid schemas – ACID proper1es
Why not Relational?
• Hard to scale – Complexity of seJng up database clusters – Running on commodity hardware
![Page 5: NoSQL Systems @ RomaTreatzeni.dia.uniroma3.it › didattica › BD › 20112012 › NoSQLSOS.pdf · Usage example {matricola = ”281283”, nome = “Luca”, cognome = ”Rossi”,](https://reader035.fdocuments.in/reader035/viewer/2022063000/5f0f333a7e708231d442fb5d/html5/thumbnails/5.jpg)
• 2003 – Memcached • 2006 – Google BigTable • 2007 – Amazon Dynamo • 2007 – HBase • 2008 – Cassandra • 2009 – Redis, Riak, MongoDB,
Voldemort, …
NoSQL Timeline
Pioneers
Open source projects
![Page 6: NoSQL Systems @ RomaTreatzeni.dia.uniroma3.it › didattica › BD › 20112012 › NoSQLSOS.pdf · Usage example {matricola = ”281283”, nome = “Luca”, cognome = ”Rossi”,](https://reader035.fdocuments.in/reader035/viewer/2022063000/5f0f333a7e708231d442fb5d/html5/thumbnails/6.jpg)
• 2003 – Memcached • 2006 – Google BigTable • 2007 – Amazon Dynamo • 2007 – HBase • 2008 – Cassandra • 2009 – Redis, Riak, MongoDB,
Voldemort, …
NoSQL Timeline
Pioneers
Open source projects
?
![Page 7: NoSQL Systems @ RomaTreatzeni.dia.uniroma3.it › didattica › BD › 20112012 › NoSQLSOS.pdf · Usage example {matricola = ”281283”, nome = “Luca”, cognome = ”Rossi”,](https://reader035.fdocuments.in/reader035/viewer/2022063000/5f0f333a7e708231d442fb5d/html5/thumbnails/7.jpg)
• 2003 – Memcached • 2006 – Google BigTable • 2007 – Amazon Dynamo • 2007 – HBase • 2008 – Cassandra • 2009 – Redis, Riak, MongoDB,
Voldemort, … … • Late 2011 – Oracle NoSQL
NoSQL Timeline
Pioneers
Open source projects
Commercial players
![Page 8: NoSQL Systems @ RomaTreatzeni.dia.uniroma3.it › didattica › BD › 20112012 › NoSQLSOS.pdf · Usage example {matricola = ”281283”, nome = “Luca”, cognome = ”Rossi”,](https://reader035.fdocuments.in/reader035/viewer/2022063000/5f0f333a7e708231d442fb5d/html5/thumbnails/8.jpg)
• Strong adopMon by both big companies and startups
• Different focuses: – Big companies: scalability, performance – Startups: flexibility, performance, low cost
• An impressive lineup: – Facebook: Cassandra, HBase – Google: BigTable – Amazon: SimpleDB, DynamoDB – TwiZer: FlockDB, HBase – LinkedIn: Voldemort, SenseiDB …
Rise of NoSQL
![Page 9: NoSQL Systems @ RomaTreatzeni.dia.uniroma3.it › didattica › BD › 20112012 › NoSQLSOS.pdf · Usage example {matricola = ”281283”, nome = “Luca”, cognome = ”Rossi”,](https://reader035.fdocuments.in/reader035/viewer/2022063000/5f0f333a7e708231d442fb5d/html5/thumbnails/9.jpg)
• Replica1on and distribu1on of data across many servers
• Flexible data models – Ability to dynamically add new aTributes to data records
• Simple interfaces (no SQL) – Focus on simple opera1ons
• No standardiza1on L
Some recurring features
![Page 10: NoSQL Systems @ RomaTreatzeni.dia.uniroma3.it › didattica › BD › 20112012 › NoSQLSOS.pdf · Usage example {matricola = ”281283”, nome = “Luca”, cognome = ”Rossi”,](https://reader035.fdocuments.in/reader035/viewer/2022063000/5f0f333a7e708231d442fb5d/html5/thumbnails/10.jpg)
• What if: – I want to use many DBMSes at the same 1me – I want to migrate my data – I want to decouple my app from a specific technology
• Reverse the canonical problem: – One size (DBMS) does not fit all (apps)… – …but one size (your app) should fit all (the DBMSes)
…and some recurring problems
![Page 11: NoSQL Systems @ RomaTreatzeni.dia.uniroma3.it › didattica › BD › 20112012 › NoSQLSOS.pdf · Usage example {matricola = ”281283”, nome = “Luca”, cognome = ”Rossi”,](https://reader035.fdocuments.in/reader035/viewer/2022063000/5f0f333a7e708231d442fb5d/html5/thumbnails/11.jpg)
• Goal: – Seamless access to different NoSQL databases.
• Requirements: – Lightweight: small footprint on performances – Coherent: with main NoSQL themes and features
• Hint: do not reimplement SQL – Seriously, someone has done it
– Scalable: easily extendable to different technologies and DBMSes
SOS – Save our systems
![Page 12: NoSQL Systems @ RomaTreatzeni.dia.uniroma3.it › didattica › BD › 20112012 › NoSQLSOS.pdf · Usage example {matricola = ”281283”, nome = “Luca”, cognome = ”Rossi”,](https://reader035.fdocuments.in/reader035/viewer/2022063000/5f0f333a7e708231d442fb5d/html5/thumbnails/12.jpg)
• SOS is a Database Access Layer between the app and the data store – It collects data from the interface and seamlessly manages its transla1on
and deployment to specific DBMSes
• ImplementaMons provided for three data stores belonging to different families: – HBase (column-‐based store) – Redis (key-‐value store) – MongoDB (document store)
SOS – Save our systems
Common Interface to access different NoSQL systems
Common Data Model instances are mapped to the DBMSes of choice
![Page 13: NoSQL Systems @ RomaTreatzeni.dia.uniroma3.it › didattica › BD › 20112012 › NoSQLSOS.pdf · Usage example {matricola = ”281283”, nome = “Luca”, cognome = ”Rossi”,](https://reader035.fdocuments.in/reader035/viewer/2022063000/5f0f333a7e708231d442fb5d/html5/thumbnails/13.jpg)
Usage example
Studente luca = new Studente(...);
DatabaseHandler db = new HBaseHandler(); db.put("studenti", luca.getMatricola(), luca);
![Page 14: NoSQL Systems @ RomaTreatzeni.dia.uniroma3.it › didattica › BD › 20112012 › NoSQLSOS.pdf · Usage example {matricola = ”281283”, nome = “Luca”, cognome = ”Rossi”,](https://reader035.fdocuments.in/reader035/viewer/2022063000/5f0f333a7e708231d442fb5d/html5/thumbnails/14.jpg)
Usage example
Studente luca = new Studente(...);
DatabaseHandler db = new HBaseHandler(); db.put("studenti", luca.getMatricola(), luca);
CollecMon name Object Id Object
![Page 15: NoSQL Systems @ RomaTreatzeni.dia.uniroma3.it › didattica › BD › 20112012 › NoSQLSOS.pdf · Usage example {matricola = ”281283”, nome = “Luca”, cognome = ”Rossi”,](https://reader035.fdocuments.in/reader035/viewer/2022063000/5f0f333a7e708231d442fb5d/html5/thumbnails/15.jpg)
Usage example
public class Studente {
private String matricola; private String nome; private String cognome; private Set<Verbalizzazione> verbs; ...
Java
{ matricola = ”281283”, nome = “Luca”, cognome = ”Rossi”, verbalizzazioni = [ { id = ”10001”, corso = { id = ”20001”, nome = ”Basi di Dati” }; data = ”12/06/2011”, voto = 28 }, { id = ”10002”, corso = { id = ”20004”, nome = ”Crittografia”, }; data = ”21/05/2011”, voto = 30 } ]} JSON
![Page 16: NoSQL Systems @ RomaTreatzeni.dia.uniroma3.it › didattica › BD › 20112012 › NoSQLSOS.pdf · Usage example {matricola = ”281283”, nome = “Luca”, cognome = ”Rossi”,](https://reader035.fdocuments.in/reader035/viewer/2022063000/5f0f333a7e708231d442fb5d/html5/thumbnails/16.jpg)
Usage example
{ matricola = ”281283”, nome = “Luca”, cognome = ”Rossi”, verbalizzazioni = [ { id = ”10001”, corso = { id = ”20001”, nome = ”Basi di Dati” }; data = ”12/06/2011”, voto = 28 }, { id = ”10002”, corso = { id = ”20004”, nome = ”Crittografia”, }; data = ”21/05/2011”, voto = 30 } ]} JSON
_top verbalizzazioni[]
matricola = “281283” nome = “Luca” cognome = “Rossi”
[0].id = “10001” [0].corso.id = “20001” [0].corso.nome = “Basi di Dati” [0].data = “12/06/2011” [0].voto = 28
[1].id = “10001” [1].corso.id = “20004” [1].corso.nome = “Crittografia” [1].data = “21/05/2011” [1].voto = 30
HBase
![Page 17: NoSQL Systems @ RomaTreatzeni.dia.uniroma3.it › didattica › BD › 20112012 › NoSQLSOS.pdf · Usage example {matricola = ”281283”, nome = “Luca”, cognome = ”Rossi”,](https://reader035.fdocuments.in/reader035/viewer/2022063000/5f0f333a7e708231d442fb5d/html5/thumbnails/17.jpg)
We have theses!