SlideShare a Scribd company logo
1 of 16
Book by: Pramodkumar J Sadalage & Martin Fowler
Review by: Lester Martin
What’s Wrong with SQL?
Nothing Really!!
• RDBMS technologies are VERY mature and the backbone of most systems today
  • ACID benefits counted on by OLTP systems
  • Transactions spanning multiple DML statements (distributed txns w/2PC, too!)
  • Can be an integration technology all by itself (yes… “data integration” does pain an
    OO developer like myself, but it is a reality that is being leveraged every single day)
  • Great for well-understood and normalized data models

But…
• The impedance mismatch between in-memory object graphs is always there
• Cannot scale (at least in a cost-effective manner) to LUDICROUS data
  • Thinking of the 3 V’s of Big Data; Variety, Velocity and Volume
    • Example: capturing cell phone location data for 100M cell phones every 10 seconds
      would yield almost 1T records/day
What is NoSQL?
Generic name for persistence stores with these common characteristics
• Not using the relational model
• Running well on clusters
• Open-source
• Built for the 21st century web estates
• Schemaless
• (usually) No transactioning beyond single operation

Cements the concept of Polygot Persistence
• Today we see relational databases as one option for data storage
• With many (evolving) NoSQL types and implementations solving different use cases we
  will evolve to an approach of using different data stores with the same application
• We’ll visit this again!
Relational Data Models
                     RDBMS data models are
                     visualized via Entity Relationship
                     Diagrams as well as physical DDL
                     • Elements of the bigger whole are
                       stored independently in tables with
                       relational constraints (such as foreign
                       keys) identifying the relationships
                     • This design is aggregate-ignorant
Aggregate Data Models
                                                  {                                                                    "Status":"OPEN"
An aggregate is a collection of related            "Person" : {
                                                      "FirstName" : "Fred",
                                                                                                                    },
                                                                                                                    { "Type":"MC",
objects treated as a single unit                   },
                                                      "LastName" : "Flintstone"                                        "Bank":"Chase",
                                                                                                                       "Account":"MC4567",
                                                   "Addresses" : [                                                     "Limit":5000.00,
• It is physically stored in this format – data       { "Address":                                                     "Balance":4321.12,
                                                         { "Country":"USA",                                            "PaymentHistory":[
  and model definition together                            "Original":{ "raw":"10 Rubble Blvd. Bedrock,                   {"0111":1},
                                                  NJ 03241"},                                                             {"0211":0},
• Becomes painful when there are many                      "Standardized":{"StreetNumber":"10",
                                                            "StreetName":"RUBBLE",
                                                                                                                          {"0311":1},
                                                                                                                          {"0411":1},
                                                            "StreetSuffix":"BLVD",                                        {"0511":1},
  ways to retrieve the same/similar data                    "City":"BEDROCK",                                             {"0611":1},
                                                            "State":"NJ",                                                 {"0711":1},
• Transactions occur at the aggregate level                 "ZipCode":"03241"},
                                                           "Cleansed":{ "StreetNumber":"10",
                                                                                                                          {"0811":1},
                                                                                                                          {"0911":-1}
  (addresses most of the txn’ing concerns)                  "StreetName":"RUBBLE",
                                                            "StreetSuffix":"BLVD",
                                                                                                                       ],
                                                                                                                       "Status":"OPEN"
                                                            "City":"BEDROCK",                                       }
                                                            "State":"NJ",                                         ],
                                                            "ZipCode":"03241"}                                    "Mortgages" : [
                                                         }                                                           { "Bank":"...",
                                                      }                                                                 "Account":"...",
                                                   ],                                                                   "OriginalAmount":"...",
                                                   "LinesOfCredit" : {                                                  "CurrentBalance":"...",
                                                      "CreditCards" : [                                                 "PaymentHistory":[
                                                         { "Type":"VISA",                                                 {"0109":1},
                                                            "Bank":"BOA",                                                 {"0209":0},
                                                            "Account":"V1234",                                            {"0309":-1}
                                                            "Limit":4000.00,                                            ]
                                                            "Balance":1205.32,                                       }
                                                            "PaymentHistory":[                                    ]
                                                               {"0109":1},                                    }
                                                               {"0209":0},                                }
                                                               {"0309":-1}
                                                            ],
Types of NoSQL Technologies
Key-Value Stores
• Only able to look up data by the Key
• Value is essentially a CLOB/BLOB (any format)

Document Databases
• Data is stored in self-describing, hierarchical tree data structures which can consist of
  maps, collections and primitive values (utilizing XML or JSON/BSON)
• Searchable by any element of the aggregate and supports indexing

Column-Family Stores
• Essentially a key-value store where the Value is a “map of maps” (no constraints on how
  data values are formatted)

Graph Databases
• Something entirely different than the others in almost every way
• Stores small records (nodes) with directional relationships (edges)
  • Both, nodes and edges can have properties
Schemaless? Really?
Technically – YES
Logically (and Practically) – NO, or more appropriately NOT EXACTLY
• Applications themselves have an implicit schema they are expecting

This flexibility enables faster development than with RDBMS schema mods
Similar structures can coexist (can also allow for gradual data migration)
You base your aggregate model on your data access, not to attain 3NF (this
could mean data duplication)
Requires you to see the model’s implementation as an application
database, not an integration database (encourages you to build a service
layer)
Distribution Models
Sharding (aka partitioning)
• “The secret ingredient in the web-scale sauce”
• Storing different data on separate nodes; each handling their own read & write ops

Replication (for resiliency)
• Copying data across multiple server so each bit of data can be found in multiple places

Combining Sharding & Replication
Of course… if you CAN work within a single server then do it!
• Less complexity
• Even better performance
CAP Theorem & Eventual Consistency
What kind of NoSQL talk would this be without these?
Worthy of a deep discussion all by itself, the CAP theorem in a nutshell
states that you can pick two of the following characteristics
• Consistency
• (read & write) Availability
• Partition tolerance

If you thought ACID was a catchy acronym, the NoSQL won’t disappoint as it
gives us the opposite of ACID – BASE which stands for
• Basically Available
• Soft state
• Eventual consistency
Visualizing CAP Theorem & BASE
Implementation Options
NoSQL Type         Popular Options              Book includes dedicated chapters
Key-Value          Riak, Redis,                 addressing each NoSQL type
                   Memcached, Amazon            discussing features of
                   DB, Project Voldemort        • Consistency
                                                • Transactions
Document           MongoDB, CouchDB,
                   Terrastore, OrientDB,        • Availability
                   RavenDB                      • Query Features
Column-Family      Cassandra, HBase,            • Scaling
                   Hypertable, Amazon           Also presents suitable use cases
                   Simple DB                    as well as guidance on when not
Graph              Neo4J, Infinite Graph,       to use a particular type
                   OrientDB, FlockDB


Embrace POLYGOT PERSISTENCE
• Leverage the fact that different databases are designed to solve different problems
Today’s RDBMS Architecture…
Many enterprises tend to use the same database engine to store business
transactions, session management data, and for other needs such as BI,
reporting, logging, etc
Can Become…
Example implementation of polygot persistence
Or Be Even Better…
Example implementation of wrapping data stores into services
But, With Added Complexity & Cost...
Adding more data storage technologies increases complexity in
programming and operations
Due to RDBMS maturity and the available pool of people with experience,
many, if not most, projects using RDBMS should stick with the default
But… I want to use NoSQL!!
• Find a true use case where the advantages outweigh the additional costs/complexity
• Hedge your bets by wrapping a service layer around your application database
Summary of NoSQL Distilled
It’s short/n/sweet & to the point – you’ve got to appreciate that!!
Presents a quick overview of the NoSQL landscape ending with some
pragmatic recommendations
Good book for those brand-new to NoSQL, but just a bit better for the
person who has done some reading-oriented research and is ready to dive in
head-first in these technologies

More Related Content

Viewers also liked

sim pemasaran
sim pemasaransim pemasaran
sim pemasaran
Jangqie
 
Shelley's Personal Brand Plan
Shelley's Personal Brand PlanShelley's Personal Brand Plan
Shelley's Personal Brand Plan
shelleyannethomas
 
Insider trading_in_turkey
Insider trading_in_turkeyInsider trading_in_turkey
Insider trading_in_turkey
guest0437b8
 
Ggc scrum i jun14 slides
Ggc scrum i jun14 slidesGgc scrum i jun14 slides
Ggc scrum i jun14 slides
Céline Dedaj
 
дорога
дорогадорога
дорога
manana
 
Smart%20 Manual%20rev20060403
Smart%20 Manual%20rev20060403Smart%20 Manual%20rev20060403
Smart%20 Manual%20rev20060403
guest4fb07c
 
Bonnier Annual Review 2009
Bonnier Annual Review 2009Bonnier Annual Review 2009
Bonnier Annual Review 2009
Bonnier
 

Viewers also liked (20)

Essere freelance - guida pratica di orientamento
Essere freelance - guida pratica di orientamentoEssere freelance - guida pratica di orientamento
Essere freelance - guida pratica di orientamento
 
The Golden Weeks and a White Christmas - How do Chinese & British consumers s...
The Golden Weeks and a White Christmas - How do Chinese & British consumers s...The Golden Weeks and a White Christmas - How do Chinese & British consumers s...
The Golden Weeks and a White Christmas - How do Chinese & British consumers s...
 
Hands-on User Experience
Hands-on User ExperienceHands-on User Experience
Hands-on User Experience
 
Ps and Qs of Interviews
Ps and Qs of InterviewsPs and Qs of Interviews
Ps and Qs of Interviews
 
sim pemasaran
sim pemasaransim pemasaran
sim pemasaran
 
Shelley's Personal Brand Plan
Shelley's Personal Brand PlanShelley's Personal Brand Plan
Shelley's Personal Brand Plan
 
Effective Benefit Plan Administration
Effective Benefit Plan AdministrationEffective Benefit Plan Administration
Effective Benefit Plan Administration
 
FCEVs and H2 in California
FCEVs and H2 in CaliforniaFCEVs and H2 in California
FCEVs and H2 in California
 
Strategic view on rosin supply - demand cycles and the impact on speculation
Strategic view on rosin supply - demand cycles and the impact on speculationStrategic view on rosin supply - demand cycles and the impact on speculation
Strategic view on rosin supply - demand cycles and the impact on speculation
 
Insider trading_in_turkey
Insider trading_in_turkeyInsider trading_in_turkey
Insider trading_in_turkey
 
Ggc scrum i jun14 slides
Ggc scrum i jun14 slidesGgc scrum i jun14 slides
Ggc scrum i jun14 slides
 
Seasons
SeasonsSeasons
Seasons
 
Den Hart Portfolio120911
Den Hart Portfolio120911Den Hart Portfolio120911
Den Hart Portfolio120911
 
дорога
дорогадорога
дорога
 
Smart%20 Manual%20rev20060403
Smart%20 Manual%20rev20060403Smart%20 Manual%20rev20060403
Smart%20 Manual%20rev20060403
 
idl_work
idl_workidl_work
idl_work
 
Bonnier Annual Review 2009
Bonnier Annual Review 2009Bonnier Annual Review 2009
Bonnier Annual Review 2009
 
Connectonomics
ConnectonomicsConnectonomics
Connectonomics
 
Spark and Couchbase– Augmenting the Operational Database with Spark
Spark and Couchbase– Augmenting the Operational Database with SparkSpark and Couchbase– Augmenting the Operational Database with Spark
Spark and Couchbase– Augmenting the Operational Database with Spark
 
Get Seen
Get SeenGet Seen
Get Seen
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 

NoSQL Distilled Book Review

  • 1. Book by: Pramodkumar J Sadalage & Martin Fowler Review by: Lester Martin
  • 2. What’s Wrong with SQL? Nothing Really!! • RDBMS technologies are VERY mature and the backbone of most systems today • ACID benefits counted on by OLTP systems • Transactions spanning multiple DML statements (distributed txns w/2PC, too!) • Can be an integration technology all by itself (yes… “data integration” does pain an OO developer like myself, but it is a reality that is being leveraged every single day) • Great for well-understood and normalized data models But… • The impedance mismatch between in-memory object graphs is always there • Cannot scale (at least in a cost-effective manner) to LUDICROUS data • Thinking of the 3 V’s of Big Data; Variety, Velocity and Volume • Example: capturing cell phone location data for 100M cell phones every 10 seconds would yield almost 1T records/day
  • 3. What is NoSQL? Generic name for persistence stores with these common characteristics • Not using the relational model • Running well on clusters • Open-source • Built for the 21st century web estates • Schemaless • (usually) No transactioning beyond single operation Cements the concept of Polygot Persistence • Today we see relational databases as one option for data storage • With many (evolving) NoSQL types and implementations solving different use cases we will evolve to an approach of using different data stores with the same application • We’ll visit this again!
  • 4. Relational Data Models RDBMS data models are visualized via Entity Relationship Diagrams as well as physical DDL • Elements of the bigger whole are stored independently in tables with relational constraints (such as foreign keys) identifying the relationships • This design is aggregate-ignorant
  • 5. Aggregate Data Models { "Status":"OPEN" An aggregate is a collection of related "Person" : { "FirstName" : "Fred", }, { "Type":"MC", objects treated as a single unit }, "LastName" : "Flintstone" "Bank":"Chase", "Account":"MC4567", "Addresses" : [ "Limit":5000.00, • It is physically stored in this format – data { "Address": "Balance":4321.12, { "Country":"USA", "PaymentHistory":[ and model definition together "Original":{ "raw":"10 Rubble Blvd. Bedrock, {"0111":1}, NJ 03241"}, {"0211":0}, • Becomes painful when there are many "Standardized":{"StreetNumber":"10", "StreetName":"RUBBLE", {"0311":1}, {"0411":1}, "StreetSuffix":"BLVD", {"0511":1}, ways to retrieve the same/similar data "City":"BEDROCK", {"0611":1}, "State":"NJ", {"0711":1}, • Transactions occur at the aggregate level "ZipCode":"03241"}, "Cleansed":{ "StreetNumber":"10", {"0811":1}, {"0911":-1} (addresses most of the txn’ing concerns) "StreetName":"RUBBLE", "StreetSuffix":"BLVD", ], "Status":"OPEN" "City":"BEDROCK", } "State":"NJ", ], "ZipCode":"03241"} "Mortgages" : [ } { "Bank":"...", } "Account":"...", ], "OriginalAmount":"...", "LinesOfCredit" : { "CurrentBalance":"...", "CreditCards" : [ "PaymentHistory":[ { "Type":"VISA", {"0109":1}, "Bank":"BOA", {"0209":0}, "Account":"V1234", {"0309":-1} "Limit":4000.00, ] "Balance":1205.32, } "PaymentHistory":[ ] {"0109":1}, } {"0209":0}, } {"0309":-1} ],
  • 6. Types of NoSQL Technologies Key-Value Stores • Only able to look up data by the Key • Value is essentially a CLOB/BLOB (any format) Document Databases • Data is stored in self-describing, hierarchical tree data structures which can consist of maps, collections and primitive values (utilizing XML or JSON/BSON) • Searchable by any element of the aggregate and supports indexing Column-Family Stores • Essentially a key-value store where the Value is a “map of maps” (no constraints on how data values are formatted) Graph Databases • Something entirely different than the others in almost every way • Stores small records (nodes) with directional relationships (edges) • Both, nodes and edges can have properties
  • 7. Schemaless? Really? Technically – YES Logically (and Practically) – NO, or more appropriately NOT EXACTLY • Applications themselves have an implicit schema they are expecting This flexibility enables faster development than with RDBMS schema mods Similar structures can coexist (can also allow for gradual data migration) You base your aggregate model on your data access, not to attain 3NF (this could mean data duplication) Requires you to see the model’s implementation as an application database, not an integration database (encourages you to build a service layer)
  • 8. Distribution Models Sharding (aka partitioning) • “The secret ingredient in the web-scale sauce” • Storing different data on separate nodes; each handling their own read & write ops Replication (for resiliency) • Copying data across multiple server so each bit of data can be found in multiple places Combining Sharding & Replication Of course… if you CAN work within a single server then do it! • Less complexity • Even better performance
  • 9. CAP Theorem & Eventual Consistency What kind of NoSQL talk would this be without these? Worthy of a deep discussion all by itself, the CAP theorem in a nutshell states that you can pick two of the following characteristics • Consistency • (read & write) Availability • Partition tolerance If you thought ACID was a catchy acronym, the NoSQL won’t disappoint as it gives us the opposite of ACID – BASE which stands for • Basically Available • Soft state • Eventual consistency
  • 11. Implementation Options NoSQL Type Popular Options Book includes dedicated chapters Key-Value Riak, Redis, addressing each NoSQL type Memcached, Amazon discussing features of DB, Project Voldemort • Consistency • Transactions Document MongoDB, CouchDB, Terrastore, OrientDB, • Availability RavenDB • Query Features Column-Family Cassandra, HBase, • Scaling Hypertable, Amazon Also presents suitable use cases Simple DB as well as guidance on when not Graph Neo4J, Infinite Graph, to use a particular type OrientDB, FlockDB Embrace POLYGOT PERSISTENCE • Leverage the fact that different databases are designed to solve different problems
  • 12. Today’s RDBMS Architecture… Many enterprises tend to use the same database engine to store business transactions, session management data, and for other needs such as BI, reporting, logging, etc
  • 13. Can Become… Example implementation of polygot persistence
  • 14. Or Be Even Better… Example implementation of wrapping data stores into services
  • 15. But, With Added Complexity & Cost... Adding more data storage technologies increases complexity in programming and operations Due to RDBMS maturity and the available pool of people with experience, many, if not most, projects using RDBMS should stick with the default But… I want to use NoSQL!! • Find a true use case where the advantages outweigh the additional costs/complexity • Hedge your bets by wrapping a service layer around your application database
  • 16. Summary of NoSQL Distilled It’s short/n/sweet & to the point – you’ve got to appreciate that!! Presents a quick overview of the NoSQL landscape ending with some pragmatic recommendations Good book for those brand-new to NoSQL, but just a bit better for the person who has done some reading-oriented research and is ready to dive in head-first in these technologies