SlideShare ist ein Scribd-Unternehmen logo
1 von 29
Downloaden Sie, um offline zu lesen
Document Databases
and Key-Value Stores
a.k.a “pump it and dump it”
Thursday, April 25, 13
~/$ whoami
Thursday, April 25, 13
@parasquid (also in fb/github)
works (here) at Mindvalley
helps organize KLMUG with Mark
did my rounds (from servers to
frontend and back)
settled in as an app developer
Thursday, April 25, 13
A Magical
History Tour
Thursday, April 25, 13
Thursday, April 25, 13
two years ago
joffrey was the first mongo-based
prototype Mindvalley in Mindvalley
oathkeeper was the second
got used in production
still in production
(unfortunately)
Thursday, April 25, 13
Quick Review on
Advantages of NoSQL over
Relational Databases
Thursday, April 25, 13
Relational
Impedance Mismatch
An order, which
looks like a
single aggregate
structure in the
UI, is split into
many rows from
many tables
Thursday, April 25, 13
NoSQL
Model alignment
The storage data
model closely
resembles how the
aggregate is
represented in the
domain (especially
in document
databases)
Thursday, April 25, 13
Relational
Programmer
Productivity
Before you can
modify your data
model, you first
have to think of
how to tear it
apart and make a
migration
Thursday, April 25, 13
NoSQL
Programmer
Productivity
Most of the
adjustments to the
db are
transparent; non-
existent keys just
return nil
Thursday, April 25, 13
Quick Recap on the difference
between Relational and NoSQL
(k-v and doc)
Thursday, April 25, 13
Relational: blows up a model into
small, constituent data
NoSQL (k-v and doc): stores and
retrieves aggregates
Thursday, April 25, 13
VS
Thursday, April 25, 13
Key-Value Stores and
Document Databases
Thursday, April 25, 13
they actually are not that much
different conceptually
mostly: you store and access a key-
value store via a key (but not
always)
mostly: you store and access a
document database via a query (but
not always)
Thursday, April 25, 13
Thursday, April 25, 13
Thursday, April 25, 13
key-value store
aggregate is
opaque to the
database
db doesn’t care
about the
structure
document db
database
knows the
structure
db knows this
field is a
string/date/
integer/etc
Difference
Thursday, April 25, 13
Difference
key-value store
we can store
whatever we
like in the db
same field
names may hold
different types
of objects
document db
defines
allowable
structures
and types
structure
supports
flexibility
Thursday, April 25, 13
I’ve never used
a column db before so
no comments on that :)
Thursday, April 25, 13
But first, a word
about “Schema-less”
Thursday, April 25, 13
I actually prefer the term
“schema-free”
once you start querying data, your
data starts to have an implicit
schema
“schema-free” is great for non-
uniform data but you need some
structure if you want to start
querying for data
Thursday, April 25, 13
NoSQL shifts the schema
into the application
code that accesses it
this can be a good thing or a bad thing
Thursday, April 25, 13
Sample Use-cases
Thursday, April 25, 13
Key-Value Stores
when to use:
session data
user preferences
shopping cart data
when NOT to use:
relationships
among data
multi-operation
transactions
query by data
Thursday, April 25, 13
Document Databases
when to use:
event logging
content management
systems / blogging
platforms
web analytics
e-commerce
when NOT to use:
complex
transactions
spanning different
operations
queries against
varying aggregate
structure
Thursday, April 25, 13
VS
Thursday, April 25, 13
Conclusion
use the right tool for the right job
look at the tradeoffs and decide
accordingly
in the end, it’s a business decision
(supported by technical capabilities)
Thursday, April 25, 13

Weitere ähnliche Inhalte

Ähnlich wie Nosql kl-2013-04-25

Why Spark Is the Next Top (Compute) Model
Why Spark Is the Next Top (Compute) ModelWhy Spark Is the Next Top (Compute) Model
Why Spark Is the Next Top (Compute) ModelDean Wampler
 
Data Visualization Workflow
Data Visualization WorkflowData Visualization Workflow
Data Visualization Workflowjeremycadams
 
Data Visualization Workflow
Data Visualization WorkflowData Visualization Workflow
Data Visualization Workflowjeremycadams
 
Mongo db php_shaken_not_stirred_joomlafrappe
Mongo db php_shaken_not_stirred_joomlafrappeMongo db php_shaken_not_stirred_joomlafrappe
Mongo db php_shaken_not_stirred_joomlafrappeSpyros Passas
 
Message Oriented Architecture - Gr8conf US 2013
Message Oriented Architecture - Gr8conf US 2013Message Oriented Architecture - Gr8conf US 2013
Message Oriented Architecture - Gr8conf US 2013Steve Pember
 
Set this Big Data technology zoo in order (@pavlobaron)
Set this Big Data technology zoo in order (@pavlobaron)Set this Big Data technology zoo in order (@pavlobaron)
Set this Big Data technology zoo in order (@pavlobaron)Pavlo Baron
 
_Learning SQL_ by Alan Beaulieu.pdf
_Learning SQL_ by Alan Beaulieu.pdf_Learning SQL_ by Alan Beaulieu.pdf
_Learning SQL_ by Alan Beaulieu.pdfSUJOYHALDER9
 
Unleashing the Rails Asset Pipeline
Unleashing the Rails Asset PipelineUnleashing the Rails Asset Pipeline
Unleashing the Rails Asset PipelineKenneth Kalmer
 
SQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics CoveredSQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics CoveredDanish Mehraj
 
Pandas vs. SQL – Tools that Data Scientists use most often.pdf
Pandas vs. SQL – Tools that Data Scientists use most often.pdfPandas vs. SQL – Tools that Data Scientists use most often.pdf
Pandas vs. SQL – Tools that Data Scientists use most often.pdfData Science Council of America
 
იოსებ ძმანაშვილი Node.js
იოსებ ძმანაშვილი   Node.jsიოსებ ძმანაშვილი   Node.js
იოსებ ძმანაშვილი Node.jsunihack
 
Graph Databases - Where Do We Do the Modeling Part?
Graph Databases - Where Do We Do the Modeling Part?Graph Databases - Where Do We Do the Modeling Part?
Graph Databases - Where Do We Do the Modeling Part?DATAVERSITY
 
Heterogeneous Data - Published
Heterogeneous Data - PublishedHeterogeneous Data - Published
Heterogeneous Data - PublishedPaul Steffensen
 
Object relationship mapping and hibernate
Object relationship mapping and hibernateObject relationship mapping and hibernate
Object relationship mapping and hibernateJoe Jacob
 

Ähnlich wie Nosql kl-2013-04-25 (20)

Why Spark Is the Next Top (Compute) Model
Why Spark Is the Next Top (Compute) ModelWhy Spark Is the Next Top (Compute) Model
Why Spark Is the Next Top (Compute) Model
 
NoSQL databases
NoSQL databasesNoSQL databases
NoSQL databases
 
Data Visualization Workflow
Data Visualization WorkflowData Visualization Workflow
Data Visualization Workflow
 
Data Visualization Workflow
Data Visualization WorkflowData Visualization Workflow
Data Visualization Workflow
 
Mongo db php_shaken_not_stirred_joomlafrappe
Mongo db php_shaken_not_stirred_joomlafrappeMongo db php_shaken_not_stirred_joomlafrappe
Mongo db php_shaken_not_stirred_joomlafrappe
 
Message Oriented Architecture - Gr8conf US 2013
Message Oriented Architecture - Gr8conf US 2013Message Oriented Architecture - Gr8conf US 2013
Message Oriented Architecture - Gr8conf US 2013
 
Set this Big Data technology zoo in order (@pavlobaron)
Set this Big Data technology zoo in order (@pavlobaron)Set this Big Data technology zoo in order (@pavlobaron)
Set this Big Data technology zoo in order (@pavlobaron)
 
_Learning SQL_ by Alan Beaulieu.pdf
_Learning SQL_ by Alan Beaulieu.pdf_Learning SQL_ by Alan Beaulieu.pdf
_Learning SQL_ by Alan Beaulieu.pdf
 
Unleashing the Rails Asset Pipeline
Unleashing the Rails Asset PipelineUnleashing the Rails Asset Pipeline
Unleashing the Rails Asset Pipeline
 
No sql
No sqlNo sql
No sql
 
16 nosql
16 nosql16 nosql
16 nosql
 
SQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics CoveredSQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics Covered
 
NoSQL Basics - A Quick Tour
NoSQL Basics - A Quick TourNoSQL Basics - A Quick Tour
NoSQL Basics - A Quick Tour
 
Pandas vs. SQL – Tools that Data Scientists use most often.pdf
Pandas vs. SQL – Tools that Data Scientists use most often.pdfPandas vs. SQL – Tools that Data Scientists use most often.pdf
Pandas vs. SQL – Tools that Data Scientists use most often.pdf
 
ActiveRecord 2.3
ActiveRecord 2.3ActiveRecord 2.3
ActiveRecord 2.3
 
იოსებ ძმანაშვილი Node.js
იოსებ ძმანაშვილი   Node.jsიოსებ ძმანაშვილი   Node.js
იოსებ ძმანაშვილი Node.js
 
Graph Databases - Where Do We Do the Modeling Part?
Graph Databases - Where Do We Do the Modeling Part?Graph Databases - Where Do We Do the Modeling Part?
Graph Databases - Where Do We Do the Modeling Part?
 
Heterogeneous Data - Published
Heterogeneous Data - PublishedHeterogeneous Data - Published
Heterogeneous Data - Published
 
Object relationship mapping and hibernate
Object relationship mapping and hibernateObject relationship mapping and hibernate
Object relationship mapping and hibernate
 
NoSQL
NoSQLNoSQL
NoSQL
 

Mehr von Tristan Gomez

Maker's Schedule, Manager's Schedule
Maker's Schedule, Manager's ScheduleMaker's Schedule, Manager's Schedule
Maker's Schedule, Manager's ScheduleTristan Gomez
 
When Javascript isn't Javascript
When Javascript isn't Javascript When Javascript isn't Javascript
When Javascript isn't Javascript Tristan Gomez
 
Life Beyond Rails: Creating Cross Platform Ruby Apps
Life Beyond Rails: Creating Cross Platform Ruby AppsLife Beyond Rails: Creating Cross Platform Ruby Apps
Life Beyond Rails: Creating Cross Platform Ruby AppsTristan Gomez
 
Refactoring @ Mindvalley: Smells, Techniques and Patterns
Refactoring @ Mindvalley: Smells, Techniques and PatternsRefactoring @ Mindvalley: Smells, Techniques and Patterns
Refactoring @ Mindvalley: Smells, Techniques and PatternsTristan Gomez
 
NuBank - Hyperlocal Banking
NuBank - Hyperlocal BankingNuBank - Hyperlocal Banking
NuBank - Hyperlocal BankingTristan Gomez
 
How I Hire Developers
How I Hire DevelopersHow I Hire Developers
How I Hire DevelopersTristan Gomez
 

Mehr von Tristan Gomez (11)

The Art of Tracking
The Art of TrackingThe Art of Tracking
The Art of Tracking
 
Maker's Schedule, Manager's Schedule
Maker's Schedule, Manager's ScheduleMaker's Schedule, Manager's Schedule
Maker's Schedule, Manager's Schedule
 
When Javascript isn't Javascript
When Javascript isn't Javascript When Javascript isn't Javascript
When Javascript isn't Javascript
 
Slack Bots in Ruby
Slack Bots in RubySlack Bots in Ruby
Slack Bots in Ruby
 
Vue on rails
Vue on railsVue on rails
Vue on rails
 
2FA and OTP
2FA and OTP2FA and OTP
2FA and OTP
 
Life Beyond Rails: Creating Cross Platform Ruby Apps
Life Beyond Rails: Creating Cross Platform Ruby AppsLife Beyond Rails: Creating Cross Platform Ruby Apps
Life Beyond Rails: Creating Cross Platform Ruby Apps
 
Refactoring @ Mindvalley: Smells, Techniques and Patterns
Refactoring @ Mindvalley: Smells, Techniques and PatternsRefactoring @ Mindvalley: Smells, Techniques and Patterns
Refactoring @ Mindvalley: Smells, Techniques and Patterns
 
NuBank - Hyperlocal Banking
NuBank - Hyperlocal BankingNuBank - Hyperlocal Banking
NuBank - Hyperlocal Banking
 
How I Hire Developers
How I Hire DevelopersHow I Hire Developers
How I Hire Developers
 
Meaningful metrics
Meaningful metricsMeaningful metrics
Meaningful metrics
 

Nosql kl-2013-04-25