SlideShare a Scribd company logo
1 of 19
Data Modeling
with Couchbase Server 4.0
Cihan Biyikoglu | Dir. Product Management, Couchbase
©2015 Couchbase Inc. 2
Agenda
• What is Data Modeling?
• Couchbase Server Data Models
• Documents with JSON and Key-Values
• Phase I - Logical data modeling
• Entitles,Attributes and Relationships
• Phase II - Physical data modeling
• Keys, Documents/Values, Attributes and Buckets
• Relationships
• Evolving Data Models
• Q&A
©2015 Couchbase Inc. 3
What is Data Modeling?
 Data Modeling:
Exploring Structure of Data that best fit your apps needs
Modeling Cities: Buildings, ports, roads and more
Modeling Investments: Instruments, investors, orders and more
ModelingTravel Documents:Airlines, hotels, rental cars, travellers and
more
©2015 Couchbase Inc. 4
Couchbase Server Data Models
©2015 Couchbase Inc. 5
Couchbase Server Data Models
 Documents with JSON
– Represent complex entities with
full modeling and query flexibility
Ex: purchase order, travel itinerary
{
“Name”: “Pike Brewing”,
“Addresses”: [
{ “Loc_Identifier”:”HQ”,
“Street”:”1 pike place market st”,
“City”: “Seattle”
…},
{
“Loc_Identifier”:”Bellevue”,
…
}
],
“Founders”:…
“EstablishedData”:…
…
}
Brewery_Pike_Brewing
 Key-Value
– Represent simple entities with fast
& direct access
Ex: passwords, session-state, private/public keys
0xAB635FF987234789BC987D987EE89
7723498765
pwd_userid_00001Key
Value
©2015 Couchbase Inc. 6
Logical Data Model
©2015 Couchbase Inc. 7
Logical Data Modeling
 Phase I – define entities, attributes and their relationships
– Entities: Main objects that are targets of your apps operates on
• Attributes: properties that your applications keep track of for the entity
• Relationships: definition connections to other entities - 1-1, 1-many, many-many
Satellites
Instruments
Measurements
Missions
Manufacturers
©2015 Couchbase Inc. 8
Physical Data Model
©2015 Couchbase Inc. 9
Physical Data Model
 Phase II – Map entities, attributes and their relationships to containers
provided by the underlying database solution
Relational Databases Couchbase Server
Databases Buckets
Tables Documents with type designator attributeOR
Buckets
Rows Items (Key-Value or Key-Document)
Columns Attributes
Index Index
©2015 Couchbase Inc. 10
Physical Data Modeling
 Entities > Buckets, Keys & Items
– Buckets: group of items with controls for HA, Security and Computational
Resources
• Replica count, compaction schedule, RAM quota and more
– Keys: unique identifier for instances of the entity
• Composite or Surrogate
– Items
• JSON Documents with Attributes:
 Basic types: bool, string, numeric, date or array of these types
 Embedded JSON Documents or array of embedded of these types
• BinaryValues:
 Anything up to 20MB
©2015 Couchbase Inc. 11
Remember our logical data modeling?
Satellites
Instruments
Measurements
Missions
Manufacturers
©2015 Couchbase Inc. 12
Physical Data Modeling
 Physical Data Model
Satellites
{
“name”:…,
“route”:…,
“missions”:[
{“name”:“launch”,
“date”:…,},
{“name”:”repair-1”,
“date”:…,}
…],
“instruments”:[
{“id”:“camera_01”},
{“id”:”altimeter_01”},
…],
“manufacturer”:{
“name”:”Boeing”,
“city”:”Seattle”,…},
…
}
Instruments
{
“id”:”camera_01”,
“manufacturer”:{
“name”:”Boeing”,
“city”:”Seattle”,…},
…}
InstrumentIDs
Measurements
{
“instrument_ id”:”altimeter_01”,
“satellite_name”:…,
“date_time”:…,
“location”:{
“lat”:…,“long”:…},
“measurement”:…
…}
ManufacturerMissions
©2015 Couchbase Inc. 13
Embedding vs Referencing
 Embed When
– Both docs are frequently access
together.
– You need strict consistency between
both docs.
 ReferenceWhen
– Both docs aren’t frequently access
together.
– You need strict consistency for the
referenced information
– Need to optimize for performance
and referenced doc is large
©2015 Couchbase Inc. 14
References: SQL JOINs with Couchbase Server 4.0
 Note: References are flexible in
N1QL
SELECT AVG(m.measurement),…
FROM Measurements m
JOIN Satellites s
ON KEYS m.satellite_name
WHERE m.date_time BETWEEN … AND
NOW();
©2015 Couchbase Inc. 15
Relationships
 1-1
– Embed Example: Satellite and Manufacturer
 1-Many
– Embed Example: Satellite and Missions
– Reference Example: Satellite and Instruments
 Many-Many
– Reference Example: Satellite and Measurements
©2015 Couchbase Inc. 16
Evolving Data Models
©2015 Couchbase Inc. 17
Evolving Data Models
Change your apps code and you are good to go!
 Schema is App Driven in Couchbase Server
– OK to maintain multiple versions of the schema
 Schema Changes with Couchbase Server
– No Explicit Server Action Required by DBA
– No Downtime required to update existing data to new shape
©2015 Couchbase Inc. 18
Recap
 Couchbase Server support key-value and document based data
modeling natively.
 Model data in 2 phases
– Logical data model
– Physical data model
• Embed vs Reference
 Evolve your Schema without pain
Get Started with Couchbase Server 4.0 - Couchbase.com/Downloads
Q&A
Cihan Biyikoglu | cihan@couchbase.com | @cihangirb

More Related Content

Similar to Document Data Modelling with Couchbase Server 4.0

Building your First MEAN App
Building your First MEAN AppBuilding your First MEAN App
Building your First MEAN AppMongoDB
 
WSO2 Workshop Sydney 2016 - Analytics
WSO2 Workshop Sydney 2016 -  AnalyticsWSO2 Workshop Sydney 2016 -  Analytics
WSO2 Workshop Sydney 2016 - AnalyticsDassana Wijesekara
 
WSO2Con EU 2015: An Introduction to the WSO2 Data Analytics Platform
WSO2Con EU 2015: An Introduction to the WSO2 Data Analytics PlatformWSO2Con EU 2015: An Introduction to the WSO2 Data Analytics Platform
WSO2Con EU 2015: An Introduction to the WSO2 Data Analytics PlatformWSO2
 
NoSQL Data Modeling using Couchbase
NoSQL Data Modeling using CouchbaseNoSQL Data Modeling using Couchbase
NoSQL Data Modeling using CouchbaseBrant Burnett
 
DataFusion and Arrow_ Supercharge Your Data Analytical Tool with a Rusty Quer...
DataFusion and Arrow_ Supercharge Your Data Analytical Tool with a Rusty Quer...DataFusion and Arrow_ Supercharge Your Data Analytical Tool with a Rusty Quer...
DataFusion and Arrow_ Supercharge Your Data Analytical Tool with a Rusty Quer...Medcl1
 
Introduction to WSO2 Analytics Platform: 2016 Q2 Update
Introduction to WSO2 Analytics Platform: 2016 Q2 UpdateIntroduction to WSO2 Analytics Platform: 2016 Q2 Update
Introduction to WSO2 Analytics Platform: 2016 Q2 UpdateSrinath Perera
 
Introducing MongoDB Stitch, Backend-as-a-Service from MongoDB
Introducing MongoDB Stitch, Backend-as-a-Service from MongoDBIntroducing MongoDB Stitch, Backend-as-a-Service from MongoDB
Introducing MongoDB Stitch, Backend-as-a-Service from MongoDBMongoDB
 
Docker Summit MongoDB - Data Democratization
Docker Summit MongoDB - Data Democratization Docker Summit MongoDB - Data Democratization
Docker Summit MongoDB - Data Democratization Chris Grabosky
 
FOSDEM 2014: Social Network Benchmark (SNB) Graph Generator
FOSDEM 2014:  Social Network Benchmark (SNB) Graph GeneratorFOSDEM 2014:  Social Network Benchmark (SNB) Graph Generator
FOSDEM 2014: Social Network Benchmark (SNB) Graph GeneratorLDBC council
 
Azure Stream Analytics : Analyse Data in Motion
Azure Stream Analytics  : Analyse Data in MotionAzure Stream Analytics  : Analyse Data in Motion
Azure Stream Analytics : Analyse Data in MotionRuhani Arora
 
Connect(); 2016 한시간 총정리
Connect(); 2016 한시간 총정리Connect(); 2016 한시간 총정리
Connect(); 2016 한시간 총정리명신 김
 
Snowplow - Evolve your analytics stack with your business
Snowplow - Evolve your analytics stack with your businessSnowplow - Evolve your analytics stack with your business
Snowplow - Evolve your analytics stack with your businessGiuseppe Gaviani
 
Deep dive into N1QL: SQL for JSON: Internals and power features.
Deep dive into N1QL: SQL for JSON: Internals and power features.Deep dive into N1QL: SQL for JSON: Internals and power features.
Deep dive into N1QL: SQL for JSON: Internals and power features.Keshav Murthy
 
Introduction To Dallas
Introduction To DallasIntroduction To Dallas
Introduction To DallasWaterWang
 
Application Development & Database Choices: Postgres Support for non Relation...
Application Development & Database Choices: Postgres Support for non Relation...Application Development & Database Choices: Postgres Support for non Relation...
Application Development & Database Choices: Postgres Support for non Relation...EDB
 
Snowplow: evolve your analytics stack with your business
Snowplow: evolve your analytics stack with your businessSnowplow: evolve your analytics stack with your business
Snowplow: evolve your analytics stack with your businessyalisassoon
 
MongoDB Stitch Introduction
MongoDB Stitch IntroductionMongoDB Stitch Introduction
MongoDB Stitch IntroductionMongoDB
 
Simplifying & accelerating application development with MongoDB's intelligent...
Simplifying & accelerating application development with MongoDB's intelligent...Simplifying & accelerating application development with MongoDB's intelligent...
Simplifying & accelerating application development with MongoDB's intelligent...Maxime Beugnet
 
Couchbase Overview Nov 2013
Couchbase Overview Nov 2013Couchbase Overview Nov 2013
Couchbase Overview Nov 2013Jeff Harris
 

Similar to Document Data Modelling with Couchbase Server 4.0 (20)

Building your First MEAN App
Building your First MEAN AppBuilding your First MEAN App
Building your First MEAN App
 
WSO2 Workshop Sydney 2016 - Analytics
WSO2 Workshop Sydney 2016 -  AnalyticsWSO2 Workshop Sydney 2016 -  Analytics
WSO2 Workshop Sydney 2016 - Analytics
 
WSO2Con EU 2015: An Introduction to the WSO2 Data Analytics Platform
WSO2Con EU 2015: An Introduction to the WSO2 Data Analytics PlatformWSO2Con EU 2015: An Introduction to the WSO2 Data Analytics Platform
WSO2Con EU 2015: An Introduction to the WSO2 Data Analytics Platform
 
NoSQL Data Modeling using Couchbase
NoSQL Data Modeling using CouchbaseNoSQL Data Modeling using Couchbase
NoSQL Data Modeling using Couchbase
 
921創業小聚
921創業小聚921創業小聚
921創業小聚
 
DataFusion and Arrow_ Supercharge Your Data Analytical Tool with a Rusty Quer...
DataFusion and Arrow_ Supercharge Your Data Analytical Tool with a Rusty Quer...DataFusion and Arrow_ Supercharge Your Data Analytical Tool with a Rusty Quer...
DataFusion and Arrow_ Supercharge Your Data Analytical Tool with a Rusty Quer...
 
Introduction to WSO2 Analytics Platform: 2016 Q2 Update
Introduction to WSO2 Analytics Platform: 2016 Q2 UpdateIntroduction to WSO2 Analytics Platform: 2016 Q2 Update
Introduction to WSO2 Analytics Platform: 2016 Q2 Update
 
Introducing MongoDB Stitch, Backend-as-a-Service from MongoDB
Introducing MongoDB Stitch, Backend-as-a-Service from MongoDBIntroducing MongoDB Stitch, Backend-as-a-Service from MongoDB
Introducing MongoDB Stitch, Backend-as-a-Service from MongoDB
 
Docker Summit MongoDB - Data Democratization
Docker Summit MongoDB - Data Democratization Docker Summit MongoDB - Data Democratization
Docker Summit MongoDB - Data Democratization
 
FOSDEM 2014: Social Network Benchmark (SNB) Graph Generator
FOSDEM 2014:  Social Network Benchmark (SNB) Graph GeneratorFOSDEM 2014:  Social Network Benchmark (SNB) Graph Generator
FOSDEM 2014: Social Network Benchmark (SNB) Graph Generator
 
Azure Stream Analytics : Analyse Data in Motion
Azure Stream Analytics  : Analyse Data in MotionAzure Stream Analytics  : Analyse Data in Motion
Azure Stream Analytics : Analyse Data in Motion
 
Connect(); 2016 한시간 총정리
Connect(); 2016 한시간 총정리Connect(); 2016 한시간 총정리
Connect(); 2016 한시간 총정리
 
Snowplow - Evolve your analytics stack with your business
Snowplow - Evolve your analytics stack with your businessSnowplow - Evolve your analytics stack with your business
Snowplow - Evolve your analytics stack with your business
 
Deep dive into N1QL: SQL for JSON: Internals and power features.
Deep dive into N1QL: SQL for JSON: Internals and power features.Deep dive into N1QL: SQL for JSON: Internals and power features.
Deep dive into N1QL: SQL for JSON: Internals and power features.
 
Introduction To Dallas
Introduction To DallasIntroduction To Dallas
Introduction To Dallas
 
Application Development & Database Choices: Postgres Support for non Relation...
Application Development & Database Choices: Postgres Support for non Relation...Application Development & Database Choices: Postgres Support for non Relation...
Application Development & Database Choices: Postgres Support for non Relation...
 
Snowplow: evolve your analytics stack with your business
Snowplow: evolve your analytics stack with your businessSnowplow: evolve your analytics stack with your business
Snowplow: evolve your analytics stack with your business
 
MongoDB Stitch Introduction
MongoDB Stitch IntroductionMongoDB Stitch Introduction
MongoDB Stitch Introduction
 
Simplifying & accelerating application development with MongoDB's intelligent...
Simplifying & accelerating application development with MongoDB's intelligent...Simplifying & accelerating application development with MongoDB's intelligent...
Simplifying & accelerating application development with MongoDB's intelligent...
 
Couchbase Overview Nov 2013
Couchbase Overview Nov 2013Couchbase Overview Nov 2013
Couchbase Overview Nov 2013
 

More from Cihan Biyikoglu

Real-time Analytics with Redis
Real-time Analytics with RedisReal-time Analytics with Redis
Real-time Analytics with RedisCihan Biyikoglu
 
Developing Active-Active Geo-Distributed Apps with Redis
Developing Active-Active Geo-Distributed Apps with RedisDeveloping Active-Active Geo-Distributed Apps with Redis
Developing Active-Active Geo-Distributed Apps with RedisCihan Biyikoglu
 
Cross Data Center Replication with Redis using Redis Enterprise
Cross Data Center Replication with Redis using Redis EnterpriseCross Data Center Replication with Redis using Redis Enterprise
Cross Data Center Replication with Redis using Redis EnterpriseCihan Biyikoglu
 
Under the Hood - Couchbase Server Architecture - June 2015
Under the Hood - Couchbase Server Architecture - June 2015Under the Hood - Couchbase Server Architecture - June 2015
Under the Hood - Couchbase Server Architecture - June 2015Cihan Biyikoglu
 
Global Secondary Indexes in Couchbase Server 4.0 - JUNE 2015
Global Secondary Indexes in Couchbase Server 4.0 - JUNE 2015Global Secondary Indexes in Couchbase Server 4.0 - JUNE 2015
Global Secondary Indexes in Couchbase Server 4.0 - JUNE 2015Cihan Biyikoglu
 
Deploying couchbaseserverazure cihanbiyikoglu_microsoft
Deploying couchbaseserverazure cihanbiyikoglu_microsoftDeploying couchbaseserverazure cihanbiyikoglu_microsoft
Deploying couchbaseserverazure cihanbiyikoglu_microsoftCihan Biyikoglu
 
Inside Sql Azure - Cihan Biyikoglu - SQL Azure
Inside Sql Azure - Cihan Biyikoglu - SQL AzureInside Sql Azure - Cihan Biyikoglu - SQL Azure
Inside Sql Azure - Cihan Biyikoglu - SQL AzureCihan Biyikoglu
 

More from Cihan Biyikoglu (9)

Securing Redis
Securing RedisSecuring Redis
Securing Redis
 
Real-time Analytics with Redis
Real-time Analytics with RedisReal-time Analytics with Redis
Real-time Analytics with Redis
 
Developing Active-Active Geo-Distributed Apps with Redis
Developing Active-Active Geo-Distributed Apps with RedisDeveloping Active-Active Geo-Distributed Apps with Redis
Developing Active-Active Geo-Distributed Apps with Redis
 
Cross Data Center Replication with Redis using Redis Enterprise
Cross Data Center Replication with Redis using Redis EnterpriseCross Data Center Replication with Redis using Redis Enterprise
Cross Data Center Replication with Redis using Redis Enterprise
 
Under the Hood - Couchbase Server Architecture - June 2015
Under the Hood - Couchbase Server Architecture - June 2015Under the Hood - Couchbase Server Architecture - June 2015
Under the Hood - Couchbase Server Architecture - June 2015
 
Global Secondary Indexes in Couchbase Server 4.0 - JUNE 2015
Global Secondary Indexes in Couchbase Server 4.0 - JUNE 2015Global Secondary Indexes in Couchbase Server 4.0 - JUNE 2015
Global Secondary Indexes in Couchbase Server 4.0 - JUNE 2015
 
SQL gene in NoSQL
SQL gene in NoSQLSQL gene in NoSQL
SQL gene in NoSQL
 
Deploying couchbaseserverazure cihanbiyikoglu_microsoft
Deploying couchbaseserverazure cihanbiyikoglu_microsoftDeploying couchbaseserverazure cihanbiyikoglu_microsoft
Deploying couchbaseserverazure cihanbiyikoglu_microsoft
 
Inside Sql Azure - Cihan Biyikoglu - SQL Azure
Inside Sql Azure - Cihan Biyikoglu - SQL AzureInside Sql Azure - Cihan Biyikoglu - SQL Azure
Inside Sql Azure - Cihan Biyikoglu - SQL Azure
 

Recently uploaded

怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制vexqp
 
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...gajnagarg
 
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...nirzagarg
 
Statistics notes ,it includes mean to index numbers
Statistics notes ,it includes mean to index numbersStatistics notes ,it includes mean to index numbers
Statistics notes ,it includes mean to index numberssuginr1
 
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...HyderabadDolls
 
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...HyderabadDolls
 
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...kumargunjan9515
 
Ranking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRanking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRajesh Mondal
 
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...Elaine Werffeli
 
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book nowVadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book nowgargpaaro
 
Gulbai Tekra * Cheap Call Girls In Ahmedabad Phone No 8005736733 Elite Escort...
Gulbai Tekra * Cheap Call Girls In Ahmedabad Phone No 8005736733 Elite Escort...Gulbai Tekra * Cheap Call Girls In Ahmedabad Phone No 8005736733 Elite Escort...
Gulbai Tekra * Cheap Call Girls In Ahmedabad Phone No 8005736733 Elite Escort...gragchanchal546
 
20240412-SmartCityIndex-2024-Full-Report.pdf
20240412-SmartCityIndex-2024-Full-Report.pdf20240412-SmartCityIndex-2024-Full-Report.pdf
20240412-SmartCityIndex-2024-Full-Report.pdfkhraisr
 
RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptx
RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptxRESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptx
RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptxronsairoathenadugay
 
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With OrangePredicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With OrangeThinkInnovation
 
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...HyderabadDolls
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNKTimothy Spann
 
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...kumargunjan9515
 
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...HyderabadDolls
 
Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...
Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...
Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...HyderabadDolls
 
Aspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - AlmoraAspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - AlmoraGovindSinghDasila
 

Recently uploaded (20)

怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
 
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
 
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
 
Statistics notes ,it includes mean to index numbers
Statistics notes ,it includes mean to index numbersStatistics notes ,it includes mean to index numbers
Statistics notes ,it includes mean to index numbers
 
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
 
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
 
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...
 
Ranking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRanking and Scoring Exercises for Research
Ranking and Scoring Exercises for Research
 
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
 
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book nowVadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
 
Gulbai Tekra * Cheap Call Girls In Ahmedabad Phone No 8005736733 Elite Escort...
Gulbai Tekra * Cheap Call Girls In Ahmedabad Phone No 8005736733 Elite Escort...Gulbai Tekra * Cheap Call Girls In Ahmedabad Phone No 8005736733 Elite Escort...
Gulbai Tekra * Cheap Call Girls In Ahmedabad Phone No 8005736733 Elite Escort...
 
20240412-SmartCityIndex-2024-Full-Report.pdf
20240412-SmartCityIndex-2024-Full-Report.pdf20240412-SmartCityIndex-2024-Full-Report.pdf
20240412-SmartCityIndex-2024-Full-Report.pdf
 
RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptx
RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptxRESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptx
RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptx
 
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With OrangePredicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
 
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
 
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
 
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
 
Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...
Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...
Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...
 
Aspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - AlmoraAspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - Almora
 

Document Data Modelling with Couchbase Server 4.0

  • 1. Data Modeling with Couchbase Server 4.0 Cihan Biyikoglu | Dir. Product Management, Couchbase
  • 2. ©2015 Couchbase Inc. 2 Agenda • What is Data Modeling? • Couchbase Server Data Models • Documents with JSON and Key-Values • Phase I - Logical data modeling • Entitles,Attributes and Relationships • Phase II - Physical data modeling • Keys, Documents/Values, Attributes and Buckets • Relationships • Evolving Data Models • Q&A
  • 3. ©2015 Couchbase Inc. 3 What is Data Modeling?  Data Modeling: Exploring Structure of Data that best fit your apps needs Modeling Cities: Buildings, ports, roads and more Modeling Investments: Instruments, investors, orders and more ModelingTravel Documents:Airlines, hotels, rental cars, travellers and more
  • 4. ©2015 Couchbase Inc. 4 Couchbase Server Data Models
  • 5. ©2015 Couchbase Inc. 5 Couchbase Server Data Models  Documents with JSON – Represent complex entities with full modeling and query flexibility Ex: purchase order, travel itinerary { “Name”: “Pike Brewing”, “Addresses”: [ { “Loc_Identifier”:”HQ”, “Street”:”1 pike place market st”, “City”: “Seattle” …}, { “Loc_Identifier”:”Bellevue”, … } ], “Founders”:… “EstablishedData”:… … } Brewery_Pike_Brewing  Key-Value – Represent simple entities with fast & direct access Ex: passwords, session-state, private/public keys 0xAB635FF987234789BC987D987EE89 7723498765 pwd_userid_00001Key Value
  • 6. ©2015 Couchbase Inc. 6 Logical Data Model
  • 7. ©2015 Couchbase Inc. 7 Logical Data Modeling  Phase I – define entities, attributes and their relationships – Entities: Main objects that are targets of your apps operates on • Attributes: properties that your applications keep track of for the entity • Relationships: definition connections to other entities - 1-1, 1-many, many-many Satellites Instruments Measurements Missions Manufacturers
  • 8. ©2015 Couchbase Inc. 8 Physical Data Model
  • 9. ©2015 Couchbase Inc. 9 Physical Data Model  Phase II – Map entities, attributes and their relationships to containers provided by the underlying database solution Relational Databases Couchbase Server Databases Buckets Tables Documents with type designator attributeOR Buckets Rows Items (Key-Value or Key-Document) Columns Attributes Index Index
  • 10. ©2015 Couchbase Inc. 10 Physical Data Modeling  Entities > Buckets, Keys & Items – Buckets: group of items with controls for HA, Security and Computational Resources • Replica count, compaction schedule, RAM quota and more – Keys: unique identifier for instances of the entity • Composite or Surrogate – Items • JSON Documents with Attributes:  Basic types: bool, string, numeric, date or array of these types  Embedded JSON Documents or array of embedded of these types • BinaryValues:  Anything up to 20MB
  • 11. ©2015 Couchbase Inc. 11 Remember our logical data modeling? Satellites Instruments Measurements Missions Manufacturers
  • 12. ©2015 Couchbase Inc. 12 Physical Data Modeling  Physical Data Model Satellites { “name”:…, “route”:…, “missions”:[ {“name”:“launch”, “date”:…,}, {“name”:”repair-1”, “date”:…,} …], “instruments”:[ {“id”:“camera_01”}, {“id”:”altimeter_01”}, …], “manufacturer”:{ “name”:”Boeing”, “city”:”Seattle”,…}, … } Instruments { “id”:”camera_01”, “manufacturer”:{ “name”:”Boeing”, “city”:”Seattle”,…}, …} InstrumentIDs Measurements { “instrument_ id”:”altimeter_01”, “satellite_name”:…, “date_time”:…, “location”:{ “lat”:…,“long”:…}, “measurement”:… …} ManufacturerMissions
  • 13. ©2015 Couchbase Inc. 13 Embedding vs Referencing  Embed When – Both docs are frequently access together. – You need strict consistency between both docs.  ReferenceWhen – Both docs aren’t frequently access together. – You need strict consistency for the referenced information – Need to optimize for performance and referenced doc is large
  • 14. ©2015 Couchbase Inc. 14 References: SQL JOINs with Couchbase Server 4.0  Note: References are flexible in N1QL SELECT AVG(m.measurement),… FROM Measurements m JOIN Satellites s ON KEYS m.satellite_name WHERE m.date_time BETWEEN … AND NOW();
  • 15. ©2015 Couchbase Inc. 15 Relationships  1-1 – Embed Example: Satellite and Manufacturer  1-Many – Embed Example: Satellite and Missions – Reference Example: Satellite and Instruments  Many-Many – Reference Example: Satellite and Measurements
  • 16. ©2015 Couchbase Inc. 16 Evolving Data Models
  • 17. ©2015 Couchbase Inc. 17 Evolving Data Models Change your apps code and you are good to go!  Schema is App Driven in Couchbase Server – OK to maintain multiple versions of the schema  Schema Changes with Couchbase Server – No Explicit Server Action Required by DBA – No Downtime required to update existing data to new shape
  • 18. ©2015 Couchbase Inc. 18 Recap  Couchbase Server support key-value and document based data modeling natively.  Model data in 2 phases – Logical data model – Physical data model • Embed vs Reference  Evolve your Schema without pain
  • 19. Get Started with Couchbase Server 4.0 - Couchbase.com/Downloads Q&A Cihan Biyikoglu | cihan@couchbase.com | @cihangirb