SlideShare une entreprise Scribd logo
1  sur  56
BRITAIN’S


    DATA
OR
YOU’RE DOING IT WRONG
IAN PLOSKER
Basho Technologies

@dstroyallmodels
WHO IS




basho
   ?
WE MAKE
DATABASE
THIS WORKS AS LONG AS YOU HAVE GOBS OF
                MEMORY
Text
     Text




ORMs & ODMs
NOSQL
DON’T LISTEN TO NOSQL CLOWNS
Who say that all projects must use this newfangled NoSQL
OR NOSQL BROS
Who say that their NoSQL DB is right for every project
THERE IS NO SUCH THING AS NOSQL
THERE'S JUST DATABASES
MAKING DIFFERENT TRADEOFFS
PERSISTENCE STRATEGY

In-Memory               Persistent

             Periodic            Immediate

 Memcache   MongoDB                  Riak

   Redis      Redis              Cassandra

   Hana
(PRIMARY) QUERY MODEL

Rich Query                Key-Value

                Pure       Document     Tablet

 Relational     Riak       MongoDB    Cassandra

  Vertica     BerkleyDB     Couch      HBase

  Datomic     Voldemort     Redis     Big Table
REPLICATION

Master-Slave     Masterless

  Oracle DB         Riak

   MySQL          Cassandra

 PostgreSQL       Voldemort

    Redis

  MongoDB
DISTRIBUTION

  BYO             Sharded         Ring

Oracle DB         MongoDB       Cassandra

 MySQL          MySQL Cluster     Riak

PostgreSQL                      Voldemort

  Redis
DATA MODEL

Relational      Object    Column-Family

Oracle DB         Riak       Cassandra

  MySQL         MongoDB       HBase

PostgreSQL       Couch       BigTable

                 Redis      HyperTable

                Datomic
THERE'S JUST DATABASES
AND QUERIES
CORE ONLINE QUERY TYPES
        Key-                                 Graph/
                   Search        Geo                    Event
        Value                                Relation

       BerkleyDB
                                PostGIS
Scale- CouchDB      SOLR
                               MongoDB        neo4j     MySQL
 up MongoDB         Sphinx
                                 SOLR
        MySQL


Scale- Riak
               elasticsearch elasticsearch      ???     HBase
 out Cassandra
HOW TO DATA MODEL
HAVE A THINK
STORE YOUR DATA RIGHT
FIT YOUR DATA MODEL TO YOUR APP
YOUR DATA AND QUERY MODEL
  SHOULD LIVE IN HARMONY
SELECT	
  SUM(offerTotal)	
  as	
  theOfferTotal,	
  SUM(lienTotal)	
  AS	
  theLienTotal,	
  SUM(CLVtotal)	
  AS	
  
theCLVtotal,	
  SUM(estGrossProfitTotal)	
  AS	
  theESTGPtotal	
  FROM	
  ((	
  SELECT	
  
COALESCE(SUM(COALESCE(offerAmount,	
  0)),	
  0)	
  AS	
  offerTotal,	
  COALESCE(SUM(COALESCE(amount,	
  0)	
  +	
  
COALESCE(legalFees,	
  0)	
  +	
  COALESCE(costs,	
  0)),	
  0)	
  AS	
  lienTotal,	
  COALESCE(SUM(((amount	
  +	
  legalFees	
  
+	
  costs)	
  *	
  (1	
  +	
  (rateOfInterest	
  /	
  100)	
  *	
  (FLOOR((UNIX_TIMESTAMP(NOW())	
  -­‐	
  
UNIX_TIMESTAMP(dateOfAttachment))	
  /	
  86400)	
  /	
  365)))),	
  0)	
  AS	
  CLVtotal,	
  COALESCE(SUM((((amount	
  +	
  
legalFees	
  +	
  costs)	
  *	
  (1	
  +	
  (rateOfInterest	
  /	
  100)	
  *	
  (FLOOR((UNIX_TIMESTAMP(NOW())	
  -­‐	
  
UNIX_TIMESTAMP(dateOfAttachment))	
  /	
  86400)	
  /	
  365)))	
  -­‐	
  COALESCE(offerAmount,	
  0))),	
  0)	
  AS	
  
estGrossProfitTotal	
  FROM	
  lienTable	
  AS	
  theLienTable,	
  propertyTable,	
  property_lien,	
  
stateInterestTable,	
  data,	
  judgementLienTable	
  WHERE	
  theLienTable.lienID	
  =	
  property_lien.lienID	
  AND	
  
propertyTable.propertyID	
  =	
  property_lien.propertyID	
  AND	
  propertyTable.state	
  =	
  
stateInterestTable.state	
  AND	
  theLienTable.lienID	
  =	
  judgementLienTable.lienID	
  AND	
  
theLienTable.lienStatusID	
  IN	
  (65,	
  70,	
  75)	
  AND	
  data.id	
  =	
  (SELECT	
  data.id	
  FROM	
  lienTable,	
  data,	
  
data_lien	
  WHERE	
  lienTable.lienID	
  =	
  data_lien.lienID	
  AND	
  data_lien.id	
  =	
  data.id	
  AND	
  category	
  =	
  15	
  
AND	
  lienTable.lienID	
  =	
  theLienTable.lienID	
  ORDER	
  BY	
  data.id	
  DESC	
  LIMIT	
  1)	
  AND	
  dateOfAttachment	
  !=	
  
0	
  AND	
  UNIX_TIMESTAMP(NOW())	
  >	
  UNIX_TIMESTAMP(dateOfAttachment)	
  AND	
  FLOOR((UNIX_TIMESTAMP(NOW())	
  -­‐	
  
UNIX_TIMESTAMP(dateOfAttachment))	
  /	
  86400)	
  >	
  0	
  AND	
  rateOfInterest	
  >	
  0	
  )	
  UNION	
  (	
  SELECT	
  
COALESCE(SUM(COALESCE(offerAmount,	
  0)),	
  0)	
  AS	
  offerTotal,	
  COALESCE(SUM(COALESCE(amount,	
  0)	
  +	
  
COALESCE(legalFees,	
  0)	
  +	
  COALESCE(costs,	
  0)),	
  0)	
  AS	
  lienTotal,	
  COALESCE(SUM(((amount	
  +	
  legalFees	
  
+	
  costs)	
  *	
  (1	
  +	
  (rateOfInterest	
  /	
  100)	
  *	
  (FLOOR((UNIX_TIMESTAMP(NOW())	
  -­‐	
  
UNIX_TIMESTAMP(judgementDate))	
  /	
  86400)	
  /	
  365)))),	
  0)	
  AS	
  CLVtotal,	
  COALESCE(SUM((((amount	
  +	
  
legalFees	
  +	
  costs)	
  *	
  (1	
  +	
  (rateOfInterest	
  /	
  100)	
  *	
  (FLOOR((UNIX_TIMESTAMP(NOW())	
  -­‐	
  
UNIX_TIMESTAMP(dateOfAttachment))	
  /	
  86400)	
  /	
  365)))	
  -­‐	
  COALESCE(offerAmount,	
  0))),	
  0)	
  AS	
  
estGrossProfitTotal	
  FROM	
  lienTable	
  AS	
  theLienTable,	
  propertyTable,	
  property_lien,	
  
stateInterestTable,	
  data,	
  judgementLienTable	
  WHERE	
  theLienTable.lienID	
  =	
  property_lien.lienID	
  AND	
  
propertyTable.propertyID	
  =	
  property_lien.propertyID	
  AND	
  propertyTable.state	
  =	
  
stateInterestTable.state	
  AND	
  theLienTable.lienID	
  =	
  judgementLienTable.lienID	
  AND	
  
theLienTable.lienStatusID	
  IN	
  (65,	
  70,	
  75)	
  AND	
  data.id	
  =	
  (SELECT	
  data.id	
  FROM	
  lienTable,	
  data,	
  
data_lien	
  WHERE	
  lienTable.lienID	
  =	
  data_lien.lienID	
  AND	
  data_lien.id	
  =	
  data.id	
  AND	
  category	
  =	
  15	
  
AND	
  lienTable.lienID	
  =	
  theLienTable.lienID	
  ORDER	
  BY	
  data.id	
  DESC	
  LIMIT	
  1)	
  AND	
  
COALESCE(dateOfAttachment,	
  0)	
  =	
  0	
  AND	
  judgementDate	
  !=	
  0	
  AND	
  UNIX_TIMESTAMP(NOW())	
  >	
  
UNIX_TIMESTAMP(judgementDate)	
  AND	
  FLOOR((UNIX_TIMESTAMP(NOW())	
  -­‐	
  UNIX_TIMESTAMP(judgementDate))	
  /	
  
86400)	
  >	
  0	
  AND	
  rateOfInterest	
  >	
  0	
  )	
  )	
  AS	
  theBigTable;
THIS IS NOT HARMONY
YOUR DATA AND QUERY MODEL
DON’T DENORMALIZE FOR THE SAKE OF
         DENORMALIZING
DATA QUERIED TOGETHER SHOULD BE STORED
               TOGETHER
TIME BOXING
EXAMPLE: TIMEBOX

Key: "2012-07-20 11:30"
Value: {
  "2012-07-20 11:30": 10,
  "2012-07-20 11:31": 8,
  "2012-07-20 11:32": 28,
  "2012-07-20 11:33": 1,
  "2012-07-20 11:34": 13
}
TIERED DATA MODEL
ROLL UPS
EXAMPLE: ROLLUPS
Key: "2012-07-20 11:30"      Key: "2012-07-20 11:35"
Value: {                     Value: {
  "2012-07-20 11:30": 10,      "2012-07-20 11:35": 4,
  "2012-07-20 11:31": 8,       "2012-07-20 11:36": 9,
  "2012-07-20 11:32": 28,      "2012-07-20 11:37": 3,
  "2012-07-20 11:33": 1,       "2012-07-20 11:38": 12,
  "2012-07-20 11:34": 13       "2012-07-20 11:39": 10
  }                          }

                 Key: "2012-07-20 11:40"
                 Value: {
                   "2012-07-20 11:40": 24,
                   "2012-07-20 11:41": 30,
                   "2012-07-20 11:42": 12,
                   "2012-07-20 11:43": 8,
                   "2012-07-20 11:44": 7
                 }
EXAMPLE: ROLLUPS

  Key: "2012-07-20 11:30"
  Value: {
    "2012-07-20 11:30": 60,
    "2012-07-20 11:35": 38,
    "2012-07-20 11:40": 81,
    "2012-07-20 11:45": 58,
    "2012-07-20 11:50": 34,
    "2012-07-20 11:55": 110
    }
USE NATURAL KEYS
bucket: user
user_id: f47ac10b-58cc-4372-a567-0e02b2c3d479




              SERIOUSLY?
bucket: user
user_id: iplosker




         ISN'T THIS SIMPLER
IT ISN’T JUST YOUR DATABASE THAT NEEDS TO BE
                   SCALABLE
YOUR DATA MODEL NEEDS TO BE SCALABLE
CONFLICT-FREE REPLICATED DATA TYPES
EXAMPLE: OR-SET

{                       {
    observed: ["A"],        observed: [],
    removed: []             removed: []
}                       }



                ["A"]
EXAMPLE: OR-SET

{                      {
    observed: ["A"],       observed: ["B"],
    removed: []            removed: []
}                      }




               ["A", "B"]
EXAMPLE: OR-SET

{                          {
    observed: ["A","B"],       observed: ["A", "B"],
    removed: []                removed: []
}                          }




                    ["A", "B"]
EXAMPLE: OR-SET

{                          {
    observed: ["A","B"],       observed: ["A", "B"],
    removed: ["B"]             removed: []
}                          }




                    ["A","B"]
EXAMPLE: OR-SET

{                          {
    observed: ["A","B"],       observed: ["A","B"],
    removed: ["B"]             removed: []
}                          }




                       ["A"]
EXAMPLE: OR-SET

{                          {
    observed: ["A","B"],       observed: ["A","B"],
    removed: ["B"]             removed: ["B"]
}                          }




                       ["A"]
PICK THE SOLUTION THAT FITS YOUR PROBLEM
ABOVE ALL
KISS

Contenu connexe

Tendances

OrientDB vs Neo4j - Comparison of query/speed/functionality
OrientDB vs Neo4j - Comparison of query/speed/functionalityOrientDB vs Neo4j - Comparison of query/speed/functionality
OrientDB vs Neo4j - Comparison of query/speed/functionalityCurtis Mosters
 
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.GeeksLab Odessa
 
Chris Mc Glothen Sql Portfolio
Chris Mc Glothen Sql PortfolioChris Mc Glothen Sql Portfolio
Chris Mc Glothen Sql Portfolioclmcglothen
 
Indexing and Query Optimizer (Mongo Austin)
Indexing and Query Optimizer (Mongo Austin)Indexing and Query Optimizer (Mongo Austin)
Indexing and Query Optimizer (Mongo Austin)MongoDB
 
Overview of running R in the Oracle Database
Overview of running R in the Oracle DatabaseOverview of running R in the Oracle Database
Overview of running R in the Oracle DatabaseBrendan Tierney
 
SparkSQL and Dataframe
SparkSQL and DataframeSparkSQL and Dataframe
SparkSQL and DataframeNamgee Lee
 
Drilling Cyber Security Data With Apache Drill
Drilling Cyber Security Data With Apache DrillDrilling Cyber Security Data With Apache Drill
Drilling Cyber Security Data With Apache DrillCharles Givre
 
MongoDB Aggregation
MongoDB Aggregation MongoDB Aggregation
MongoDB Aggregation Amit Ghosh
 
Reducing Development Time with MongoDB vs. SQL
Reducing Development Time with MongoDB vs. SQLReducing Development Time with MongoDB vs. SQL
Reducing Development Time with MongoDB vs. SQLMongoDB
 
Cloudera Impala, updated for v1.0
Cloudera Impala, updated for v1.0Cloudera Impala, updated for v1.0
Cloudera Impala, updated for v1.0Scott Leberknight
 
Out ofmemoryerror what is the cost of java objects
Out ofmemoryerror  what is the cost of java objectsOut ofmemoryerror  what is the cost of java objects
Out ofmemoryerror what is the cost of java objectsJean-Philippe BEMPEL
 
The Aggregation Framework
The Aggregation FrameworkThe Aggregation Framework
The Aggregation FrameworkMongoDB
 
Cascading Through Hadoop for the Boulder JUG
Cascading Through Hadoop for the Boulder JUGCascading Through Hadoop for the Boulder JUG
Cascading Through Hadoop for the Boulder JUGMatthew McCullough
 
2011 Mongo FR - Indexing in MongoDB
2011 Mongo FR - Indexing in MongoDB2011 Mongo FR - Indexing in MongoDB
2011 Mongo FR - Indexing in MongoDBantoinegirbal
 
Data Exploration with Apache Drill: Day 2
Data Exploration with Apache Drill: Day 2Data Exploration with Apache Drill: Day 2
Data Exploration with Apache Drill: Day 2Charles Givre
 
MongoDB San Francisco 2013: Hash-based Sharding in MongoDB 2.4 presented by B...
MongoDB San Francisco 2013: Hash-based Sharding in MongoDB 2.4 presented by B...MongoDB San Francisco 2013: Hash-based Sharding in MongoDB 2.4 presented by B...
MongoDB San Francisco 2013: Hash-based Sharding in MongoDB 2.4 presented by B...MongoDB
 
MongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDB
MongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDBMongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDB
MongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDBMongoDB
 
Aggregation Framework MongoDB Days Munich
Aggregation Framework MongoDB Days MunichAggregation Framework MongoDB Days Munich
Aggregation Framework MongoDB Days MunichNorberto Leite
 
Aggregation Framework in MongoDB Overview Part-1
Aggregation Framework in MongoDB Overview Part-1Aggregation Framework in MongoDB Overview Part-1
Aggregation Framework in MongoDB Overview Part-1Anuj Jain
 
Data Binding Intro (Windows 8)
Data Binding Intro (Windows 8)Data Binding Intro (Windows 8)
Data Binding Intro (Windows 8)Gilbok Lee
 

Tendances (20)

OrientDB vs Neo4j - Comparison of query/speed/functionality
OrientDB vs Neo4j - Comparison of query/speed/functionalityOrientDB vs Neo4j - Comparison of query/speed/functionality
OrientDB vs Neo4j - Comparison of query/speed/functionality
 
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
 
Chris Mc Glothen Sql Portfolio
Chris Mc Glothen Sql PortfolioChris Mc Glothen Sql Portfolio
Chris Mc Glothen Sql Portfolio
 
Indexing and Query Optimizer (Mongo Austin)
Indexing and Query Optimizer (Mongo Austin)Indexing and Query Optimizer (Mongo Austin)
Indexing and Query Optimizer (Mongo Austin)
 
Overview of running R in the Oracle Database
Overview of running R in the Oracle DatabaseOverview of running R in the Oracle Database
Overview of running R in the Oracle Database
 
SparkSQL and Dataframe
SparkSQL and DataframeSparkSQL and Dataframe
SparkSQL and Dataframe
 
Drilling Cyber Security Data With Apache Drill
Drilling Cyber Security Data With Apache DrillDrilling Cyber Security Data With Apache Drill
Drilling Cyber Security Data With Apache Drill
 
MongoDB Aggregation
MongoDB Aggregation MongoDB Aggregation
MongoDB Aggregation
 
Reducing Development Time with MongoDB vs. SQL
Reducing Development Time with MongoDB vs. SQLReducing Development Time with MongoDB vs. SQL
Reducing Development Time with MongoDB vs. SQL
 
Cloudera Impala, updated for v1.0
Cloudera Impala, updated for v1.0Cloudera Impala, updated for v1.0
Cloudera Impala, updated for v1.0
 
Out ofmemoryerror what is the cost of java objects
Out ofmemoryerror  what is the cost of java objectsOut ofmemoryerror  what is the cost of java objects
Out ofmemoryerror what is the cost of java objects
 
The Aggregation Framework
The Aggregation FrameworkThe Aggregation Framework
The Aggregation Framework
 
Cascading Through Hadoop for the Boulder JUG
Cascading Through Hadoop for the Boulder JUGCascading Through Hadoop for the Boulder JUG
Cascading Through Hadoop for the Boulder JUG
 
2011 Mongo FR - Indexing in MongoDB
2011 Mongo FR - Indexing in MongoDB2011 Mongo FR - Indexing in MongoDB
2011 Mongo FR - Indexing in MongoDB
 
Data Exploration with Apache Drill: Day 2
Data Exploration with Apache Drill: Day 2Data Exploration with Apache Drill: Day 2
Data Exploration with Apache Drill: Day 2
 
MongoDB San Francisco 2013: Hash-based Sharding in MongoDB 2.4 presented by B...
MongoDB San Francisco 2013: Hash-based Sharding in MongoDB 2.4 presented by B...MongoDB San Francisco 2013: Hash-based Sharding in MongoDB 2.4 presented by B...
MongoDB San Francisco 2013: Hash-based Sharding in MongoDB 2.4 presented by B...
 
MongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDB
MongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDBMongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDB
MongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDB
 
Aggregation Framework MongoDB Days Munich
Aggregation Framework MongoDB Days MunichAggregation Framework MongoDB Days Munich
Aggregation Framework MongoDB Days Munich
 
Aggregation Framework in MongoDB Overview Part-1
Aggregation Framework in MongoDB Overview Part-1Aggregation Framework in MongoDB Overview Part-1
Aggregation Framework in MongoDB Overview Part-1
 
Data Binding Intro (Windows 8)
Data Binding Intro (Windows 8)Data Binding Intro (Windows 8)
Data Binding Intro (Windows 8)
 

Similaire à Next Top Data Model by Ian Plosker

Joins and Other MongoDB 3.2 Aggregation Enhancements
Joins and Other MongoDB 3.2 Aggregation EnhancementsJoins and Other MongoDB 3.2 Aggregation Enhancements
Joins and Other MongoDB 3.2 Aggregation EnhancementsAndrew Morgan
 
To scale or not to scale: Key/Value, Document, SQL, JPA – What’s right for my...
To scale or not to scale: Key/Value, Document, SQL, JPA – What’s right for my...To scale or not to scale: Key/Value, Document, SQL, JPA – What’s right for my...
To scale or not to scale: Key/Value, Document, SQL, JPA – What’s right for my...Uri Cohen
 
Practical Ruby Projects with MongoDB - Ruby Kaigi 2010
Practical Ruby Projects with MongoDB - Ruby Kaigi 2010Practical Ruby Projects with MongoDB - Ruby Kaigi 2010
Practical Ruby Projects with MongoDB - Ruby Kaigi 2010Alex Sharp
 
Query for json databases
Query for json databasesQuery for json databases
Query for json databasesBinh Le
 
Cassandra 3.0 - JSON at scale - StampedeCon 2015
Cassandra 3.0 - JSON at scale - StampedeCon 2015Cassandra 3.0 - JSON at scale - StampedeCon 2015
Cassandra 3.0 - JSON at scale - StampedeCon 2015StampedeCon
 
Slides: Moving from a Relational Model to NoSQL
Slides: Moving from a Relational Model to NoSQLSlides: Moving from a Relational Model to NoSQL
Slides: Moving from a Relational Model to NoSQLDATAVERSITY
 
Couchbase Tutorial: Big data Open Source Systems: VLDB2018
Couchbase Tutorial: Big data Open Source Systems: VLDB2018Couchbase Tutorial: Big data Open Source Systems: VLDB2018
Couchbase Tutorial: Big data Open Source Systems: VLDB2018Keshav Murthy
 
Elasticsearch in 15 Minutes
Elasticsearch in 15 MinutesElasticsearch in 15 Minutes
Elasticsearch in 15 MinutesKarel Minarik
 
Avro, la puissance du binaire, la souplesse du JSON
Avro, la puissance du binaire, la souplesse du JSONAvro, la puissance du binaire, la souplesse du JSON
Avro, la puissance du binaire, la souplesse du JSONAlexandre Victoor
 
Power JSON with PostgreSQL
Power JSON with PostgreSQLPower JSON with PostgreSQL
Power JSON with PostgreSQLEDB
 
Webinar: General Technical Overview of MongoDB for Dev Teams
Webinar: General Technical Overview of MongoDB for Dev TeamsWebinar: General Technical Overview of MongoDB for Dev Teams
Webinar: General Technical Overview of MongoDB for Dev TeamsMongoDB
 
Practical Ruby Projects (Alex Sharp)
Practical Ruby Projects (Alex Sharp)Practical Ruby Projects (Alex Sharp)
Practical Ruby Projects (Alex Sharp)MongoSF
 
Practical Ruby Projects with MongoDB - MongoSF
Practical Ruby Projects with MongoDB - MongoSFPractical Ruby Projects with MongoDB - MongoSF
Practical Ruby Projects with MongoDB - MongoSFAlex Sharp
 
N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5
N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5
N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5Keshav Murthy
 
MongoDB Knowledge share
MongoDB Knowledge shareMongoDB Knowledge share
MongoDB Knowledge shareMr Kyaing
 
Introduction to MongoDB and Workshop
Introduction to MongoDB and WorkshopIntroduction to MongoDB and Workshop
Introduction to MongoDB and WorkshopAhmedabadJavaMeetup
 

Similaire à Next Top Data Model by Ian Plosker (20)

Joins and Other MongoDB 3.2 Aggregation Enhancements
Joins and Other MongoDB 3.2 Aggregation EnhancementsJoins and Other MongoDB 3.2 Aggregation Enhancements
Joins and Other MongoDB 3.2 Aggregation Enhancements
 
To scale or not to scale: Key/Value, Document, SQL, JPA – What’s right for my...
To scale or not to scale: Key/Value, Document, SQL, JPA – What’s right for my...To scale or not to scale: Key/Value, Document, SQL, JPA – What’s right for my...
To scale or not to scale: Key/Value, Document, SQL, JPA – What’s right for my...
 
Yes, Sql!
Yes, Sql!Yes, Sql!
Yes, Sql!
 
MongoDB
MongoDB MongoDB
MongoDB
 
Practical Ruby Projects with MongoDB - Ruby Kaigi 2010
Practical Ruby Projects with MongoDB - Ruby Kaigi 2010Practical Ruby Projects with MongoDB - Ruby Kaigi 2010
Practical Ruby Projects with MongoDB - Ruby Kaigi 2010
 
Query for json databases
Query for json databasesQuery for json databases
Query for json databases
 
MongoDB and RDBMS
MongoDB and RDBMSMongoDB and RDBMS
MongoDB and RDBMS
 
Cassandra 3.0 - JSON at scale - StampedeCon 2015
Cassandra 3.0 - JSON at scale - StampedeCon 2015Cassandra 3.0 - JSON at scale - StampedeCon 2015
Cassandra 3.0 - JSON at scale - StampedeCon 2015
 
MongoDB & PHP
MongoDB & PHPMongoDB & PHP
MongoDB & PHP
 
Slides: Moving from a Relational Model to NoSQL
Slides: Moving from a Relational Model to NoSQLSlides: Moving from a Relational Model to NoSQL
Slides: Moving from a Relational Model to NoSQL
 
Couchbase Tutorial: Big data Open Source Systems: VLDB2018
Couchbase Tutorial: Big data Open Source Systems: VLDB2018Couchbase Tutorial: Big data Open Source Systems: VLDB2018
Couchbase Tutorial: Big data Open Source Systems: VLDB2018
 
Elasticsearch in 15 Minutes
Elasticsearch in 15 MinutesElasticsearch in 15 Minutes
Elasticsearch in 15 Minutes
 
Avro, la puissance du binaire, la souplesse du JSON
Avro, la puissance du binaire, la souplesse du JSONAvro, la puissance du binaire, la souplesse du JSON
Avro, la puissance du binaire, la souplesse du JSON
 
Power JSON with PostgreSQL
Power JSON with PostgreSQLPower JSON with PostgreSQL
Power JSON with PostgreSQL
 
Webinar: General Technical Overview of MongoDB for Dev Teams
Webinar: General Technical Overview of MongoDB for Dev TeamsWebinar: General Technical Overview of MongoDB for Dev Teams
Webinar: General Technical Overview of MongoDB for Dev Teams
 
Practical Ruby Projects (Alex Sharp)
Practical Ruby Projects (Alex Sharp)Practical Ruby Projects (Alex Sharp)
Practical Ruby Projects (Alex Sharp)
 
Practical Ruby Projects with MongoDB - MongoSF
Practical Ruby Projects with MongoDB - MongoSFPractical Ruby Projects with MongoDB - MongoSF
Practical Ruby Projects with MongoDB - MongoSF
 
N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5
N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5
N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5
 
MongoDB Knowledge share
MongoDB Knowledge shareMongoDB Knowledge share
MongoDB Knowledge share
 
Introduction to MongoDB and Workshop
Introduction to MongoDB and WorkshopIntroduction to MongoDB and Workshop
Introduction to MongoDB and Workshop
 

Plus de SyncConf

The Multimap Journey and How to raise Angel Investment by Sean Phelan
The Multimap Journey and How to raise Angel Investment by Sean PhelanThe Multimap Journey and How to raise Angel Investment by Sean Phelan
The Multimap Journey and How to raise Angel Investment by Sean PhelanSyncConf
 
Behaviour Driven Development by Liz Keogh
Behaviour Driven Development by Liz KeoghBehaviour Driven Development by Liz Keogh
Behaviour Driven Development by Liz KeoghSyncConf
 
Tackling Complex Data with Neo4j by Ian Robinson
Tackling Complex Data with Neo4j by Ian RobinsonTackling Complex Data with Neo4j by Ian Robinson
Tackling Complex Data with Neo4j by Ian RobinsonSyncConf
 
Writing Usable APIs in Practice by Giovanni Asproni
Writing Usable APIs in Practice by Giovanni AsproniWriting Usable APIs in Practice by Giovanni Asproni
Writing Usable APIs in Practice by Giovanni AsproniSyncConf
 
The Ubiquitous Digital Map (Abridged) by Gary Gale
The Ubiquitous Digital Map (Abridged) by Gary GaleThe Ubiquitous Digital Map (Abridged) by Gary Gale
The Ubiquitous Digital Map (Abridged) by Gary GaleSyncConf
 
Breaking News and Breaking Software by Andy Hume
Breaking News and Breaking Software by Andy HumeBreaking News and Breaking Software by Andy Hume
Breaking News and Breaking Software by Andy HumeSyncConf
 
The 90 minute Guide to Agile – What, Why, How by Allan Kelly
The 90 minute Guide to Agile – What, Why, How by Allan KellyThe 90 minute Guide to Agile – What, Why, How by Allan Kelly
The 90 minute Guide to Agile – What, Why, How by Allan KellySyncConf
 

Plus de SyncConf (7)

The Multimap Journey and How to raise Angel Investment by Sean Phelan
The Multimap Journey and How to raise Angel Investment by Sean PhelanThe Multimap Journey and How to raise Angel Investment by Sean Phelan
The Multimap Journey and How to raise Angel Investment by Sean Phelan
 
Behaviour Driven Development by Liz Keogh
Behaviour Driven Development by Liz KeoghBehaviour Driven Development by Liz Keogh
Behaviour Driven Development by Liz Keogh
 
Tackling Complex Data with Neo4j by Ian Robinson
Tackling Complex Data with Neo4j by Ian RobinsonTackling Complex Data with Neo4j by Ian Robinson
Tackling Complex Data with Neo4j by Ian Robinson
 
Writing Usable APIs in Practice by Giovanni Asproni
Writing Usable APIs in Practice by Giovanni AsproniWriting Usable APIs in Practice by Giovanni Asproni
Writing Usable APIs in Practice by Giovanni Asproni
 
The Ubiquitous Digital Map (Abridged) by Gary Gale
The Ubiquitous Digital Map (Abridged) by Gary GaleThe Ubiquitous Digital Map (Abridged) by Gary Gale
The Ubiquitous Digital Map (Abridged) by Gary Gale
 
Breaking News and Breaking Software by Andy Hume
Breaking News and Breaking Software by Andy HumeBreaking News and Breaking Software by Andy Hume
Breaking News and Breaking Software by Andy Hume
 
The 90 minute Guide to Agile – What, Why, How by Allan Kelly
The 90 minute Guide to Agile – What, Why, How by Allan KellyThe 90 minute Guide to Agile – What, Why, How by Allan Kelly
The 90 minute Guide to Agile – What, Why, How by Allan Kelly
 

Dernier

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate AgentsRyan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate AgentsRyan Mahoney
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Visualising and forecasting stocks using Dash
Visualising and forecasting stocks using DashVisualising and forecasting stocks using Dash
Visualising and forecasting stocks using Dashnarutouzumaki53779
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 

Dernier (20)

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate AgentsRyan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Visualising and forecasting stocks using Dash
Visualising and forecasting stocks using DashVisualising and forecasting stocks using Dash
Visualising and forecasting stocks using Dash
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 

Next Top Data Model by Ian Plosker

  • 1. BRITAIN’S DATA
  • 2. OR
  • 7.
  • 9.
  • 10. THIS WORKS AS LONG AS YOU HAVE GOBS OF MEMORY
  • 11. Text Text ORMs & ODMs
  • 12. NOSQL
  • 13. DON’T LISTEN TO NOSQL CLOWNS Who say that all projects must use this newfangled NoSQL
  • 14. OR NOSQL BROS Who say that their NoSQL DB is right for every project
  • 15. THERE IS NO SUCH THING AS NOSQL
  • 18. PERSISTENCE STRATEGY In-Memory Persistent Periodic Immediate Memcache MongoDB Riak Redis Redis Cassandra Hana
  • 19. (PRIMARY) QUERY MODEL Rich Query Key-Value Pure Document Tablet Relational Riak MongoDB Cassandra Vertica BerkleyDB Couch HBase Datomic Voldemort Redis Big Table
  • 20. REPLICATION Master-Slave Masterless Oracle DB Riak MySQL Cassandra PostgreSQL Voldemort Redis MongoDB
  • 21. DISTRIBUTION BYO Sharded Ring Oracle DB MongoDB Cassandra MySQL MySQL Cluster Riak PostgreSQL Voldemort Redis
  • 22. DATA MODEL Relational Object Column-Family Oracle DB Riak Cassandra MySQL MongoDB HBase PostgreSQL Couch BigTable Redis HyperTable Datomic
  • 25. CORE ONLINE QUERY TYPES Key- Graph/ Search Geo Event Value Relation BerkleyDB PostGIS Scale- CouchDB SOLR MongoDB neo4j MySQL up MongoDB Sphinx SOLR MySQL Scale- Riak elasticsearch elasticsearch ??? HBase out Cassandra
  • 26. HOW TO DATA MODEL
  • 29. FIT YOUR DATA MODEL TO YOUR APP
  • 30. YOUR DATA AND QUERY MODEL SHOULD LIVE IN HARMONY
  • 31. SELECT  SUM(offerTotal)  as  theOfferTotal,  SUM(lienTotal)  AS  theLienTotal,  SUM(CLVtotal)  AS   theCLVtotal,  SUM(estGrossProfitTotal)  AS  theESTGPtotal  FROM  ((  SELECT   COALESCE(SUM(COALESCE(offerAmount,  0)),  0)  AS  offerTotal,  COALESCE(SUM(COALESCE(amount,  0)  +   COALESCE(legalFees,  0)  +  COALESCE(costs,  0)),  0)  AS  lienTotal,  COALESCE(SUM(((amount  +  legalFees   +  costs)  *  (1  +  (rateOfInterest  /  100)  *  (FLOOR((UNIX_TIMESTAMP(NOW())  -­‐   UNIX_TIMESTAMP(dateOfAttachment))  /  86400)  /  365)))),  0)  AS  CLVtotal,  COALESCE(SUM((((amount  +   legalFees  +  costs)  *  (1  +  (rateOfInterest  /  100)  *  (FLOOR((UNIX_TIMESTAMP(NOW())  -­‐   UNIX_TIMESTAMP(dateOfAttachment))  /  86400)  /  365)))  -­‐  COALESCE(offerAmount,  0))),  0)  AS   estGrossProfitTotal  FROM  lienTable  AS  theLienTable,  propertyTable,  property_lien,   stateInterestTable,  data,  judgementLienTable  WHERE  theLienTable.lienID  =  property_lien.lienID  AND   propertyTable.propertyID  =  property_lien.propertyID  AND  propertyTable.state  =   stateInterestTable.state  AND  theLienTable.lienID  =  judgementLienTable.lienID  AND   theLienTable.lienStatusID  IN  (65,  70,  75)  AND  data.id  =  (SELECT  data.id  FROM  lienTable,  data,   data_lien  WHERE  lienTable.lienID  =  data_lien.lienID  AND  data_lien.id  =  data.id  AND  category  =  15   AND  lienTable.lienID  =  theLienTable.lienID  ORDER  BY  data.id  DESC  LIMIT  1)  AND  dateOfAttachment  !=   0  AND  UNIX_TIMESTAMP(NOW())  >  UNIX_TIMESTAMP(dateOfAttachment)  AND  FLOOR((UNIX_TIMESTAMP(NOW())  -­‐   UNIX_TIMESTAMP(dateOfAttachment))  /  86400)  >  0  AND  rateOfInterest  >  0  )  UNION  (  SELECT   COALESCE(SUM(COALESCE(offerAmount,  0)),  0)  AS  offerTotal,  COALESCE(SUM(COALESCE(amount,  0)  +   COALESCE(legalFees,  0)  +  COALESCE(costs,  0)),  0)  AS  lienTotal,  COALESCE(SUM(((amount  +  legalFees   +  costs)  *  (1  +  (rateOfInterest  /  100)  *  (FLOOR((UNIX_TIMESTAMP(NOW())  -­‐   UNIX_TIMESTAMP(judgementDate))  /  86400)  /  365)))),  0)  AS  CLVtotal,  COALESCE(SUM((((amount  +   legalFees  +  costs)  *  (1  +  (rateOfInterest  /  100)  *  (FLOOR((UNIX_TIMESTAMP(NOW())  -­‐   UNIX_TIMESTAMP(dateOfAttachment))  /  86400)  /  365)))  -­‐  COALESCE(offerAmount,  0))),  0)  AS   estGrossProfitTotal  FROM  lienTable  AS  theLienTable,  propertyTable,  property_lien,   stateInterestTable,  data,  judgementLienTable  WHERE  theLienTable.lienID  =  property_lien.lienID  AND   propertyTable.propertyID  =  property_lien.propertyID  AND  propertyTable.state  =   stateInterestTable.state  AND  theLienTable.lienID  =  judgementLienTable.lienID  AND   theLienTable.lienStatusID  IN  (65,  70,  75)  AND  data.id  =  (SELECT  data.id  FROM  lienTable,  data,   data_lien  WHERE  lienTable.lienID  =  data_lien.lienID  AND  data_lien.id  =  data.id  AND  category  =  15   AND  lienTable.lienID  =  theLienTable.lienID  ORDER  BY  data.id  DESC  LIMIT  1)  AND   COALESCE(dateOfAttachment,  0)  =  0  AND  judgementDate  !=  0  AND  UNIX_TIMESTAMP(NOW())  >   UNIX_TIMESTAMP(judgementDate)  AND  FLOOR((UNIX_TIMESTAMP(NOW())  -­‐  UNIX_TIMESTAMP(judgementDate))  /   86400)  >  0  AND  rateOfInterest  >  0  )  )  AS  theBigTable;
  • 32. THIS IS NOT HARMONY
  • 33. YOUR DATA AND QUERY MODEL
  • 34. DON’T DENORMALIZE FOR THE SAKE OF DENORMALIZING
  • 35. DATA QUERIED TOGETHER SHOULD BE STORED TOGETHER
  • 37. EXAMPLE: TIMEBOX Key: "2012-07-20 11:30" Value: { "2012-07-20 11:30": 10, "2012-07-20 11:31": 8, "2012-07-20 11:32": 28, "2012-07-20 11:33": 1, "2012-07-20 11:34": 13 }
  • 40. EXAMPLE: ROLLUPS Key: "2012-07-20 11:30" Key: "2012-07-20 11:35" Value: { Value: { "2012-07-20 11:30": 10, "2012-07-20 11:35": 4, "2012-07-20 11:31": 8, "2012-07-20 11:36": 9, "2012-07-20 11:32": 28, "2012-07-20 11:37": 3, "2012-07-20 11:33": 1, "2012-07-20 11:38": 12, "2012-07-20 11:34": 13 "2012-07-20 11:39": 10 } } Key: "2012-07-20 11:40" Value: { "2012-07-20 11:40": 24, "2012-07-20 11:41": 30, "2012-07-20 11:42": 12, "2012-07-20 11:43": 8, "2012-07-20 11:44": 7 }
  • 41. EXAMPLE: ROLLUPS Key: "2012-07-20 11:30" Value: { "2012-07-20 11:30": 60, "2012-07-20 11:35": 38, "2012-07-20 11:40": 81, "2012-07-20 11:45": 58, "2012-07-20 11:50": 34, "2012-07-20 11:55": 110 }
  • 44. bucket: user user_id: iplosker ISN'T THIS SIMPLER
  • 45. IT ISN’T JUST YOUR DATABASE THAT NEEDS TO BE SCALABLE
  • 46. YOUR DATA MODEL NEEDS TO BE SCALABLE
  • 48. EXAMPLE: OR-SET { { observed: ["A"], observed: [], removed: [] removed: [] } } ["A"]
  • 49. EXAMPLE: OR-SET { { observed: ["A"], observed: ["B"], removed: [] removed: [] } } ["A", "B"]
  • 50. EXAMPLE: OR-SET { { observed: ["A","B"], observed: ["A", "B"], removed: [] removed: [] } } ["A", "B"]
  • 51. EXAMPLE: OR-SET { { observed: ["A","B"], observed: ["A", "B"], removed: ["B"] removed: [] } } ["A","B"]
  • 52. EXAMPLE: OR-SET { { observed: ["A","B"], observed: ["A","B"], removed: ["B"] removed: [] } } ["A"]
  • 53. EXAMPLE: OR-SET { { observed: ["A","B"], observed: ["A","B"], removed: ["B"] removed: ["B"] } } ["A"]
  • 54. PICK THE SOLUTION THAT FITS YOUR PROBLEM
  • 56. KISS