SlideShare una empresa de Scribd logo
1 de 17
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

Más contenido relacionado

La actualidad más candente

Introduction to NoSQL Databases
Introduction to NoSQL DatabasesIntroduction to NoSQL Databases
Introduction to NoSQL DatabasesDerek Stainer
 
Top 65 SQL Interview Questions and Answers | Edureka
Top 65 SQL Interview Questions and Answers | EdurekaTop 65 SQL Interview Questions and Answers | Edureka
Top 65 SQL Interview Questions and Answers | EdurekaEdureka!
 
introduction to NOSQL Database
introduction to NOSQL Databaseintroduction to NOSQL Database
introduction to NOSQL Databasenehabsairam
 
An Introduction To NoSQL & MongoDB
An Introduction To NoSQL & MongoDBAn Introduction To NoSQL & MongoDB
An Introduction To NoSQL & MongoDBLee Theobald
 
Relational databases vs Non-relational databases
Relational databases vs Non-relational databasesRelational databases vs Non-relational databases
Relational databases vs Non-relational databasesJames Serra
 
Non relational databases-no sql
Non relational databases-no sqlNon relational databases-no sql
Non relational databases-no sqlRam kumar
 
Oracle backup and recovery
Oracle backup and recoveryOracle backup and recovery
Oracle backup and recoveryYogiji Creations
 
9. Document Oriented Databases
9. Document Oriented Databases9. Document Oriented Databases
9. Document Oriented DatabasesFabio Fumarola
 
NOSQL Databases types and Uses
NOSQL Databases types and UsesNOSQL Databases types and Uses
NOSQL Databases types and UsesSuvradeep Rudra
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBRavi Teja
 
Building an Effective Data Warehouse Architecture
Building an Effective Data Warehouse ArchitectureBuilding an Effective Data Warehouse Architecture
Building an Effective Data Warehouse ArchitectureJames Serra
 

La actualidad más candente (20)

Introduction to NoSQL Databases
Introduction to NoSQL DatabasesIntroduction to NoSQL Databases
Introduction to NoSQL Databases
 
NoSQL databases
NoSQL databasesNoSQL databases
NoSQL databases
 
Top 65 SQL Interview Questions and Answers | Edureka
Top 65 SQL Interview Questions and Answers | EdurekaTop 65 SQL Interview Questions and Answers | Edureka
Top 65 SQL Interview Questions and Answers | Edureka
 
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQL
 
MongoDB
MongoDBMongoDB
MongoDB
 
introduction to NOSQL Database
introduction to NOSQL Databaseintroduction to NOSQL Database
introduction to NOSQL Database
 
NoSql
NoSqlNoSql
NoSql
 
An Introduction To NoSQL & MongoDB
An Introduction To NoSQL & MongoDBAn Introduction To NoSQL & MongoDB
An Introduction To NoSQL & MongoDB
 
Relational databases vs Non-relational databases
Relational databases vs Non-relational databasesRelational databases vs Non-relational databases
Relational databases vs Non-relational databases
 
Non relational databases-no sql
Non relational databases-no sqlNon relational databases-no sql
Non relational databases-no sql
 
Introduction to Amazon Redshift
Introduction to Amazon RedshiftIntroduction to Amazon Redshift
Introduction to Amazon Redshift
 
Mongo DB Presentation
Mongo DB PresentationMongo DB Presentation
Mongo DB Presentation
 
Oracle backup and recovery
Oracle backup and recoveryOracle backup and recovery
Oracle backup and recovery
 
Introduction to mongodb
Introduction to mongodbIntroduction to mongodb
Introduction to mongodb
 
9. Document Oriented Databases
9. Document Oriented Databases9. Document Oriented Databases
9. Document Oriented Databases
 
NOSQL Databases types and Uses
NOSQL Databases types and UsesNOSQL Databases types and Uses
NOSQL Databases types and Uses
 
NoSQL databases
NoSQL databasesNoSQL databases
NoSQL databases
 
Nosql data models
Nosql data modelsNosql data models
Nosql data models
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Building an Effective Data Warehouse Architecture
Building an Effective Data Warehouse ArchitectureBuilding an Effective Data Warehouse Architecture
Building an Effective Data Warehouse Architecture
 

Similar a Sql vs NoSQL

Non-Relational Databases at ACCU2011
Non-Relational Databases at ACCU2011Non-Relational Databases at ACCU2011
Non-Relational Databases at ACCU2011Gavin Heavyside
 
Oracle Week 2016 - Modern Data Architecture
Oracle Week 2016 - Modern Data ArchitectureOracle Week 2016 - Modern Data Architecture
Oracle Week 2016 - Modern Data ArchitectureArthur Gimpel
 
UNIT I Introduction to NoSQL.pptx
UNIT I Introduction to NoSQL.pptxUNIT I Introduction to NoSQL.pptx
UNIT I Introduction to NoSQL.pptxRahul Borate
 
Intro to Big Data and NoSQL
Intro to Big Data and NoSQLIntro to Big Data and NoSQL
Intro to Big Data and NoSQLDon 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 2014Ricard Clau
 
Scaling the Web: Databases & NoSQL
Scaling the Web: Databases & NoSQLScaling the Web: Databases & NoSQL
Scaling the Web: Databases & NoSQLRichard Schneeman
 
UNIT I Introduction to NoSQL.pptx
UNIT I Introduction to NoSQL.pptxUNIT I Introduction to NoSQL.pptx
UNIT I Introduction to NoSQL.pptxRahul Borate
 
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 divelucenerevolution
 
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
 

Similar a Sql vs NoSQL (20)

Non-Relational Databases at ACCU2011
Non-Relational Databases at ACCU2011Non-Relational Databases at ACCU2011
Non-Relational Databases at ACCU2011
 
Oracle Week 2016 - Modern Data Architecture
Oracle Week 2016 - Modern Data ArchitectureOracle Week 2016 - Modern Data Architecture
Oracle Week 2016 - Modern Data Architecture
 
Revision
RevisionRevision
Revision
 
Database Technologies
Database TechnologiesDatabase Technologies
Database Technologies
 
UNIT I Introduction to NoSQL.pptx
UNIT I Introduction to NoSQL.pptxUNIT I Introduction to NoSQL.pptx
UNIT I Introduction to NoSQL.pptx
 
Intro to Big Data and NoSQL
Intro to Big Data and NoSQLIntro to Big Data and NoSQL
Intro to Big Data and NoSQL
 
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
 
Scaling the Web: Databases & NoSQL
Scaling the Web: Databases & NoSQLScaling the Web: Databases & NoSQL
Scaling the Web: Databases & NoSQL
 
UNIT I Introduction to NoSQL.pptx
UNIT I Introduction to NoSQL.pptxUNIT I Introduction to NoSQL.pptx
UNIT I Introduction to NoSQL.pptx
 
What ya gonna do?
What ya gonna do?What ya gonna do?
What ya gonna do?
 
noSQL choices
noSQL choicesnoSQL choices
noSQL choices
 
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)
 
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
 
NOsql Presentation.pdf
NOsql Presentation.pdfNOsql Presentation.pdf
NOsql Presentation.pdf
 
Intro to Big Data
Intro to Big DataIntro to Big Data
Intro to Big Data
 
NoSQL.pptx
NoSQL.pptxNoSQL.pptx
NoSQL.pptx
 
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]
 
Architecting Your First Big Data Implementation
Architecting Your First Big Data ImplementationArchitecting Your First Big Data Implementation
Architecting Your First Big Data Implementation
 
NoSQL
NoSQLNoSQL
NoSQL
 
A peek into the future
A peek into the futureA peek into the future
A peek into the future
 

Más de RTigger

You Can't Buy Agile
You Can't Buy AgileYou Can't Buy Agile
You Can't Buy AgileRTigger
 
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' PerformanceRTigger
 
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 languageRTigger
 
Open source web services
Open source web servicesOpen source web services
Open source web servicesRTigger
 
How to hire a hacker
How to hire a hackerHow to hire a hacker
How to hire a hackerRTigger
 
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 scriptRTigger
 
Open regina
Open reginaOpen regina
Open reginaRTigger
 
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 tomorrowRTigger
 
Async in .NET
Async in .NETAsync in .NET
Async in .NETRTigger
 
Give your web apps some backbone
Give your web apps some backboneGive your web apps some backbone
Give your web apps some backboneRTigger
 
Hackers, hackathons, and you
Hackers, hackathons, and youHackers, hackathons, and you
Hackers, hackathons, and youRTigger
 
AJAX, JSON, and Client-Side Templates
AJAX, JSON, and Client-Side TemplatesAJAX, JSON, and Client-Side Templates
AJAX, JSON, and Client-Side TemplatesRTigger
 
JavaScript!
JavaScript!JavaScript!
JavaScript!RTigger
 
Parallel Processing
Parallel ProcessingParallel Processing
Parallel ProcessingRTigger
 
Reactive Extensions
Reactive ExtensionsReactive Extensions
Reactive ExtensionsRTigger
 
Git’in Jiggy With Git
Git’in Jiggy With GitGit’in Jiggy With Git
Git’in Jiggy With GitRTigger
 
What The F#
What The F#What The F#
What The F#RTigger
 
Web Services
Web ServicesWeb Services
Web ServicesRTigger
 
Total Engagement
Total EngagementTotal Engagement
Total EngagementRTigger
 

Más de RTigger (20)

You Can't Buy Agile
You Can't Buy AgileYou Can't Buy Agile
You Can't Buy Agile
 
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
 
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
 
Open source web services
Open source web servicesOpen source web services
Open source web services
 
How to hire a hacker
How to hire a hackerHow to hire a hacker
How to hire a hacker
 
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
 
Open regina
Open reginaOpen regina
Open regina
 
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
 
Async in .NET
Async in .NETAsync in .NET
Async in .NET
 
Give your web apps some backbone
Give your web apps some backboneGive your web apps some backbone
Give your web apps some backbone
 
Hackers, hackathons, and you
Hackers, hackathons, and youHackers, hackathons, and you
Hackers, hackathons, and you
 
AJAX, JSON, and Client-Side Templates
AJAX, JSON, and Client-Side TemplatesAJAX, JSON, and Client-Side Templates
AJAX, JSON, and Client-Side Templates
 
JavaScript!
JavaScript!JavaScript!
JavaScript!
 
Parallel Processing
Parallel ProcessingParallel Processing
Parallel Processing
 
Node.js
Node.jsNode.js
Node.js
 
Reactive Extensions
Reactive ExtensionsReactive Extensions
Reactive Extensions
 
Git’in Jiggy With Git
Git’in Jiggy With GitGit’in Jiggy With Git
Git’in Jiggy With Git
 
What The F#
What The F#What The F#
What The F#
 
Web Services
Web ServicesWeb Services
Web Services
 
Total Engagement
Total EngagementTotal Engagement
Total Engagement
 

Último

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 WorkerThousandEyes
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
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 Takeoffsammart93
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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 AutomationSafe Software
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
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 2024The Digital Insurer
 
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 textsMaria Levchenko
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 

Último (20)

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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
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
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 

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