SlideShare a Scribd company logo
SQL vs NoSQL
In The Beginning
• Programmers processed files directly
• You would open a file, seek and read its contents, and parse
  out a record (same for insert / update / delete)
• Obviously, a lot of similar code was written, and eventually
  refactored into libraries
• These libraries became databases, each with their own
  strengths and weaknesses, and their own APIs
• IBM came up with the idea for SEQUEL (Structured English
  QUEry Language) around 1970, and was implemented in
  several database libraries
RDBMS
• Relational DataBase Management System
• Main Focus is ACID
  • Atomicity – Each transaction is atomic. If one part of it fails, the
    entire transaction fails (and is rolled back)
  • Consistency – Every transaction is subject to a consistent set of
    rules (constraints, triggers, cascades)
  • Isolation – No transaction should interfere with another
    transaction
  • Durability – Once a transaction is committed, it remains
    committed
RDBMS
• ACID is important
  • But only when it’s important
  • i.e. banking, finance, safety systems, etc.
  • The kinds of systems that people were building with computers
    30 years ago (and today)
• ACID adds overhead
  • Features like atomicity, isolation basically force database servers
    to use sequential evaluation
  • Add a concept like multiple-servers?
RDBMS
• Other Features
  •   Typed columns
  •   Normalized data
  •   Supports broad, unrestrained queries
  •   Has its own query optimizer
  •   Consistent way of accessing data (SQL)
SQL
•   A common (for the most part) query language for RDBMS
•   Enables unrestrained queries against normalized data
•   Geared towards joins, filters, and aggregations
•   Relies heavily on the database server’s query optimization
    • Sometimes requires the involvement of a DBA
The CAP Theorem
• Impossible for any shared data-system to guarantee
  simultaneously all of the following three properties:
  • Consistency – once data is written, all future read requests will
    contain that data
  • Availability – the database is always available and responsive
  • Partition Tolerance – if part of the database is unavailable, other
    parts are unaffected
Good Quote!
Google, Amazon, Facebook, and DARPA all recognized that when
you scale systems large enough, you can never put enough iron
in one place to get the job done (and you wouldn’t want to, to
prevent a single point of failure). Once you accept that you have
a distributed system, you need to give up consistency or
availability, which the fundamental transactionality of
traditional RDBMSs cannot abide.

- Cedric Beust
Enter NoSQL
• RDBMS doesn’t quite fit for *some* requirements
• Google and Amazon decided to make their own stuff (aka
  BigTable and S3 Storage) to meet their own unique needs
  •   Distributed
  •   Scalability
  •   Control over performance characteristics
  •   High availability
  •   Low Latency
  •   Cheap
What is NoSQL?
• Basically a large serialized object store*
  • (mostly) retrieve objects by defined ID
• In general, doesn’t support complicated queries*
• Doesn’t have a structured (or any!) schema*
  • Recommends denormalization
• Designed to be distributed (cloud-scale) out of the box
• Because of this, drops the ACID requirements
  • Any database can answer any query
  • Any write query can operate against any database and will
    “eventually” propagate to other distributed servers


* Dependent on vendor
The opposite of ACID is…
• BASE
  • Basically Available – guaranteed availability
  • Soft-state – the state of the system may change, even without a
    query (because of node updates)
  • Eventually Consistent – the system will become consistent over
    time
• Contrived acronym, but so is ACID :P
NoSQL – Eventual Consistency
• Because of the distributed model, any server can answer any
  query
• Servers communicate amongst themselves at their own pace
  (behind the scenes)
• The server that answers your query might not have the latest
  data
• Who really cares if you see Kim Kardashian’s latest tweet
  instantaneously?
Different Types of NoSQL
• Column Store
  • Column data is saved together, as opposed to row data
  • Super useful for data analytics
  • Hadoop, Cassandra, Hypertable
• Key-Value Store
  • A key that refers to a payload
  • MemcacheDB, Azure Table Storage, Redis
• Document / XML / Object Store
  • Key (and possibly other indexes) point at a serialized object
  • DB can operate against values in document
  • MongoDB, CouchDB, RavenDB
• Graph Store
  • Nodes are stored independently, and the relationship between nodes
    (edges) are stored with data
Also Important – MapReduce
• One of the most common large queries (and hard to optimize) is
  Map Reduce
  •   Map: Select a subset of data (into a key, value pair)
  •   Reduce: Perform some sort of operation on that data
  •   Used primarily for data analysis (reporting)
  •   Example: Average revenue on all invoices in 2010
• In RDBMS, this is usually pretty expensive
  • Involves a full table scan with a select
  • If it’s not a built-in aggregate function, involves custom code on
    database server (sproc/udf)
• In (some) NoSQL, it’s automagically distributed
  • MapReduce functions are automatically distributed across all nodes
    to process, and the result is automatically gathered and returned as
    part of the vendor’s framework
• In Google’s environment, can run a MapReduce operation across all
  their nodes in about 30 minutes.
NoSQL, Mo’ Problems
• Inconsistent APIs between NoSQL providers
• Denormalized data requires you to maintain your own data
  relationships (cascades) in code
• Not a lot of real operational power for DevOps / IT
• Lack of complicated queries requires joins / aggregations /
  filters to be done in code (except for MapReduce)
  • Arguably not a bad thing?
That being said…
    NoSQL-type databases power:

•    Google reader   •   Adobe            •   Boeing
•    Google maps     •   Ebay             •   US Army
•    Blogger.com     •   Facebook         •   Seagate
•    Youtube         •   Hulu             •   Hertz
•    Gmail           •   Last.Fm          •   IBM
•    Amazon          •   LinkedIn         •   Intel
•    Sourceforge     •   New York Times   •   Oxford University Press
•    Github          •   Twitter          •   United Airways
•    CollegeHumor    •   Yahoo!           •   University of Toronto
•    Justin.tv       •   Disney           •   XQ 
•    Grooveshark     •   Craigslist
•    BMW             •   Foursquare
•    Cisco           •   Forbes
•    Honda           •   Bit.ly
•    Mozilla         •   Intuit
In Conclusion!
• RDBMS is a great tool for solving ACID problems
  • When data validity is super important
  • When you need to support dynamic queries
• NoSQL is a great tool for solving data availability problems
  • When it’s more important to have fast data than right data
  • When you need to scale based on changing requirements
• Pick the right tool for the job
Ad

More Related Content

What's hot (20)

SQL vs. NoSQL Databases
SQL vs. NoSQL DatabasesSQL vs. NoSQL Databases
SQL vs. NoSQL Databases
Osama Jomaa
 
RDBMS vs NoSQL
RDBMS vs NoSQLRDBMS vs NoSQL
RDBMS vs NoSQL
Murat Çakal
 
NoSQL databases - An introduction
NoSQL databases - An introductionNoSQL databases - An introduction
NoSQL databases - An introduction
Pooyan Mehrparvar
 
Introduction to NoSQL Databases
Introduction to NoSQL DatabasesIntroduction to NoSQL Databases
Introduction to NoSQL Databases
Derek Stainer
 
Non relational databases-no sql
Non relational databases-no sqlNon relational databases-no sql
Non relational databases-no sql
Ram kumar
 
NoSQL databases
NoSQL databasesNoSQL databases
NoSQL databases
Marin Dimitrov
 
SQL & NoSQL
SQL & NoSQLSQL & NoSQL
SQL & NoSQL
Ahmad Awsaf-uz-zaman
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Ravi Teja
 
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQL
PolarSeven Pty Ltd
 
NoSQL databases
NoSQL databasesNoSQL databases
NoSQL databases
Harri Kauhanen
 
Get to know PostgreSQL!
Get to know PostgreSQL!Get to know PostgreSQL!
Get to know PostgreSQL!
Oddbjørn Steffensen
 
Nosql databases
Nosql databasesNosql databases
Nosql databases
ateeq ateeq
 
Data Modeling for MongoDB
Data Modeling for MongoDBData Modeling for MongoDB
Data Modeling for MongoDB
MongoDB
 
An Introduction to NOSQL, Graph Databases and Neo4j
An Introduction to NOSQL, Graph Databases and Neo4jAn Introduction to NOSQL, Graph Databases and Neo4j
An Introduction to NOSQL, Graph Databases and Neo4j
Debanjan Mahata
 
Performance tuning in sql server
Performance tuning in sql serverPerformance tuning in sql server
Performance tuning in sql server
Antonios Chatzipavlis
 
Postgresql
PostgresqlPostgresql
Postgresql
NexThoughts Technologies
 
Hadoop File system (HDFS)
Hadoop File system (HDFS)Hadoop File system (HDFS)
Hadoop File system (HDFS)
Prashant Gupta
 
An Introduction To NoSQL & MongoDB
An Introduction To NoSQL & MongoDBAn Introduction To NoSQL & MongoDB
An Introduction To NoSQL & MongoDB
Lee Theobald
 
Selecting best NoSQL
Selecting best NoSQL Selecting best NoSQL
Selecting best NoSQL
Mohammed Fazuluddin
 
No sql database
No sql databaseNo sql database
No sql database
vishal gupta
 
SQL vs. NoSQL Databases
SQL vs. NoSQL DatabasesSQL vs. NoSQL Databases
SQL vs. NoSQL Databases
Osama Jomaa
 
NoSQL databases - An introduction
NoSQL databases - An introductionNoSQL databases - An introduction
NoSQL databases - An introduction
Pooyan Mehrparvar
 
Introduction to NoSQL Databases
Introduction to NoSQL DatabasesIntroduction to NoSQL Databases
Introduction to NoSQL Databases
Derek Stainer
 
Non relational databases-no sql
Non relational databases-no sqlNon relational databases-no sql
Non relational databases-no sql
Ram kumar
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Ravi Teja
 
Data Modeling for MongoDB
Data Modeling for MongoDBData Modeling for MongoDB
Data Modeling for MongoDB
MongoDB
 
An Introduction to NOSQL, Graph Databases and Neo4j
An Introduction to NOSQL, Graph Databases and Neo4jAn Introduction to NOSQL, Graph Databases and Neo4j
An Introduction to NOSQL, Graph Databases and Neo4j
Debanjan Mahata
 
Hadoop File system (HDFS)
Hadoop File system (HDFS)Hadoop File system (HDFS)
Hadoop File system (HDFS)
Prashant Gupta
 
An Introduction To NoSQL & MongoDB
An Introduction To NoSQL & MongoDBAn Introduction To NoSQL & MongoDB
An Introduction To NoSQL & MongoDB
Lee Theobald
 

Similar to Sql vs NoSQL (20)

Non-Relational Databases at ACCU2011
Non-Relational Databases at ACCU2011Non-Relational Databases at ACCU2011
Non-Relational Databases at ACCU2011
Gavin Heavyside
 
Oracle Week 2016 - Modern Data Architecture
Oracle Week 2016 - Modern Data ArchitectureOracle Week 2016 - Modern Data Architecture
Oracle Week 2016 - Modern Data Architecture
Arthur Gimpel
 
Revision
RevisionRevision
Revision
David Sherlock
 
Database Technologies
Database TechnologiesDatabase Technologies
Database Technologies
Michel de Goede
 
UNIT I Introduction to NoSQL.pptx
UNIT I Introduction to NoSQL.pptxUNIT I Introduction to NoSQL.pptx
UNIT I Introduction to NoSQL.pptx
Rahul Borate
 
Intro to Big Data and NoSQL
Intro to Big Data and NoSQLIntro to Big Data and NoSQL
Intro to Big Data and NoSQL
Don Demcsak
 
Big Data! Great! Now What? #SymfonyCon 2014
Big Data! Great! Now What? #SymfonyCon 2014Big Data! Great! Now What? #SymfonyCon 2014
Big Data! Great! Now What? #SymfonyCon 2014
Ricard Clau
 
Scaling the Web: Databases & NoSQL
Scaling the Web: Databases & NoSQLScaling the Web: Databases & NoSQL
Scaling the Web: Databases & NoSQL
Richard Schneeman
 
UNIT I Introduction to NoSQL.pptx
UNIT I Introduction to NoSQL.pptxUNIT I Introduction to NoSQL.pptx
UNIT I Introduction to NoSQL.pptx
Rahul Borate
 
Introduction to Data Science NoSQL.pptx
Introduction to Data Science  NoSQL.pptxIntroduction to Data Science  NoSQL.pptx
Introduction to Data Science NoSQL.pptx
tarakesh7199
 
What ya gonna do?
What ya gonna do?What ya gonna do?
What ya gonna do?
CQD
 
noSQL choices
noSQL choicesnoSQL choices
noSQL choices
lugiamaster4
 
Big Data (NJ SQL Server User Group)
Big Data (NJ SQL Server User Group)Big Data (NJ SQL Server User Group)
Big Data (NJ SQL Server User Group)
Don Demcsak
 
Solr cloud the 'search first' nosql database extended deep dive
Solr cloud the 'search first' nosql database   extended deep diveSolr cloud the 'search first' nosql database   extended deep dive
Solr cloud the 'search first' nosql database extended deep dive
lucenerevolution
 
NOsql Presentation.pdf
NOsql Presentation.pdfNOsql Presentation.pdf
NOsql Presentation.pdf
AkshayDwivedi31
 
Intro to Big Data
Intro to Big DataIntro to Big Data
Intro to Big Data
Zohar Elkayam
 
NoSQL.pptx
NoSQL.pptxNoSQL.pptx
NoSQL.pptx
RithikRaj25
 
cours database pour etudiant NoSQL (1).pptx
cours database pour etudiant NoSQL (1).pptxcours database pour etudiant NoSQL (1).pptx
cours database pour etudiant NoSQL (1).pptx
ssuser1fde9c
 
NoSQL for great good [hanoi.rb talk]
NoSQL for great good [hanoi.rb talk]NoSQL for great good [hanoi.rb talk]
NoSQL for great good [hanoi.rb talk]
Huy Do
 
Architecting Your First Big Data Implementation
Architecting Your First Big Data ImplementationArchitecting Your First Big Data Implementation
Architecting Your First Big Data Implementation
Adaryl "Bob" Wakefield, MBA
 
Non-Relational Databases at ACCU2011
Non-Relational Databases at ACCU2011Non-Relational Databases at ACCU2011
Non-Relational Databases at ACCU2011
Gavin Heavyside
 
Oracle Week 2016 - Modern Data Architecture
Oracle Week 2016 - Modern Data ArchitectureOracle Week 2016 - Modern Data Architecture
Oracle Week 2016 - Modern Data Architecture
Arthur Gimpel
 
UNIT I Introduction to NoSQL.pptx
UNIT I Introduction to NoSQL.pptxUNIT I Introduction to NoSQL.pptx
UNIT I Introduction to NoSQL.pptx
Rahul Borate
 
Intro to Big Data and NoSQL
Intro to Big Data and NoSQLIntro to Big Data and NoSQL
Intro to Big Data and NoSQL
Don Demcsak
 
Big Data! Great! Now What? #SymfonyCon 2014
Big Data! Great! Now What? #SymfonyCon 2014Big Data! Great! Now What? #SymfonyCon 2014
Big Data! Great! Now What? #SymfonyCon 2014
Ricard Clau
 
Scaling the Web: Databases & NoSQL
Scaling the Web: Databases & NoSQLScaling the Web: Databases & NoSQL
Scaling the Web: Databases & NoSQL
Richard Schneeman
 
UNIT I Introduction to NoSQL.pptx
UNIT I Introduction to NoSQL.pptxUNIT I Introduction to NoSQL.pptx
UNIT I Introduction to NoSQL.pptx
Rahul Borate
 
Introduction to Data Science NoSQL.pptx
Introduction to Data Science  NoSQL.pptxIntroduction to Data Science  NoSQL.pptx
Introduction to Data Science NoSQL.pptx
tarakesh7199
 
What ya gonna do?
What ya gonna do?What ya gonna do?
What ya gonna do?
CQD
 
Big Data (NJ SQL Server User Group)
Big Data (NJ SQL Server User Group)Big Data (NJ SQL Server User Group)
Big Data (NJ SQL Server User Group)
Don Demcsak
 
Solr cloud the 'search first' nosql database extended deep dive
Solr cloud the 'search first' nosql database   extended deep diveSolr cloud the 'search first' nosql database   extended deep dive
Solr cloud the 'search first' nosql database extended deep dive
lucenerevolution
 
cours database pour etudiant NoSQL (1).pptx
cours database pour etudiant NoSQL (1).pptxcours database pour etudiant NoSQL (1).pptx
cours database pour etudiant NoSQL (1).pptx
ssuser1fde9c
 
NoSQL for great good [hanoi.rb talk]
NoSQL for great good [hanoi.rb talk]NoSQL for great good [hanoi.rb talk]
NoSQL for great good [hanoi.rb talk]
Huy Do
 
Ad

More from RTigger (20)

You Can't Buy Agile
You Can't Buy AgileYou Can't Buy Agile
You Can't Buy Agile
RTigger
 
Caching up is hard to do: Improving your Web Services' Performance
Caching up is hard to do: Improving your Web Services' PerformanceCaching up is hard to do: Improving your Web Services' Performance
Caching up is hard to do: Improving your Web Services' Performance
RTigger
 
Ready, set, go! An introduction to the Go programming language
Ready, set, go! An introduction to the Go programming languageReady, set, go! An introduction to the Go programming language
Ready, set, go! An introduction to the Go programming language
RTigger
 
Open source web services
Open source web servicesOpen source web services
Open source web services
RTigger
 
How to hire a hacker
How to hire a hackerHow to hire a hacker
How to hire a hacker
RTigger
 
Windows 8 programming with html and java script
Windows 8 programming with html and java scriptWindows 8 programming with html and java script
Windows 8 programming with html and java script
RTigger
 
Open regina
Open reginaOpen regina
Open regina
RTigger
 
Single page apps and the web of tomorrow
Single page apps and the web of tomorrowSingle page apps and the web of tomorrow
Single page apps and the web of tomorrow
RTigger
 
Async in .NET
Async in .NETAsync in .NET
Async in .NET
RTigger
 
Give your web apps some backbone
Give your web apps some backboneGive your web apps some backbone
Give your web apps some backbone
RTigger
 
Hackers, hackathons, and you
Hackers, hackathons, and youHackers, hackathons, and you
Hackers, hackathons, and you
RTigger
 
AJAX, JSON, and Client-Side Templates
AJAX, JSON, and Client-Side TemplatesAJAX, JSON, and Client-Side Templates
AJAX, JSON, and Client-Side Templates
RTigger
 
JavaScript!
JavaScript!JavaScript!
JavaScript!
RTigger
 
Parallel Processing
Parallel ProcessingParallel Processing
Parallel Processing
RTigger
 
Node.js
Node.jsNode.js
Node.js
RTigger
 
Reactive Extensions
Reactive ExtensionsReactive Extensions
Reactive Extensions
RTigger
 
Git’in Jiggy With Git
Git’in Jiggy With GitGit’in Jiggy With Git
Git’in Jiggy With Git
RTigger
 
What The F#
What The F#What The F#
What The F#
RTigger
 
Web Services
Web ServicesWeb Services
Web Services
RTigger
 
Total Engagement
Total EngagementTotal Engagement
Total Engagement
RTigger
 
You Can't Buy Agile
You Can't Buy AgileYou Can't Buy Agile
You Can't Buy Agile
RTigger
 
Caching up is hard to do: Improving your Web Services' Performance
Caching up is hard to do: Improving your Web Services' PerformanceCaching up is hard to do: Improving your Web Services' Performance
Caching up is hard to do: Improving your Web Services' Performance
RTigger
 
Ready, set, go! An introduction to the Go programming language
Ready, set, go! An introduction to the Go programming languageReady, set, go! An introduction to the Go programming language
Ready, set, go! An introduction to the Go programming language
RTigger
 
Open source web services
Open source web servicesOpen source web services
Open source web services
RTigger
 
How to hire a hacker
How to hire a hackerHow to hire a hacker
How to hire a hacker
RTigger
 
Windows 8 programming with html and java script
Windows 8 programming with html and java scriptWindows 8 programming with html and java script
Windows 8 programming with html and java script
RTigger
 
Open regina
Open reginaOpen regina
Open regina
RTigger
 
Single page apps and the web of tomorrow
Single page apps and the web of tomorrowSingle page apps and the web of tomorrow
Single page apps and the web of tomorrow
RTigger
 
Async in .NET
Async in .NETAsync in .NET
Async in .NET
RTigger
 
Give your web apps some backbone
Give your web apps some backboneGive your web apps some backbone
Give your web apps some backbone
RTigger
 
Hackers, hackathons, and you
Hackers, hackathons, and youHackers, hackathons, and you
Hackers, hackathons, and you
RTigger
 
AJAX, JSON, and Client-Side Templates
AJAX, JSON, and Client-Side TemplatesAJAX, JSON, and Client-Side Templates
AJAX, JSON, and Client-Side Templates
RTigger
 
JavaScript!
JavaScript!JavaScript!
JavaScript!
RTigger
 
Parallel Processing
Parallel ProcessingParallel Processing
Parallel Processing
RTigger
 
Reactive Extensions
Reactive ExtensionsReactive Extensions
Reactive Extensions
RTigger
 
Git’in Jiggy With Git
Git’in Jiggy With GitGit’in Jiggy With Git
Git’in Jiggy With Git
RTigger
 
What The F#
What The F#What The F#
What The F#
RTigger
 
Web Services
Web ServicesWeb Services
Web Services
RTigger
 
Total Engagement
Total EngagementTotal Engagement
Total Engagement
RTigger
 
Ad

Recently uploaded (20)

DevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptxDevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
Justin Reock
 
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Safe Software
 
Transcript: Canadian book publishing: Insights from the latest salary survey ...
Transcript: Canadian book publishing: Insights from the latest salary survey ...Transcript: Canadian book publishing: Insights from the latest salary survey ...
Transcript: Canadian book publishing: Insights from the latest salary survey ...
BookNet Canada
 
Everything You Need to Know About Agentforce? (Put AI Agents to Work)
Everything You Need to Know About Agentforce? (Put AI Agents to Work)Everything You Need to Know About Agentforce? (Put AI Agents to Work)
Everything You Need to Know About Agentforce? (Put AI Agents to Work)
Cyntexa
 
AI x Accessibility UXPA by Stew Smith and Olivier Vroom
AI x Accessibility UXPA by Stew Smith and Olivier VroomAI x Accessibility UXPA by Stew Smith and Olivier Vroom
AI x Accessibility UXPA by Stew Smith and Olivier Vroom
UXPA Boston
 
Q1 2025 Dropbox Earnings and Investor Presentation
Q1 2025 Dropbox Earnings and Investor PresentationQ1 2025 Dropbox Earnings and Investor Presentation
Q1 2025 Dropbox Earnings and Investor Presentation
Dropbox
 
Jignesh Shah - The Innovator and Czar of Exchanges
Jignesh Shah - The Innovator and Czar of ExchangesJignesh Shah - The Innovator and Czar of Exchanges
Jignesh Shah - The Innovator and Czar of Exchanges
Jignesh Shah Innovator
 
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
Ivano Malavolta
 
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptxReimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
John Moore
 
Canadian book publishing: Insights from the latest salary survey - Tech Forum...
Canadian book publishing: Insights from the latest salary survey - Tech Forum...Canadian book publishing: Insights from the latest salary survey - Tech Forum...
Canadian book publishing: Insights from the latest salary survey - Tech Forum...
BookNet Canada
 
Shoehorning dependency injection into a FP language, what does it take?
Shoehorning dependency injection into a FP language, what does it take?Shoehorning dependency injection into a FP language, what does it take?
Shoehorning dependency injection into a FP language, what does it take?
Eric Torreborre
 
Com fer un pla de gestió de dades amb l'eiNa DMP (en anglès)
Com fer un pla de gestió de dades amb l'eiNa DMP (en anglès)Com fer un pla de gestió de dades amb l'eiNa DMP (en anglès)
Com fer un pla de gestió de dades amb l'eiNa DMP (en anglès)
CSUC - Consorci de Serveis Universitaris de Catalunya
 
Build With AI - In Person Session Slides.pdf
Build With AI - In Person Session Slides.pdfBuild With AI - In Person Session Slides.pdf
Build With AI - In Person Session Slides.pdf
Google Developer Group - Harare
 
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
Lorenzo Miniero
 
Mastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B LandscapeMastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B Landscape
marketing943205
 
Hybridize Functions: A Tool for Automatically Refactoring Imperative Deep Lea...
Hybridize Functions: A Tool for Automatically Refactoring Imperative Deep Lea...Hybridize Functions: A Tool for Automatically Refactoring Imperative Deep Lea...
Hybridize Functions: A Tool for Automatically Refactoring Imperative Deep Lea...
Raffi Khatchadourian
 
fennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solutionfennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solution
shallal2
 
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Wonjun Hwang
 
Unlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web AppsUnlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web Apps
Maximiliano Firtman
 
Cybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and MitigationCybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and Mitigation
VICTOR MAESTRE RAMIREZ
 
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptxDevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
Justin Reock
 
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Safe Software
 
Transcript: Canadian book publishing: Insights from the latest salary survey ...
Transcript: Canadian book publishing: Insights from the latest salary survey ...Transcript: Canadian book publishing: Insights from the latest salary survey ...
Transcript: Canadian book publishing: Insights from the latest salary survey ...
BookNet Canada
 
Everything You Need to Know About Agentforce? (Put AI Agents to Work)
Everything You Need to Know About Agentforce? (Put AI Agents to Work)Everything You Need to Know About Agentforce? (Put AI Agents to Work)
Everything You Need to Know About Agentforce? (Put AI Agents to Work)
Cyntexa
 
AI x Accessibility UXPA by Stew Smith and Olivier Vroom
AI x Accessibility UXPA by Stew Smith and Olivier VroomAI x Accessibility UXPA by Stew Smith and Olivier Vroom
AI x Accessibility UXPA by Stew Smith and Olivier Vroom
UXPA Boston
 
Q1 2025 Dropbox Earnings and Investor Presentation
Q1 2025 Dropbox Earnings and Investor PresentationQ1 2025 Dropbox Earnings and Investor Presentation
Q1 2025 Dropbox Earnings and Investor Presentation
Dropbox
 
Jignesh Shah - The Innovator and Czar of Exchanges
Jignesh Shah - The Innovator and Czar of ExchangesJignesh Shah - The Innovator and Czar of Exchanges
Jignesh Shah - The Innovator and Czar of Exchanges
Jignesh Shah Innovator
 
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
Ivano Malavolta
 
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptxReimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
John Moore
 
Canadian book publishing: Insights from the latest salary survey - Tech Forum...
Canadian book publishing: Insights from the latest salary survey - Tech Forum...Canadian book publishing: Insights from the latest salary survey - Tech Forum...
Canadian book publishing: Insights from the latest salary survey - Tech Forum...
BookNet Canada
 
Shoehorning dependency injection into a FP language, what does it take?
Shoehorning dependency injection into a FP language, what does it take?Shoehorning dependency injection into a FP language, what does it take?
Shoehorning dependency injection into a FP language, what does it take?
Eric Torreborre
 
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
Lorenzo Miniero
 
Mastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B LandscapeMastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B Landscape
marketing943205
 
Hybridize Functions: A Tool for Automatically Refactoring Imperative Deep Lea...
Hybridize Functions: A Tool for Automatically Refactoring Imperative Deep Lea...Hybridize Functions: A Tool for Automatically Refactoring Imperative Deep Lea...
Hybridize Functions: A Tool for Automatically Refactoring Imperative Deep Lea...
Raffi Khatchadourian
 
fennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solutionfennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solution
shallal2
 
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Wonjun Hwang
 
Unlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web AppsUnlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web Apps
Maximiliano Firtman
 
Cybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and MitigationCybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and Mitigation
VICTOR MAESTRE RAMIREZ
 

Sql vs NoSQL

  • 2. In The Beginning • Programmers processed files directly • You would open a file, seek and read its contents, and parse out a record (same for insert / update / delete) • Obviously, a lot of similar code was written, and eventually refactored into libraries • These libraries became databases, each with their own strengths and weaknesses, and their own APIs • IBM came up with the idea for SEQUEL (Structured English QUEry Language) around 1970, and was implemented in several database libraries
  • 3. RDBMS • Relational DataBase Management System • Main Focus is ACID • Atomicity – Each transaction is atomic. If one part of it fails, the entire transaction fails (and is rolled back) • Consistency – Every transaction is subject to a consistent set of rules (constraints, triggers, cascades) • Isolation – No transaction should interfere with another transaction • Durability – Once a transaction is committed, it remains committed
  • 4. RDBMS • ACID is important • But only when it’s important • i.e. banking, finance, safety systems, etc. • The kinds of systems that people were building with computers 30 years ago (and today) • ACID adds overhead • Features like atomicity, isolation basically force database servers to use sequential evaluation • Add a concept like multiple-servers?
  • 5. RDBMS • Other Features • Typed columns • Normalized data • Supports broad, unrestrained queries • Has its own query optimizer • Consistent way of accessing data (SQL)
  • 6. SQL • A common (for the most part) query language for RDBMS • Enables unrestrained queries against normalized data • Geared towards joins, filters, and aggregations • Relies heavily on the database server’s query optimization • Sometimes requires the involvement of a DBA
  • 7. The CAP Theorem • Impossible for any shared data-system to guarantee simultaneously all of the following three properties: • Consistency – once data is written, all future read requests will contain that data • Availability – the database is always available and responsive • Partition Tolerance – if part of the database is unavailable, other parts are unaffected
  • 8. Good Quote! Google, Amazon, Facebook, and DARPA all recognized that when you scale systems large enough, you can never put enough iron in one place to get the job done (and you wouldn’t want to, to prevent a single point of failure). Once you accept that you have a distributed system, you need to give up consistency or availability, which the fundamental transactionality of traditional RDBMSs cannot abide. - Cedric Beust
  • 9. Enter NoSQL • RDBMS doesn’t quite fit for *some* requirements • Google and Amazon decided to make their own stuff (aka BigTable and S3 Storage) to meet their own unique needs • Distributed • Scalability • Control over performance characteristics • High availability • Low Latency • Cheap
  • 10. What is NoSQL? • Basically a large serialized object store* • (mostly) retrieve objects by defined ID • In general, doesn’t support complicated queries* • Doesn’t have a structured (or any!) schema* • Recommends denormalization • Designed to be distributed (cloud-scale) out of the box • Because of this, drops the ACID requirements • Any database can answer any query • Any write query can operate against any database and will “eventually” propagate to other distributed servers * Dependent on vendor
  • 11. The opposite of ACID is… • BASE • Basically Available – guaranteed availability • Soft-state – the state of the system may change, even without a query (because of node updates) • Eventually Consistent – the system will become consistent over time • Contrived acronym, but so is ACID :P
  • 12. NoSQL – Eventual Consistency • Because of the distributed model, any server can answer any query • Servers communicate amongst themselves at their own pace (behind the scenes) • The server that answers your query might not have the latest data • Who really cares if you see Kim Kardashian’s latest tweet instantaneously?
  • 13. Different Types of NoSQL • Column Store • Column data is saved together, as opposed to row data • Super useful for data analytics • Hadoop, Cassandra, Hypertable • Key-Value Store • A key that refers to a payload • MemcacheDB, Azure Table Storage, Redis • Document / XML / Object Store • Key (and possibly other indexes) point at a serialized object • DB can operate against values in document • MongoDB, CouchDB, RavenDB • Graph Store • Nodes are stored independently, and the relationship between nodes (edges) are stored with data
  • 14. Also Important – MapReduce • One of the most common large queries (and hard to optimize) is Map Reduce • Map: Select a subset of data (into a key, value pair) • Reduce: Perform some sort of operation on that data • Used primarily for data analysis (reporting) • Example: Average revenue on all invoices in 2010 • In RDBMS, this is usually pretty expensive • Involves a full table scan with a select • If it’s not a built-in aggregate function, involves custom code on database server (sproc/udf) • In (some) NoSQL, it’s automagically distributed • MapReduce functions are automatically distributed across all nodes to process, and the result is automatically gathered and returned as part of the vendor’s framework • In Google’s environment, can run a MapReduce operation across all their nodes in about 30 minutes.
  • 15. NoSQL, Mo’ Problems • Inconsistent APIs between NoSQL providers • Denormalized data requires you to maintain your own data relationships (cascades) in code • Not a lot of real operational power for DevOps / IT • Lack of complicated queries requires joins / aggregations / filters to be done in code (except for MapReduce) • Arguably not a bad thing?
  • 16. That being said… NoSQL-type databases power: • Google reader • Adobe • Boeing • Google maps • Ebay • US Army • Blogger.com • Facebook • Seagate • Youtube • Hulu • Hertz • Gmail • Last.Fm • IBM • Amazon • LinkedIn • Intel • Sourceforge • New York Times • Oxford University Press • Github • Twitter • United Airways • CollegeHumor • Yahoo! • University of Toronto • Justin.tv • Disney • XQ  • Grooveshark • Craigslist • BMW • Foursquare • Cisco • Forbes • Honda • Bit.ly • Mozilla • Intuit
  • 17. In Conclusion! • RDBMS is a great tool for solving ACID problems • When data validity is super important • When you need to support dynamic queries • NoSQL is a great tool for solving data availability problems • When it’s more important to have fast data than right data • When you need to scale based on changing requirements • Pick the right tool for the job
  翻译: