SlideShare a Scribd company logo
1 of 34
NoSQL
A closer look to couchbase
Agenda
Introduction to database design
Data Structures
Relational Databases Vs. NoSQL
Databases
Couchbase Conflicts
Couchbase performance
Introduction to database
design
Database Design
A good database design is:
Divides your information into subject-
based tables to reduce redundant data.
Provides Access with the information it
requires to join the information in the
tables together as needed.
Can handle your data processing and
reporting needs.
Database Design
(cont’d)The design process consists of the following steps:
1. Determine the purpose of your database
This helps prepare you for the remaining steps.
2. Find and organize the information required
Gather all of the types of information you might want to
record in the database, such as product name and order
number.
3. Divide the information into tables
Divide your information items into major entities or
subjects, such as Products or Orders. Each subject then
becomes a table.
Database Design
(cont’d)4. Turn information items into columns
Decide what information you want to store in each table. Each item
becomes a field, and is displayed as a column in the table. For
example, an Employees table might include fields such as Last
Name and Hire Date.
5. Specify primary keys
Choose each table’s primary key. The primary key is a column that is
used to uniquely identify each row. An example might be Product ID
or Order ID.
6. Set up the table relationships
Look at each table and decide how the data in one table is related to
the data in other tables. Add fields to tables or create new tables to
clarify the relationships, as necessary.
Database Design
(cont’d)
7. Refine your design
Analyze your design for errors. Create the tables and add a few
records of sample data. See if you can get the results you want
from your tables. Make adjustments to the design, as needed.
8. Apply the normalization rules
Database normalization (or normalisation) is the process of
organizing the columns (attributes) and tables (relations) of a
relational database to minimize data redundancy.
The objective is to isolate data so that additions, deletions, and
modifications of an attribute can be made in just one table and
then propagated through the rest of the database using the
defined foreign keys.
Database Design
(cont’d)
Simple MySQL Demo
Data Structures
Data Structures
In computer science, a data structure is a
particular way of organising data in a computer so
that it can be used efficiently.
Data Structures examples:
Primitive types (Boolean, Character, Double,
Integer …)
Composite types (Array …)
Abstract data types (List, Set, Stack, Queue,
Tree ...)
Big-O Notation
Big O notation is used in Computer
Science to describe the performance
or complexity of an algorithm.
Big O specifically describes the
worst-case scenario, and can be
used to describe the execution time
required or the space used (e.g. in
memory or on disk) by an algorithm.
Big-O Notation (cont’d)
Array
Access element
Search for element (IndexOf)
Insert element
Delete element
Linked list
Normal Sort
Hash
Big-O Notation (cont’d)
Relational Databases Vs.
NoSQL Databases
NoSQL Vs. RDBMS
NoSQL Vs. RDBMS is like comparing
Manual to Automatic
NoSQL Vs. RDBMS
(cont’d)
Schema
NoSQL Vs. RDBMS
(cont’d)
RDBMS Relations
NoSQL Vs. RDBMS
(cont’d)
NoSQL Relations
NoSQL Vs. RDBMS
(cont’d)
Layers Structure
NoSQL Vs. RDBMS
(cont’d)
NoSQL RDBMS
Database Database
View Table
Document Row
NoSQL Vs. RDBMS
(cont’d)
What is the main difference between
RDMS and NoSQL?
Couchbase
Conflicts
Conflict Example
Product Owner & Scrum Master
Couchbase Conflicts
Molly creates DocumentA; the revision is 1-5ac
DocumentA is synced to Naomi's device; the latest
revision is still 1-5ac
Molly updates DocumentA, creating revision 2-54a
Naomi makes a different change to DocumentA,
creating revision 2-877
Revision 2-877 is synced to Molly's device, which
already has 2-54a, putting the document in conflict
Revision 2-54a is synced to Naomi's device, which
already has 2-877, similarly putting the local
document in conflict
Couchbase Conflicts
What if both devices make the same
change to the document? Is that a
conflict?
No. The revision ID is derived from
a digest of the document body. So if
two databases save identical
changes, they end up with identical
revision IDs, and Couchbase Lite
(and the Sync Gateway) treat these
as the same revision.
Couchbase
Performance
Couchbase
Performance
“A well-designed SQL database will
almost certainly perform better than a
badly designed NoSQL equivalent
and vice versa.”
Couchbase Performance
(cont’d)
Couchbase Performance
(cont’d)
Couchbase
Performance (cont’d)There are few main variables that can impact
application performance which you can help control
and manage:
Getting cluster sizing correct for your application
load
Structuring documents for efficient reads/writes
Using SDK methods which are more efficient for
the operation you want to perform
Optimize your use of Couchbase client
connections
Structuring documents
Structuring documents for efficient
reads/writes
Effective (adj.) – Adequate to
accomplish a purpose; producing the
intended or expected result.
Efficient (adj.) – Performing or
functioning in the best possible
manner with the least waste of time
and effort.
Good document
structure{
"board_id": 222
"leader_board": "best
selling"
"top_sales" : [ "beer_id" :
75623,
"beer_id" : 98756,
"beer_id" : 2938,
"beer_id" : 49283,
"beer_id" :
204857,
"beer_id" : 12345
],
"updated": "2010-07-22
20:00:20"
}
{
"beer_id" : 75623,
"name" : "Pleny the
Felder"
"type" : "wheat",
"aroma" : "wheaty",
"category": "koelsch",
"units_sold": 37011,
"brewery" :
”brewery_Legacy_Brewin
g_Co”
}
Better document
structure
{
"board_id": 222
"leader_board": "best selling"
"top_sales" : [
{ "beer_id" : 75623, "units_sold":37011, "name": "Pleny the
Felder" },
{ "beer_id" : 98756, "units_sold": 23002, "name": "Sub-
Hoptimus" },
{ "beer_id" : 2938, "units_sold": 23001, "name": "Speckled
Hen" },
{ "beer_id" : 49283, "units_sold": 11023, "name": "Happy
Hops" },
{ "beer_id" : 204857, "units_sold": 9856, "name": "Bruxulle
Rouge" },
{ "beer_id" : 12345, "units_sold": 7654, "name": "Plums
Pilsner" }
],
"updated": "2010-07-22 20:00:20"
NoSQL - A Closer Look to Couchbase

More Related Content

What's hot

Introduction to Database Concepts
Introduction to Database ConceptsIntroduction to Database Concepts
Introduction to Database Concepts
Rosalyn Lemieux
 

What's hot (18)

Choosing your NoSQL storage
Choosing your NoSQL storageChoosing your NoSQL storage
Choosing your NoSQL storage
 
Bigtable_Paper
Bigtable_PaperBigtable_Paper
Bigtable_Paper
 
Database Basics
Database BasicsDatabase Basics
Database Basics
 
Database fundamentals
Database fundamentalsDatabase fundamentals
Database fundamentals
 
Spot db consistency checking and optimization in spatial database
Spot db  consistency checking and optimization in spatial databaseSpot db  consistency checking and optimization in spatial database
Spot db consistency checking and optimization in spatial database
 
Abap data dictionary
Abap data dictionaryAbap data dictionary
Abap data dictionary
 
T3
T3T3
T3
 
CBSE XII Database Concepts And MySQL Presentation
CBSE XII Database Concepts And MySQL PresentationCBSE XII Database Concepts And MySQL Presentation
CBSE XII Database Concepts And MySQL Presentation
 
Chapter 8(designing of documnt databases)no sql for mere mortals
Chapter 8(designing of documnt databases)no sql for mere mortalsChapter 8(designing of documnt databases)no sql for mere mortals
Chapter 8(designing of documnt databases)no sql for mere mortals
 
Introduction to Database Concepts
Introduction to Database ConceptsIntroduction to Database Concepts
Introduction to Database Concepts
 
Database management system chapter1
Database management system chapter1Database management system chapter1
Database management system chapter1
 
Transaction
TransactionTransaction
Transaction
 
Introduction to database & sql
Introduction to database & sqlIntroduction to database & sql
Introduction to database & sql
 
Module 2
Module 2Module 2
Module 2
 
Discover database
Discover databaseDiscover database
Discover database
 
Brief introduction to NoSQL by fas mosleh
Brief introduction to NoSQL by fas moslehBrief introduction to NoSQL by fas mosleh
Brief introduction to NoSQL by fas mosleh
 
What is difference between dbms and rdbms
What is difference between dbms and rdbmsWhat is difference between dbms and rdbms
What is difference between dbms and rdbms
 
A STUDY ON GRAPH STORAGE DATABASE OF NOSQL
A STUDY ON GRAPH STORAGE DATABASE OF NOSQLA STUDY ON GRAPH STORAGE DATABASE OF NOSQL
A STUDY ON GRAPH STORAGE DATABASE OF NOSQL
 

Similar to NoSQL - A Closer Look to Couchbase

Relational database was proposed by Edgar Codd (of IBM Research) aro.pdf
Relational database was proposed by Edgar Codd (of IBM Research) aro.pdfRelational database was proposed by Edgar Codd (of IBM Research) aro.pdf
Relational database was proposed by Edgar Codd (of IBM Research) aro.pdf
APMRETAIL
 

Similar to NoSQL - A Closer Look to Couchbase (20)

Azure Data Fundamentals DP 900 Full Course
Azure Data Fundamentals DP 900 Full CourseAzure Data Fundamentals DP 900 Full Course
Azure Data Fundamentals DP 900 Full Course
 
Relational database was proposed by Edgar Codd (of IBM Research) aro.pdf
Relational database was proposed by Edgar Codd (of IBM Research) aro.pdfRelational database was proposed by Edgar Codd (of IBM Research) aro.pdf
Relational database was proposed by Edgar Codd (of IBM Research) aro.pdf
 
Bank mangement system
Bank mangement systemBank mangement system
Bank mangement system
 
Big data technology unit 3
Big data technology unit 3Big data technology unit 3
Big data technology unit 3
 
PPT SQL CLASS.pptx
PPT SQL CLASS.pptxPPT SQL CLASS.pptx
PPT SQL CLASS.pptx
 
Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005
 
Introduction to database with ms access(DBMS)
Introduction to database with ms access(DBMS)Introduction to database with ms access(DBMS)
Introduction to database with ms access(DBMS)
 
nosql.pptx
nosql.pptxnosql.pptx
nosql.pptx
 
Module02
Module02Module02
Module02
 
A Review of Data Access Optimization Techniques in a Distributed Database Man...
A Review of Data Access Optimization Techniques in a Distributed Database Man...A Review of Data Access Optimization Techniques in a Distributed Database Man...
A Review of Data Access Optimization Techniques in a Distributed Database Man...
 
A Review of Data Access Optimization Techniques in a Distributed Database Man...
A Review of Data Access Optimization Techniques in a Distributed Database Man...A Review of Data Access Optimization Techniques in a Distributed Database Man...
A Review of Data Access Optimization Techniques in a Distributed Database Man...
 
Whats New Sql Server 2008 R2 Cw
Whats New Sql Server 2008 R2 CwWhats New Sql Server 2008 R2 Cw
Whats New Sql Server 2008 R2 Cw
 
Whats New Sql Server 2008 R2
Whats New Sql Server 2008 R2Whats New Sql Server 2008 R2
Whats New Sql Server 2008 R2
 
database.pdf
database.pdfdatabase.pdf
database.pdf
 
Mongo Bb - NoSQL tutorial
Mongo Bb - NoSQL tutorialMongo Bb - NoSQL tutorial
Mongo Bb - NoSQL tutorial
 
T-SQL Overview
T-SQL OverviewT-SQL Overview
T-SQL Overview
 
Artifacts, Data Dictionary, Data Modeling, Data Wrangling
Artifacts, Data Dictionary, Data Modeling, Data WranglingArtifacts, Data Dictionary, Data Modeling, Data Wrangling
Artifacts, Data Dictionary, Data Modeling, Data Wrangling
 
Cassandra data modelling best practices
Cassandra data modelling best practicesCassandra data modelling best practices
Cassandra data modelling best practices
 
Oracle DBA Tutorial for Beginners -Oracle training institute in bangalore
Oracle DBA Tutorial for Beginners -Oracle training institute in bangaloreOracle DBA Tutorial for Beginners -Oracle training institute in bangalore
Oracle DBA Tutorial for Beginners -Oracle training institute in bangalore
 
MIS5101 WK10 Outcome Measures
MIS5101 WK10 Outcome MeasuresMIS5101 WK10 Outcome Measures
MIS5101 WK10 Outcome Measures
 

More from Mohammad Shaker (11)

Android Development - Session 5
Android Development - Session 5Android Development - Session 5
Android Development - Session 5
 
Android Development - Session 4
Android Development - Session 4Android Development - Session 4
Android Development - Session 4
 
Android Development - Session 2
Android Development - Session 2Android Development - Session 2
Android Development - Session 2
 
Android Development - Session 1
Android Development - Session 1Android Development - Session 1
Android Development - Session 1
 
Introduction to Qt
Introduction to QtIntroduction to Qt
Introduction to Qt
 
OOP - STL
OOP - STLOOP - STL
OOP - STL
 
OOP - Templates
OOP - TemplatesOOP - Templates
OOP - Templates
 
OOP - Introduction to Inheritance
OOP - Introduction to InheritanceOOP - Introduction to Inheritance
OOP - Introduction to Inheritance
 
OOP - Friend Functions
OOP - Friend FunctionsOOP - Friend Functions
OOP - Friend Functions
 
OOP - Introduction
OOP - IntroductionOOP - Introduction
OOP - Introduction
 
Introduction to Couchbase
Introduction to CouchbaseIntroduction to Couchbase
Introduction to Couchbase
 

Recently uploaded

The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Recently uploaded (20)

The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 

NoSQL - A Closer Look to Couchbase

  • 1. NoSQL A closer look to couchbase
  • 2. Agenda Introduction to database design Data Structures Relational Databases Vs. NoSQL Databases Couchbase Conflicts Couchbase performance
  • 4. Database Design A good database design is: Divides your information into subject- based tables to reduce redundant data. Provides Access with the information it requires to join the information in the tables together as needed. Can handle your data processing and reporting needs.
  • 5. Database Design (cont’d)The design process consists of the following steps: 1. Determine the purpose of your database This helps prepare you for the remaining steps. 2. Find and organize the information required Gather all of the types of information you might want to record in the database, such as product name and order number. 3. Divide the information into tables Divide your information items into major entities or subjects, such as Products or Orders. Each subject then becomes a table.
  • 6. Database Design (cont’d)4. Turn information items into columns Decide what information you want to store in each table. Each item becomes a field, and is displayed as a column in the table. For example, an Employees table might include fields such as Last Name and Hire Date. 5. Specify primary keys Choose each table’s primary key. The primary key is a column that is used to uniquely identify each row. An example might be Product ID or Order ID. 6. Set up the table relationships Look at each table and decide how the data in one table is related to the data in other tables. Add fields to tables or create new tables to clarify the relationships, as necessary.
  • 7. Database Design (cont’d) 7. Refine your design Analyze your design for errors. Create the tables and add a few records of sample data. See if you can get the results you want from your tables. Make adjustments to the design, as needed. 8. Apply the normalization rules Database normalization (or normalisation) is the process of organizing the columns (attributes) and tables (relations) of a relational database to minimize data redundancy. The objective is to isolate data so that additions, deletions, and modifications of an attribute can be made in just one table and then propagated through the rest of the database using the defined foreign keys.
  • 10. Data Structures In computer science, a data structure is a particular way of organising data in a computer so that it can be used efficiently. Data Structures examples: Primitive types (Boolean, Character, Double, Integer …) Composite types (Array …) Abstract data types (List, Set, Stack, Queue, Tree ...)
  • 11. Big-O Notation Big O notation is used in Computer Science to describe the performance or complexity of an algorithm. Big O specifically describes the worst-case scenario, and can be used to describe the execution time required or the space used (e.g. in memory or on disk) by an algorithm.
  • 12. Big-O Notation (cont’d) Array Access element Search for element (IndexOf) Insert element Delete element Linked list Normal Sort Hash
  • 15. NoSQL Vs. RDBMS NoSQL Vs. RDBMS is like comparing Manual to Automatic
  • 20. NoSQL Vs. RDBMS (cont’d) NoSQL RDBMS Database Database View Table Document Row
  • 21. NoSQL Vs. RDBMS (cont’d) What is the main difference between RDMS and NoSQL?
  • 24. Couchbase Conflicts Molly creates DocumentA; the revision is 1-5ac DocumentA is synced to Naomi's device; the latest revision is still 1-5ac Molly updates DocumentA, creating revision 2-54a Naomi makes a different change to DocumentA, creating revision 2-877 Revision 2-877 is synced to Molly's device, which already has 2-54a, putting the document in conflict Revision 2-54a is synced to Naomi's device, which already has 2-877, similarly putting the local document in conflict
  • 25. Couchbase Conflicts What if both devices make the same change to the document? Is that a conflict? No. The revision ID is derived from a digest of the document body. So if two databases save identical changes, they end up with identical revision IDs, and Couchbase Lite (and the Sync Gateway) treat these as the same revision.
  • 27. Couchbase Performance “A well-designed SQL database will almost certainly perform better than a badly designed NoSQL equivalent and vice versa.”
  • 30. Couchbase Performance (cont’d)There are few main variables that can impact application performance which you can help control and manage: Getting cluster sizing correct for your application load Structuring documents for efficient reads/writes Using SDK methods which are more efficient for the operation you want to perform Optimize your use of Couchbase client connections
  • 31. Structuring documents Structuring documents for efficient reads/writes Effective (adj.) – Adequate to accomplish a purpose; producing the intended or expected result. Efficient (adj.) – Performing or functioning in the best possible manner with the least waste of time and effort.
  • 32. Good document structure{ "board_id": 222 "leader_board": "best selling" "top_sales" : [ "beer_id" : 75623, "beer_id" : 98756, "beer_id" : 2938, "beer_id" : 49283, "beer_id" : 204857, "beer_id" : 12345 ], "updated": "2010-07-22 20:00:20" } { "beer_id" : 75623, "name" : "Pleny the Felder" "type" : "wheat", "aroma" : "wheaty", "category": "koelsch", "units_sold": 37011, "brewery" : ”brewery_Legacy_Brewin g_Co” }
  • 33. Better document structure { "board_id": 222 "leader_board": "best selling" "top_sales" : [ { "beer_id" : 75623, "units_sold":37011, "name": "Pleny the Felder" }, { "beer_id" : 98756, "units_sold": 23002, "name": "Sub- Hoptimus" }, { "beer_id" : 2938, "units_sold": 23001, "name": "Speckled Hen" }, { "beer_id" : 49283, "units_sold": 11023, "name": "Happy Hops" }, { "beer_id" : 204857, "units_sold": 9856, "name": "Bruxulle Rouge" }, { "beer_id" : 12345, "units_sold": 7654, "name": "Plums Pilsner" } ], "updated": "2010-07-22 20:00:20"