POLYGLOT                                 PERSISTENCE                       choosing the right persistence option for the t...
> WHOAMI                          @gertfindel                       prof@puc                       tech@acidlabsThursday, M...
“if you only have a hammer, you tend to see                                            every problem as a nail”           ...
sql                       Structured Query Language                       ACID                       “Normalization is goo...
Scaling RDBMS                       Launch successful service                       Read saturation: add caching          ...
nosql                       No SQL as query lang.                       Distributed architecture                       Not...
NoSQL Flavors                       Document Store    CouchDB, SimpleDB                       Graph                 Neo4j,...
Thursday, May 17, 12
it’s not about                       SQL vs. NosqlThursday, May 17, 12
it’s not about                       SQL vs. Nosql                                       it’s all about                   ...
USE CASE: ____        social network - crowdfunding presents                                                        transa...
USE CASE: ____                       Open Graph: Graph DB for Relationships               FB.api(/me/friends, function(res...
USE CASE: ____                          MySQL: RDBMS for Transactions                   need to re-assemble data in differ...
USE CASE: ____                   Redis: Key/Value Store for User Activity Log                               High volume of...
USE CASE: ____                       Neo4j: Graph DB for RecommendationsRapidly traverse links between friends, pledges, t...
USE CASE: ____                                       Mongo: BSON Key/Value Store                                 Product F...
MY 2 CENTS                       •   Decision based on 3V’s: volume, variety                           and velocity       ...
THANKS                       FOR COMING                          ... and give NoSQL a chanceThursday, May 17, 12
Upcoming SlideShare
Loading in...5
×

introduction to Polyglot Persistence

775

Published on

an first introduction to polygot persistence

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
775
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

introduction to Polyglot Persistence

  1. 1. POLYGLOT PERSISTENCE choosing the right persistence option for the task at handThursday, May 17, 12
  2. 2. > WHOAMI @gertfindel prof@puc tech@acidlabsThursday, May 17, 12
  3. 3. “if you only have a hammer, you tend to see every problem as a nail” - Maslow’s MaximThursday, May 17, 12
  4. 4. sql Structured Query Language ACID “Normalization is good” SELECT isbn, title, price FROM Book WHERE price < AVG (SELECT price FROM Book) ORDER BY title;Thursday, May 17, 12
  5. 5. Scaling RDBMS Launch successful service Read saturation: add caching Write saturation: add hardware Queries slow down: denormalize Reads still too slow: prematerialise common queries, stop joining Writes too slow: drop secondary indexes and triggersThursday, May 17, 12
  6. 6. nosql No SQL as query lang. Distributed architecture Not necessarily ACID > BASE: Basically Available, Soft State, Eventually Consistent > CAP: Consistency, Availability, Partition ToleranceThursday, May 17, 12
  7. 7. NoSQL Flavors Document Store CouchDB, SimpleDB Graph Neo4j, FlockDB Key-Value store Riak, Cassandra Tabular BigTable, Hadoop RDF SPARQL basedThursday, May 17, 12
  8. 8. Thursday, May 17, 12
  9. 9. it’s not about SQL vs. NosqlThursday, May 17, 12
  10. 10. it’s not about SQL vs. Nosql it’s all about SQL+ NosqlThursday, May 17, 12
  11. 11. USE CASE: ____ social network - crowdfunding presents transactions API MySQL mobile logs re com men da tio cat ns Redis alo g Neo4j web Mongo soon at http://bufys.comThursday, May 17, 12
  12. 12. USE CASE: ____ Open Graph: Graph DB for Relationships FB.api(/me/friends, function(response) { friends = response.data; for ( var i = 0; i < friends.length; i ++ ) { handle( friends[i] ); } });Thursday, May 17, 12
  13. 13. USE CASE: ____ MySQL: RDBMS for Transactions need to re-assemble data in different ways - native avg, count and more. ACID transactions needed $$Thursday, May 17, 12
  14. 14. USE CASE: ____ Redis: Key/Value Store for User Activity Log High volume of writes on multiple nodes Rescue complete log per user Logs are in memory and might be distributedThursday, May 17, 12
  15. 15. USE CASE: ____ Neo4j: Graph DB for RecommendationsRapidly traverse links between friends, pledges, taggings and ratings Type = Event es Pledg Name = Gert Type = Person created Name = Mauko Type = Person Kno s w s Name = Alex Know Type = PersonThursday, May 17, 12
  16. 16. USE CASE: ____ Mongo: BSON Key/Value Store Product Families are very different => Schemaless { name: “Macbook Pro 2011”, Products make natural aggregate P[1]: price: “2000”, inches: “13” } Lots of reads, infrequent writes { name: “Chilean Computer”, P[2]: price: “1500000”, currency: ”CLP” inches: “13” }Thursday, May 17, 12
  17. 17. MY 2 CENTS • Decision based on 3V’s: volume, variety and velocity • Feature lists should be used only in apples-to-apples comparisons. • Don’t use a RDBMS as a hammer. • Don’t use a NoSQL db just because. • Don’t use both just because it *might* be fun.Thursday, May 17, 12
  18. 18. THANKS FOR COMING ... and give NoSQL a chanceThursday, May 17, 12

×