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

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

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
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 

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