SlideShare une entreprise Scribd logo
1  sur  30
NoSQL vs SQL
Who am I?
Beseda Dmitriy
Web developer at Binary Studio
email: BesedaDG@gmail.com
email: dmitriy.beseda@binary-studio.com
skype: dmitriy.b_binary
facebook:
https://www.facebook.com/profile.php?id=1000017844
45579
Plan
1. Data nowadays
2. SQL advantages / disadvantages
3. NoSQL advantages / disadvantages
4. NoSQL history
5. SQL and NoSQL similarities and differences
6. ORM / ODM
7. Myths
8. Conclusions
Problem
Main “Bottleneck”
Data evolution
- Data and web apps are growing rapidly day by day
- Hardware cannot keep pace with data growth
- Apps are moving to Cloud and becoming API driven
Conclusion: It is hard to scale data in a traditional way
Data in business
Business is successful if data are used properly
- Statistic, reports
- Real-time
- Recommendations
Conclusion:
- Web apps should be real-time and interactive
- User and services databases grow from tera to peta bytes each day
Pay attention
● CRUD (Create Read Update Delete) operations
- Performance
- Reliability
● Data consistency (ACID) & Distributed network
- Parallel immediate access
- Updates applying time to all users
● Loading
- Data replication
Advantages:
● No duplications
● Data integrity
● Transactions
● Actions sequence
● Security
● Data consistency
SQL
Disadvantages:
● Performance
● Work in distributed environment
(locks)
● Horizontal scaling complexity
● Additional language to manipulate
with data
● Scaling and Sharding
SQL Products and customers
December, 2015
NoSQL
Advantages:
● Performance (aggregation)
● Schemaless (easy to add / remove
properties)
● Horizontal scaling (& sharding)
● Way of using memory
● Open source
Disadvantages:
● Absence of transactions
● Embedding limitations
● Lots of manual work (joins are
absent)
● Model format is not guaranteed
NoSQL products and customers
NoSQL history
In 1998 Carlo Strozzi implemented an open source DB, that
stored ASCII files and used shell scripts for data manipulations
In June 2009 Eric Evans proposed NoSQL as a Twitter #tag for a
conference for existing distributed databases
- Consistency - “Is the data I am looking at now the same if I look at it somewhere
else”
- Availability - “What will happen if my database goes down?”
- Partitioning - “What if my data is on a different node?”
SQL - CA
NoSQL - AP
CAP theorem (Consistency, Availability and Partition-tolerance)
SQL and NoSQL similarities
● Primary key or Id is necessary and unique
● Indexes help to increase performance
● Relationships exist
Goals of normalization
- Free the database of modification anomalies (references)
- Minimize redesign
- Avoid any bias toward any particular access pattern
SQL schema example
Schema design
- Rich documents
- Pre join / embed Data
- No more joins
- No constraints
- Atomic operations
- No declared schema
NoSQL types
● Key Value (Firebase, Dynamo, Redis ...)
● Document (MongoDB, CouchDB)
● Graph (InfoGrid, Neo4J ...)
● Column Family (Cassandra, HyperTable, BigTable)
Data store positioning
SQL Comfort zone
Key Value
Column
Document
Graph
Relational
Standardized Model, Tooling, Complexity
Scalability
JSON
- Array
var array = [ 1, 2, 3, 4, 5]
- Dictionaries
var doc =
{
"prop1": "some string",
"prop2": { a: 2, b: 3},
"prop3": array
}
NoSQL document example
{
"_id": ObjectId,
"description": String,
"total": Number,
"notes": [{
"_id": ObjectId,
"text": String
}],
"exclusions": [{
"_id": ObjectId,
"text": String
}],
"categories": {
"ref1": {
"name": String,
"status": String,
"price": Number
},
"ref2": {
"name": String,
"status": String,
"price": Number
}
}
}
ORM and ODM
ORM:
● Entity Framework (.NET)
● Nhibernate (.NET)
● Hibernate (Java)
● Django (Python)
● Sequelize (JS)
ODM:
● Mongoose (Mongo)
Myths
- NoSQL supersedes SQL
- NoSQL is better / worse than SQL
- SQL vs NoSQL is a clear distinction
- The language/framework determines the database
Use SQL if:
● Data integrity is essential
● Standards-based proven technologies with good developer experience and
support
● Logical related discrete data requirements which can be identified up-front
● Prefer SQL
Use NoSQL if:
● Data requirements are unrelated, indeterminate or evolving
● Project objectives are simpler of less specific and allow starting to code
immediately
● Speed and scalability is imperative
● Prefer NoSQL
Always remember
● Если бы мы действительно ждали завершения каждой транзакции в мировой сети ATM (банкоматов),
транзакции занимали бы столько времени, что клиенты убегали бы прочь в ярости. Что происходит, если ты и
твой партнер снимаете деньги одновременно и превышаете лимит? — Вы оба получите деньги, а мы поправим
это позже.
● Мы вступаем в эру polyglot persistence — эру, когда для различных потребностей используются разные
хранилища данных. Теперь нет монополизма реляционных баз данных, как безальтернативного источника
данных. Все чаще архитекторы выбирают хранилище исходя из природы самих данных и того, как мы ими
хотим манипулировать, какие объемы информации ожидаются. И поэтому все становится только интереснее.
● A well-designed SQL database will almost certainly perform better than a badly designed NoSQL equivalent and vice
versa.
Summary
SQL - works great, isn’t scalable for large data
😞
NoSQL - works great, isn’t suitable for everyone
😞
SQL + NoSQL 😊
References
1. SQL vs NoSQL: The Differences
2. MongoDB university
Questions?

Contenu connexe

Tendances

Introduction to NuoDB
Introduction to NuoDBIntroduction to NuoDB
Introduction to NuoDB
Sandun Perera
 
Choosing The Right Database For Your Cloud Application
Choosing The Right Database For Your Cloud ApplicationChoosing The Right Database For Your Cloud Application
Choosing The Right Database For Your Cloud Application
NuoDB
 

Tendances (20)

SQL & NoSQL
SQL & NoSQLSQL & NoSQL
SQL & NoSQL
 
SQL or NoSQL, that is the question!
SQL or NoSQL, that is the question!SQL or NoSQL, that is the question!
SQL or NoSQL, that is the question!
 
What is NoSQL and CAP Theorem
What is NoSQL and CAP TheoremWhat is NoSQL and CAP Theorem
What is NoSQL and CAP Theorem
 
MinneBar 2013 - Scaling with Cassandra
MinneBar 2013 - Scaling with CassandraMinneBar 2013 - Scaling with Cassandra
MinneBar 2013 - Scaling with Cassandra
 
SQL/NoSQL How to choose ?
SQL/NoSQL How to choose ?SQL/NoSQL How to choose ?
SQL/NoSQL How to choose ?
 
RDBMS vs NoSQL
RDBMS vs NoSQLRDBMS vs NoSQL
RDBMS vs NoSQL
 
SQL or NoSQL, is this the question? - George Grammatikos
SQL or NoSQL, is this the question? - George GrammatikosSQL or NoSQL, is this the question? - George Grammatikos
SQL or NoSQL, is this the question? - George Grammatikos
 
No sql databases
No sql databasesNo sql databases
No sql databases
 
Data Modeling for NoSQL
Data Modeling for NoSQLData Modeling for NoSQL
Data Modeling for NoSQL
 
Selecting best NoSQL
Selecting best NoSQL Selecting best NoSQL
Selecting best NoSQL
 
NoSQL Architecture Overview
NoSQL Architecture OverviewNoSQL Architecture Overview
NoSQL Architecture Overview
 
NoSql Data Management
NoSql Data ManagementNoSql Data Management
NoSql Data Management
 
Introduction to NuoDB
Introduction to NuoDBIntroduction to NuoDB
Introduction to NuoDB
 
Why no sql ? Why Couchbase ?
Why no sql ? Why Couchbase ?Why no sql ? Why Couchbase ?
Why no sql ? Why Couchbase ?
 
Mysql
MysqlMysql
Mysql
 
My sql vs mongo
My sql vs mongoMy sql vs mongo
My sql vs mongo
 
Choosing The Right Database For Your Cloud Application
Choosing The Right Database For Your Cloud ApplicationChoosing The Right Database For Your Cloud Application
Choosing The Right Database For Your Cloud Application
 
NoSQL Data Architecture Patterns
NoSQL Data ArchitecturePatternsNoSQL Data ArchitecturePatterns
NoSQL Data Architecture Patterns
 
The Future of Distributed Databases
The Future of Distributed DatabasesThe Future of Distributed Databases
The Future of Distributed Databases
 
MongoDB and DynamoDB
MongoDB and DynamoDBMongoDB and DynamoDB
MongoDB and DynamoDB
 

Similaire à NoSQL vs SQL (by Dmitriy Beseda, JS developer and coach Binary Studio Academy)

NoSQLDatabases
NoSQLDatabasesNoSQLDatabases
NoSQLDatabases
Adi Challa
 

Similaire à NoSQL vs SQL (by Dmitriy Beseda, JS developer and coach Binary Studio Academy) (20)

NoSQLDatabases
NoSQLDatabasesNoSQLDatabases
NoSQLDatabases
 
NoSQL Basics and MongDB
NoSQL Basics and  MongDBNoSQL Basics and  MongDB
NoSQL Basics and MongDB
 
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]
 
Evolution of the DBA to Data Platform Administrator/Specialist
Evolution of the DBA to Data Platform Administrator/SpecialistEvolution of the DBA to Data Platform Administrator/Specialist
Evolution of the DBA to Data Platform Administrator/Specialist
 
Erciyes university
Erciyes universityErciyes university
Erciyes university
 
مقدمة عن NoSQL بالعربي
مقدمة عن NoSQL بالعربيمقدمة عن NoSQL بالعربي
مقدمة عن NoSQL بالعربي
 
SQL, NoSQL, BigData in Data Architecture
SQL, NoSQL, BigData in Data ArchitectureSQL, NoSQL, BigData in Data Architecture
SQL, NoSQL, BigData in Data Architecture
 
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQL
 
Business Intelligence & NoSQL Databases
Business Intelligence & NoSQL DatabasesBusiness Intelligence & NoSQL Databases
Business Intelligence & NoSQL Databases
 
NoSQL Seminer
NoSQL SeminerNoSQL Seminer
NoSQL Seminer
 
No sql bigdata and postgresql
No sql bigdata and postgresqlNo sql bigdata and postgresql
No sql bigdata and postgresql
 
Introduction to NoSQL and MongoDB
Introduction to NoSQL and MongoDBIntroduction to NoSQL and MongoDB
Introduction to NoSQL and MongoDB
 
Introduction to NoSQL database technology
Introduction to NoSQL database technologyIntroduction to NoSQL database technology
Introduction to NoSQL database technology
 
A beginners guide to Cloudera Hadoop
A beginners guide to Cloudera HadoopA beginners guide to Cloudera Hadoop
A beginners guide to Cloudera Hadoop
 
No sql database
No sql databaseNo sql database
No sql database
 
Modern databases and its challenges (SQL ,NoSQL, NewSQL)
Modern databases and its challenges (SQL ,NoSQL, NewSQL)Modern databases and its challenges (SQL ,NoSQL, NewSQL)
Modern databases and its challenges (SQL ,NoSQL, NewSQL)
 
Datastore PPT.pptx
Datastore PPT.pptxDatastore PPT.pptx
Datastore PPT.pptx
 
NoSQL
NoSQLNoSQL
NoSQL
 
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQL
 
NoSQL databases
NoSQL databasesNoSQL databases
NoSQL databases
 

Plus de Binary Studio

Plus de Binary Studio (20)

Academy PRO: D3, part 3
Academy PRO: D3, part 3Academy PRO: D3, part 3
Academy PRO: D3, part 3
 
Academy PRO: D3, part 1
Academy PRO: D3, part 1Academy PRO: D3, part 1
Academy PRO: D3, part 1
 
Academy PRO: Cryptography 3
Academy PRO: Cryptography 3Academy PRO: Cryptography 3
Academy PRO: Cryptography 3
 
Academy PRO: Cryptography 1
Academy PRO: Cryptography 1Academy PRO: Cryptography 1
Academy PRO: Cryptography 1
 
Academy PRO: Advanced React Ecosystem. MobX
Academy PRO: Advanced React Ecosystem. MobXAcademy PRO: Advanced React Ecosystem. MobX
Academy PRO: Advanced React Ecosystem. MobX
 
Academy PRO: Docker. Part 4
Academy PRO: Docker. Part 4Academy PRO: Docker. Part 4
Academy PRO: Docker. Part 4
 
Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2
 
Academy PRO: Docker. Part 1
Academy PRO: Docker. Part 1Academy PRO: Docker. Part 1
Academy PRO: Docker. Part 1
 
Binary Studio Academy 2017: JS team project - Orderly
Binary Studio Academy 2017: JS team project - OrderlyBinary Studio Academy 2017: JS team project - Orderly
Binary Studio Academy 2017: JS team project - Orderly
 
Binary Studio Academy 2017: .NET team project - Unicorn
Binary Studio Academy 2017: .NET team project - UnicornBinary Studio Academy 2017: .NET team project - Unicorn
Binary Studio Academy 2017: .NET team project - Unicorn
 
Academy PRO: React native - miscellaneous
Academy PRO: React native - miscellaneousAcademy PRO: React native - miscellaneous
Academy PRO: React native - miscellaneous
 
Academy PRO: React native - publish
Academy PRO: React native - publishAcademy PRO: React native - publish
Academy PRO: React native - publish
 
Academy PRO: React native - navigation
Academy PRO: React native - navigationAcademy PRO: React native - navigation
Academy PRO: React native - navigation
 
Academy PRO: React native - building first scenes
Academy PRO: React native - building first scenesAcademy PRO: React native - building first scenes
Academy PRO: React native - building first scenes
 
Academy PRO: React Native - introduction
Academy PRO: React Native - introductionAcademy PRO: React Native - introduction
Academy PRO: React Native - introduction
 
Academy PRO: Push notifications. Denis Beketsky
Academy PRO: Push notifications. Denis BeketskyAcademy PRO: Push notifications. Denis Beketsky
Academy PRO: Push notifications. Denis Beketsky
 
Academy PRO: Docker. Lecture 4
Academy PRO: Docker. Lecture 4Academy PRO: Docker. Lecture 4
Academy PRO: Docker. Lecture 4
 
Academy PRO: Docker. Lecture 3
Academy PRO: Docker. Lecture 3Academy PRO: Docker. Lecture 3
Academy PRO: Docker. Lecture 3
 
Academy PRO: Docker. Lecture 2
Academy PRO: Docker. Lecture 2Academy PRO: Docker. Lecture 2
Academy PRO: Docker. Lecture 2
 
Academy PRO: Docker. Lecture 1
Academy PRO: Docker. Lecture 1Academy PRO: Docker. Lecture 1
Academy PRO: Docker. Lecture 1
 

Dernier

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 

Dernier (20)

The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 

NoSQL vs SQL (by Dmitriy Beseda, JS developer and coach Binary Studio Academy)

  • 2. Who am I? Beseda Dmitriy Web developer at Binary Studio email: BesedaDG@gmail.com email: dmitriy.beseda@binary-studio.com skype: dmitriy.b_binary facebook: https://www.facebook.com/profile.php?id=1000017844 45579
  • 3. Plan 1. Data nowadays 2. SQL advantages / disadvantages 3. NoSQL advantages / disadvantages 4. NoSQL history 5. SQL and NoSQL similarities and differences 6. ORM / ODM 7. Myths 8. Conclusions
  • 5. Data evolution - Data and web apps are growing rapidly day by day - Hardware cannot keep pace with data growth - Apps are moving to Cloud and becoming API driven Conclusion: It is hard to scale data in a traditional way
  • 6. Data in business Business is successful if data are used properly - Statistic, reports - Real-time - Recommendations Conclusion: - Web apps should be real-time and interactive - User and services databases grow from tera to peta bytes each day
  • 7. Pay attention ● CRUD (Create Read Update Delete) operations - Performance - Reliability ● Data consistency (ACID) & Distributed network - Parallel immediate access - Updates applying time to all users ● Loading - Data replication
  • 8. Advantages: ● No duplications ● Data integrity ● Transactions ● Actions sequence ● Security ● Data consistency SQL Disadvantages: ● Performance ● Work in distributed environment (locks) ● Horizontal scaling complexity ● Additional language to manipulate with data ● Scaling and Sharding
  • 9. SQL Products and customers December, 2015
  • 10. NoSQL Advantages: ● Performance (aggregation) ● Schemaless (easy to add / remove properties) ● Horizontal scaling (& sharding) ● Way of using memory ● Open source Disadvantages: ● Absence of transactions ● Embedding limitations ● Lots of manual work (joins are absent) ● Model format is not guaranteed
  • 11. NoSQL products and customers
  • 12. NoSQL history In 1998 Carlo Strozzi implemented an open source DB, that stored ASCII files and used shell scripts for data manipulations In June 2009 Eric Evans proposed NoSQL as a Twitter #tag for a conference for existing distributed databases
  • 13. - Consistency - “Is the data I am looking at now the same if I look at it somewhere else” - Availability - “What will happen if my database goes down?” - Partitioning - “What if my data is on a different node?” SQL - CA NoSQL - AP CAP theorem (Consistency, Availability and Partition-tolerance)
  • 14. SQL and NoSQL similarities ● Primary key or Id is necessary and unique ● Indexes help to increase performance ● Relationships exist
  • 15. Goals of normalization - Free the database of modification anomalies (references) - Minimize redesign - Avoid any bias toward any particular access pattern
  • 17. Schema design - Rich documents - Pre join / embed Data - No more joins - No constraints - Atomic operations - No declared schema
  • 18. NoSQL types ● Key Value (Firebase, Dynamo, Redis ...) ● Document (MongoDB, CouchDB) ● Graph (InfoGrid, Neo4J ...) ● Column Family (Cassandra, HyperTable, BigTable)
  • 19. Data store positioning SQL Comfort zone Key Value Column Document Graph Relational Standardized Model, Tooling, Complexity Scalability
  • 20. JSON - Array var array = [ 1, 2, 3, 4, 5] - Dictionaries var doc = { "prop1": "some string", "prop2": { a: 2, b: 3}, "prop3": array }
  • 21. NoSQL document example { "_id": ObjectId, "description": String, "total": Number, "notes": [{ "_id": ObjectId, "text": String }], "exclusions": [{ "_id": ObjectId, "text": String }], "categories": { "ref1": { "name": String, "status": String, "price": Number }, "ref2": { "name": String, "status": String, "price": Number } } }
  • 22. ORM and ODM ORM: ● Entity Framework (.NET) ● Nhibernate (.NET) ● Hibernate (Java) ● Django (Python) ● Sequelize (JS) ODM: ● Mongoose (Mongo)
  • 23. Myths - NoSQL supersedes SQL - NoSQL is better / worse than SQL - SQL vs NoSQL is a clear distinction - The language/framework determines the database
  • 24. Use SQL if: ● Data integrity is essential ● Standards-based proven technologies with good developer experience and support ● Logical related discrete data requirements which can be identified up-front ● Prefer SQL
  • 25. Use NoSQL if: ● Data requirements are unrelated, indeterminate or evolving ● Project objectives are simpler of less specific and allow starting to code immediately ● Speed and scalability is imperative ● Prefer NoSQL
  • 26. Always remember ● Если бы мы действительно ждали завершения каждой транзакции в мировой сети ATM (банкоматов), транзакции занимали бы столько времени, что клиенты убегали бы прочь в ярости. Что происходит, если ты и твой партнер снимаете деньги одновременно и превышаете лимит? — Вы оба получите деньги, а мы поправим это позже. ● Мы вступаем в эру polyglot persistence — эру, когда для различных потребностей используются разные хранилища данных. Теперь нет монополизма реляционных баз данных, как безальтернативного источника данных. Все чаще архитекторы выбирают хранилище исходя из природы самих данных и того, как мы ими хотим манипулировать, какие объемы информации ожидаются. И поэтому все становится только интереснее. ● A well-designed SQL database will almost certainly perform better than a badly designed NoSQL equivalent and vice versa.
  • 27.
  • 28. Summary SQL - works great, isn’t scalable for large data 😞 NoSQL - works great, isn’t suitable for everyone 😞 SQL + NoSQL 😊
  • 29. References 1. SQL vs NoSQL: The Differences 2. MongoDB university

Notes de l'éditeur

  1. Рассказать про проект Андрюхи и его прикол с MS SQL DB
  2. главный лейтмотив развития NoSQL баз. С лавинообразным ростом информации в мире и необходимости ее обрабатывать за разумное время встала проблема вертикальной масштабируемости — рост скорости процессора остановился на 3.5 Ггц, скорость чтения с диска также растет тихими темпами, плюс цена мощного сервера всегда больше суммарной цены нескольких простых серверов.
  3. Главный лейтмотив развития NoSQL баз. С лавинообразным ростом информации в мире и необходимости ее обрабатывать за разумное время встала проблема вертикальной масштабируемости — рост скорости процессора остановился на 3.5 Ггц, скорость чтения с диска также растет тихими темпами, плюс цена мощного сервера всегда больше суммарной цены нескольких простых серверов.
  4. Facebook uses primary mysql and cassandra for search
  5. Rich documents - can contain Numbers, Strings, Another documents and arrays No constraint - foreign keys, etc
  6. NoSQL is not a replacement for SQL — it’s an alternative It depends on project Some SQL databases are adopting NoSQL features and vice versa LAMP: Linux, Apache, MySQL (SQL), PHP MEAN: MongoDB (NoSQL), Express, Angular, Node.js .NET, IIS and SQL Server Java, Apache and Oracle.