SlideShare a Scribd company logo
NOSQL
agile data storage
SQL: THE BEGINNING
• Data structured on tables
 using columns

• Data on one column is the
 key for making relationships
 with other tables

• Normalization

• RDBMS
SQL EXAMPLES
RDBMS BENEFITS
• Normalization  (a common
 standard format for
 accessing data)

• Data   consistency

• Persistence

• Consistency

• Replication
RDBMS PROBLEMS
RDBMS PROBLEMS
• Highcost on performing
 complex operations over a
 big database

• High
     system load: scalability
 needs

• Difficult   failover recovery

• Difficult   denormalization
NOSQL TO THE RESCUE!
NOSQL IS...
•A  storage system for format
 free data

• Web   scale

• Software    darwinism

• Different
          types of solutions
 depending on the needs:
 Key-value, Documents,
 Graphs, Objects...
REDIS
• http://redis.io               Redis is SEXY

• Key-value    store

• In   memory

• Persistent
          (periodical
 asynchronous writes to disk)

• All   operations are atomic
REDIS
Types of data          Cool operations
• Hashes
                       • RPOPLPUSH
• Sets    (arrays)
                       • Pub/Sub
• Lists
REDIS
HSET myuser “email” “ivan@ivanhq.net”
HSET myuser “web” “http://ibelmonte.com”
HSET myuser “blog” “http://ivanh.net”

HGET myuser “email”
- ivan@ivanhq.net
REDIS
sadd myuser:books “jackass”
sadd myuser:books “jackass2”
sadd myuser:books “Dude, where’s my car?”
sadd myuser:books “The hangover”

smembers myuser:books
1. jackass
2. jackass2
3. Dude, where’s my car?
4. The hangover
REDIS

rpush friends “John Doe”
rpush friends “Foo”
rpush friends “Bar”

lrange friends 0 -1
1. John Doe
2. Foo
3. Bar
REDIS

rpush nonfriends “Peter Pan”
rpush nonfriends “Batman”
rpush nonfriends “Betty Boop”

lrange nonfriends 0 -1
1. Peter Pan
2. Batman
3. Betty Boop
REDIS
rpoplpush nonfriends friends

lrange friends 0 -1
1. John Doe
2. Foo
3. Bar
4. Betty Boop

lrange nonfriends 0 -1
1. Peter Pan
2. Batman
REDIS
Pub/Sub.... a freaking AWESOME messaging queue
REDIS

Pro’s:
- Highly performant
- Highly scalable
- Interfaces available for many languages (Ruby: Ohm)

Cons:
- Eats your server’s memory
- Manually sharding
MONGODB
• http://mongodb.org

• Document      store

• Writes   to disk

• Hight   scalability

• Easy   sharding
MONGODB

• Organizes    data using
 collections

• Stores documents in BSON
 format, a binary-encoded
 serialization of JSON
MONGODB

use users
u = { name: “ivan”, company: “Sysdivision”, age: “32” }
users.insert(u)

users.find();
- { "_id" : ObjectId("4d5ea4e79faeda067681e214"),
"name" : "ivan", company: “Sysdivision”, "age" : "32" }
MONGODB
use users
u = { name: “ivan”, company: “Sysdivision”, age: “32” }
users.insert(u)

db.users.find({name: “ivan”});
- { "_id" : ObjectId("4d5ea4e79faeda067681e214"),
"name" : "ivan", company: “Sysdivision”, "age" : "32" }

db.users.find();
db.users.find().skip(20).limit(10);
MONGOID
class User
  include Mongoid::Document
  field :name
  field :birthday, :type => date
  field :money, :type => float, :default => 0.0
  embedded_in :company
end
class Company
  field :name
  embeds_one :user
end
MONGOID
company = Company.create(:name => ‘Sysdivision’)

company.create_user(
                        :name => ‘John Doe’,
                        :birthday => ’12/7/1982’,
                        : money => 0
                       )

User.find(:name => ‘John Doe’)
User.where(:name => /.*ohn.*/)
MONGOID
User.any_of(
              { :name => ‘John Doe’ },
              { :money.gt 10 }
             )

User.any_in(:name => [‘John’, ‘Foo’, ‘Bar’])

User.where(:name => ‘John Doe’).and(:money.gt 10)

Post.all_in(:tags => [‘ruby’, ‘code’, ‘mongo’])
MONGODB

Pro’s:
- Highly performant
- Highly scalable
- Easy sharding
- Ultra powerful querying
- Interfaces available for many languages (Ruby:
mongo_mapper, mongoid)
NOSQL AWESOMENESS
QUESTIONS?




        Ivan Belmonte
        http://ibelmonte.com
        ivan@ivanhq.net

More Related Content

Viewers also liked

Remote monitoring system
Remote monitoring systemRemote monitoring system
Remote monitoring system
Pk Doctors
 
FFMPEG TOOLS
FFMPEG TOOLSFFMPEG TOOLS
FFMPEG TOOLS
Ranjith Siji
 
Internationalization(i18n) of Web Page
Internationalization(i18n) of Web PageInternationalization(i18n) of Web Page
Internationalization(i18n) of Web Page
William Lee
 
Video Streaming
Video StreamingVideo Streaming
Video Streaming
Videoguy
 
Remote Management of Embedded Android Devices
Remote Management of Embedded Android DevicesRemote Management of Embedded Android Devices
Remote Management of Embedded Android Devices
VIA Embedded
 
FFMPEG on android
FFMPEG on androidFFMPEG on android
FFMPEG on android
Yoss Cohen
 
Streaming Media Server Setup Manual
Streaming Media Server Setup ManualStreaming Media Server Setup Manual
Streaming Media Server Setup Manual
William Lee
 
Lecture Slides for Location based Services [Android]
Lecture Slides for Location based Services [Android]Lecture Slides for Location based Services [Android]
Lecture Slides for Location based Services [Android]
Nehil Jain
 
Rtsp
RtspRtsp
Operational Agriculture Monitoring System Using Remote Sensing
Operational Agriculture Monitoring System Using Remote SensingOperational Agriculture Monitoring System Using Remote Sensing
Operational Agriculture Monitoring System Using Remote Sensing
Mary Adel
 
Location-Based Services on Android
Location-Based Services on AndroidLocation-Based Services on Android
Location-Based Services on Android
Jomar Tigcal
 
Location Tracking of Android Device Based on SMS.
Location Tracking of Android Device Based on SMS.Location Tracking of Android Device Based on SMS.
Location Tracking of Android Device Based on SMS.
iCreateWorld
 
Internet of things for Smart Home
Internet of things for Smart Home Internet of things for Smart Home
Internet of things for Smart Home
Khwaja Aamer
 
Smart Home technologies
Smart Home technologiesSmart Home technologies
Smart Home technologies
loggcity
 
Smart homes
Smart homesSmart homes
Smart homes
Brad Fitzpatrick
 
Bus tracking application in Android
Bus tracking application in AndroidBus tracking application in Android
Bus tracking application in Android
yashonil
 
Android College Application Project Report
Android College Application Project ReportAndroid College Application Project Report
Android College Application Project Report
stalin george
 

Viewers also liked (17)

Remote monitoring system
Remote monitoring systemRemote monitoring system
Remote monitoring system
 
FFMPEG TOOLS
FFMPEG TOOLSFFMPEG TOOLS
FFMPEG TOOLS
 
Internationalization(i18n) of Web Page
Internationalization(i18n) of Web PageInternationalization(i18n) of Web Page
Internationalization(i18n) of Web Page
 
Video Streaming
Video StreamingVideo Streaming
Video Streaming
 
Remote Management of Embedded Android Devices
Remote Management of Embedded Android DevicesRemote Management of Embedded Android Devices
Remote Management of Embedded Android Devices
 
FFMPEG on android
FFMPEG on androidFFMPEG on android
FFMPEG on android
 
Streaming Media Server Setup Manual
Streaming Media Server Setup ManualStreaming Media Server Setup Manual
Streaming Media Server Setup Manual
 
Lecture Slides for Location based Services [Android]
Lecture Slides for Location based Services [Android]Lecture Slides for Location based Services [Android]
Lecture Slides for Location based Services [Android]
 
Rtsp
RtspRtsp
Rtsp
 
Operational Agriculture Monitoring System Using Remote Sensing
Operational Agriculture Monitoring System Using Remote SensingOperational Agriculture Monitoring System Using Remote Sensing
Operational Agriculture Monitoring System Using Remote Sensing
 
Location-Based Services on Android
Location-Based Services on AndroidLocation-Based Services on Android
Location-Based Services on Android
 
Location Tracking of Android Device Based on SMS.
Location Tracking of Android Device Based on SMS.Location Tracking of Android Device Based on SMS.
Location Tracking of Android Device Based on SMS.
 
Internet of things for Smart Home
Internet of things for Smart Home Internet of things for Smart Home
Internet of things for Smart Home
 
Smart Home technologies
Smart Home technologiesSmart Home technologies
Smart Home technologies
 
Smart homes
Smart homesSmart homes
Smart homes
 
Bus tracking application in Android
Bus tracking application in AndroidBus tracking application in Android
Bus tracking application in Android
 
Android College Application Project Report
Android College Application Project ReportAndroid College Application Project Report
Android College Application Project Report
 

Similar to Nosql redis-mongo

MongoDB: a gentle, friendly overview
MongoDB: a gentle, friendly overviewMongoDB: a gentle, friendly overview
MongoDB: a gentle, friendly overview
Antonio Pintus
 
SDEC2011 NoSQL concepts and models
SDEC2011 NoSQL concepts and modelsSDEC2011 NoSQL concepts and models
SDEC2011 NoSQL concepts and models
Korea Sdec
 
NoSQL, which way to go?
NoSQL, which way to go?NoSQL, which way to go?
NoSQL, which way to go?
Ahmed Elharouny
 
No SQL : Which way to go? Presented at DDDMelbourne 2015
No SQL : Which way to go?  Presented at DDDMelbourne 2015No SQL : Which way to go?  Presented at DDDMelbourne 2015
No SQL : Which way to go? Presented at DDDMelbourne 2015
Himanshu Desai
 
Blazing Data With Redis (and LEGOS!)
Blazing Data With Redis (and LEGOS!)Blazing Data With Redis (and LEGOS!)
Blazing Data With Redis (and LEGOS!)
Justin Carmony
 
Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)
Chris Richardson
 
MongoDB - Ruby document store that doesn't rhyme with ouch
MongoDB - Ruby document store that doesn't rhyme with ouchMongoDB - Ruby document store that doesn't rhyme with ouch
MongoDB - Ruby document store that doesn't rhyme with ouch
Wynn Netherland
 
Frontera распределенный робот для обхода веба в больших объемах / Александр С...
Frontera распределенный робот для обхода веба в больших объемах / Александр С...Frontera распределенный робот для обхода веба в больших объемах / Александр С...
Frontera распределенный робот для обхода веба в больших объемах / Александр С...
Ontico
 
10gen MongoDB Video Presentation at WebGeek DevCup
10gen MongoDB Video Presentation at WebGeek DevCup10gen MongoDB Video Presentation at WebGeek DevCup
10gen MongoDB Video Presentation at WebGeek DevCup
WebGeek Philippines
 
CouchDB Open Source Bridge
CouchDB Open Source BridgeCouchDB Open Source Bridge
CouchDB Open Source Bridge
Chris Anderson
 
MongoDB, E-commerce and Transactions
MongoDB, E-commerce and TransactionsMongoDB, E-commerce and Transactions
MongoDB, E-commerce and Transactions
Steven Francia
 
MongoDB
MongoDBMongoDB
MongoDB
MongoDBMongoDB
MongoDB
SPBRUBY
 
Mongodb my
Mongodb myMongodb my
Mongodb my
Alexey Gaziev
 
Practical Use of a NoSQL
Practical Use of a NoSQLPractical Use of a NoSQL
Practical Use of a NoSQL
IBM Cloud Data Services
 
Hadoop - Introduction to Hadoop
Hadoop - Introduction to HadoopHadoop - Introduction to Hadoop
Hadoop - Introduction to Hadoop
Vibrant Technologies & Computers
 
NOSQL, CouchDB, and the Cloud
NOSQL, CouchDB, and the CloudNOSQL, CouchDB, and the Cloud
NOSQL, CouchDB, and the Cloud
boorad
 
OSDC 2012 | Building a first application on MongoDB by Ross Lawley
OSDC 2012 | Building a first application on MongoDB by Ross LawleyOSDC 2012 | Building a first application on MongoDB by Ross Lawley
OSDC 2012 | Building a first application on MongoDB by Ross Lawley
NETWAYS
 
Mongodb intro
Mongodb introMongodb intro
Mongodb intro
christkv
 
Couchdb Nosql
Couchdb NosqlCouchdb Nosql
Couchdb Nosql
elliando dias
 

Similar to Nosql redis-mongo (20)

MongoDB: a gentle, friendly overview
MongoDB: a gentle, friendly overviewMongoDB: a gentle, friendly overview
MongoDB: a gentle, friendly overview
 
SDEC2011 NoSQL concepts and models
SDEC2011 NoSQL concepts and modelsSDEC2011 NoSQL concepts and models
SDEC2011 NoSQL concepts and models
 
NoSQL, which way to go?
NoSQL, which way to go?NoSQL, which way to go?
NoSQL, which way to go?
 
No SQL : Which way to go? Presented at DDDMelbourne 2015
No SQL : Which way to go?  Presented at DDDMelbourne 2015No SQL : Which way to go?  Presented at DDDMelbourne 2015
No SQL : Which way to go? Presented at DDDMelbourne 2015
 
Blazing Data With Redis (and LEGOS!)
Blazing Data With Redis (and LEGOS!)Blazing Data With Redis (and LEGOS!)
Blazing Data With Redis (and LEGOS!)
 
Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)
 
MongoDB - Ruby document store that doesn't rhyme with ouch
MongoDB - Ruby document store that doesn't rhyme with ouchMongoDB - Ruby document store that doesn't rhyme with ouch
MongoDB - Ruby document store that doesn't rhyme with ouch
 
Frontera распределенный робот для обхода веба в больших объемах / Александр С...
Frontera распределенный робот для обхода веба в больших объемах / Александр С...Frontera распределенный робот для обхода веба в больших объемах / Александр С...
Frontera распределенный робот для обхода веба в больших объемах / Александр С...
 
10gen MongoDB Video Presentation at WebGeek DevCup
10gen MongoDB Video Presentation at WebGeek DevCup10gen MongoDB Video Presentation at WebGeek DevCup
10gen MongoDB Video Presentation at WebGeek DevCup
 
CouchDB Open Source Bridge
CouchDB Open Source BridgeCouchDB Open Source Bridge
CouchDB Open Source Bridge
 
MongoDB, E-commerce and Transactions
MongoDB, E-commerce and TransactionsMongoDB, E-commerce and Transactions
MongoDB, E-commerce and Transactions
 
MongoDB
MongoDBMongoDB
MongoDB
 
MongoDB
MongoDBMongoDB
MongoDB
 
Mongodb my
Mongodb myMongodb my
Mongodb my
 
Practical Use of a NoSQL
Practical Use of a NoSQLPractical Use of a NoSQL
Practical Use of a NoSQL
 
Hadoop - Introduction to Hadoop
Hadoop - Introduction to HadoopHadoop - Introduction to Hadoop
Hadoop - Introduction to Hadoop
 
NOSQL, CouchDB, and the Cloud
NOSQL, CouchDB, and the CloudNOSQL, CouchDB, and the Cloud
NOSQL, CouchDB, and the Cloud
 
OSDC 2012 | Building a first application on MongoDB by Ross Lawley
OSDC 2012 | Building a first application on MongoDB by Ross LawleyOSDC 2012 | Building a first application on MongoDB by Ross Lawley
OSDC 2012 | Building a first application on MongoDB by Ross Lawley
 
Mongodb intro
Mongodb introMongodb intro
Mongodb intro
 
Couchdb Nosql
Couchdb NosqlCouchdb Nosql
Couchdb Nosql
 

Recently uploaded

Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
Federico Razzoli
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 

Recently uploaded (20)

Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 

Nosql redis-mongo

  • 2. SQL: THE BEGINNING • Data structured on tables using columns • Data on one column is the key for making relationships with other tables • Normalization • RDBMS
  • 4. RDBMS BENEFITS • Normalization (a common standard format for accessing data) • Data consistency • Persistence • Consistency • Replication
  • 6. RDBMS PROBLEMS • Highcost on performing complex operations over a big database • High system load: scalability needs • Difficult failover recovery • Difficult denormalization
  • 7. NOSQL TO THE RESCUE!
  • 8. NOSQL IS... •A storage system for format free data • Web scale • Software darwinism • Different types of solutions depending on the needs: Key-value, Documents, Graphs, Objects...
  • 9. REDIS • http://redis.io Redis is SEXY • Key-value store • In memory • Persistent (periodical asynchronous writes to disk) • All operations are atomic
  • 10. REDIS Types of data Cool operations • Hashes • RPOPLPUSH • Sets (arrays) • Pub/Sub • Lists
  • 11. REDIS HSET myuser “email” “ivan@ivanhq.net” HSET myuser “web” “http://ibelmonte.com” HSET myuser “blog” “http://ivanh.net” HGET myuser “email” - ivan@ivanhq.net
  • 12. REDIS sadd myuser:books “jackass” sadd myuser:books “jackass2” sadd myuser:books “Dude, where’s my car?” sadd myuser:books “The hangover” smembers myuser:books 1. jackass 2. jackass2 3. Dude, where’s my car? 4. The hangover
  • 13. REDIS rpush friends “John Doe” rpush friends “Foo” rpush friends “Bar” lrange friends 0 -1 1. John Doe 2. Foo 3. Bar
  • 14. REDIS rpush nonfriends “Peter Pan” rpush nonfriends “Batman” rpush nonfriends “Betty Boop” lrange nonfriends 0 -1 1. Peter Pan 2. Batman 3. Betty Boop
  • 15. REDIS rpoplpush nonfriends friends lrange friends 0 -1 1. John Doe 2. Foo 3. Bar 4. Betty Boop lrange nonfriends 0 -1 1. Peter Pan 2. Batman
  • 16. REDIS Pub/Sub.... a freaking AWESOME messaging queue
  • 17. REDIS Pro’s: - Highly performant - Highly scalable - Interfaces available for many languages (Ruby: Ohm) Cons: - Eats your server’s memory - Manually sharding
  • 18. MONGODB • http://mongodb.org • Document store • Writes to disk • Hight scalability • Easy sharding
  • 19. MONGODB • Organizes data using collections • Stores documents in BSON format, a binary-encoded serialization of JSON
  • 20. MONGODB use users u = { name: “ivan”, company: “Sysdivision”, age: “32” } users.insert(u) users.find(); - { "_id" : ObjectId("4d5ea4e79faeda067681e214"), "name" : "ivan", company: “Sysdivision”, "age" : "32" }
  • 21. MONGODB use users u = { name: “ivan”, company: “Sysdivision”, age: “32” } users.insert(u) db.users.find({name: “ivan”}); - { "_id" : ObjectId("4d5ea4e79faeda067681e214"), "name" : "ivan", company: “Sysdivision”, "age" : "32" } db.users.find(); db.users.find().skip(20).limit(10);
  • 22. MONGOID class User include Mongoid::Document field :name field :birthday, :type => date field :money, :type => float, :default => 0.0 embedded_in :company end class Company field :name embeds_one :user end
  • 23. MONGOID company = Company.create(:name => ‘Sysdivision’) company.create_user( :name => ‘John Doe’, :birthday => ’12/7/1982’, : money => 0 ) User.find(:name => ‘John Doe’) User.where(:name => /.*ohn.*/)
  • 24. MONGOID User.any_of( { :name => ‘John Doe’ }, { :money.gt 10 } ) User.any_in(:name => [‘John’, ‘Foo’, ‘Bar’]) User.where(:name => ‘John Doe’).and(:money.gt 10) Post.all_in(:tags => [‘ruby’, ‘code’, ‘mongo’])
  • 25. MONGODB Pro’s: - Highly performant - Highly scalable - Easy sharding - Ultra powerful querying - Interfaces available for many languages (Ruby: mongo_mapper, mongoid)
  • 27. QUESTIONS? Ivan Belmonte http://ibelmonte.com ivan@ivanhq.net

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n