Version Stamps in NOSQL Databases

Dr-Dipali Meher
Dr-Dipali MeherAssistant Professor à Modern College, Ganeshkhind, Pune 16
Version Stamps
Dr. Dipali Meher
MCS, M.Phil,NET, Ph.D
Assistant Professor
Modern College of Arts Science and Commerce, Ganeshkhind, Pune 16
mailtomeher@gmail.com
Agenda
 Business and System Transactions
 Version Stamps on Multiple Nodes
Collected by Dr. Dipali Meher
Source: NoSQL Distilled:
Introduction
 Lack of transaction in NoSQL
database. But they have
aggregates
 Basically transactions are useful
tool for programmers to support
consistency
Aggregate oriented NoSQL
DB support atomic updates
with aggregates.
Transactional needs are
something to take into
account when you decide
what database to use.
But transactions have
limitations
In transactional system user
has to deal with updates with
human intervention which may
hold the transaction too long.
 Above is done using Version
Stamps
Collected by Dr. Dipali Meher
Source NoSQL Distilled by
Business & System Transactions
Business Transaction: A business transaction may be something like
 Browsing a product catalog
 Choosing a bottle of Milton at a good price,
 Filling in credit card information, and
 Confirming the order
Locks are held for short period of time.
Collected by Dr. Dipali Meher
Source NoSQL Distilled
System Transactions
System Transaction: applications only begin a system transaction at
the end of the interaction with the user.
Locks are held for short period of time.
Collected by Dr. Dipali Meher
Source NoSQL Distilled
As locks are held for long period of time in business transactions and
short period of time in system transactions…
so calculations and decisions may have been made based on data
that’s changed.
Queries should be fired according to changes in data.
Example:
price list may have updated the price of the Milton,
updated the customer’s address,
changing the shipping charges.
Collected by Dr. Dipali Meher
Source NoSQL Distilled
Version Stamp
A field that changes every time the underlying data in
the record changes.
When you read the data you keep a note of the version
stamp, so that when you write data you can check to
see if the version has changed.
Collected by Dr. Dipali Meher
Source NoSQL Distilled
Example Version Stamps
updating resources with HTTP using etag system
Whenever you get a resource, the server responds with an etag in
the header.
etag(opaque string that indicates the version of the resource)
If you then update that resource, you can use a conditional
update by supplying the etag that you got from your last GET.
If the resource has changed on the server, the etags won’t match
and the server will refuse the update,
returning a 412 (Precondition Failed) response.
Collected by Dr. Dipali Meher
Source NoSQL Distilled by
Ways of creating Version Stamps
Counter GUID hash Timestamp
You can use
a counter
always
incrementing
it when you
update the
resource.
A large
random
number
that’s
guaranteed
to be unique.
hash of the
contents of
the
resource
timestamp
of the last
update
Collected by Dr. Dipali Meher
Source NoSQL Distilled
Ways of creating Version Stamps
Counter
You can use a counter always incrementing it when you
update the resource.
Counters are useful since they make it easy to tell if one
version is more recent than another.
They require the server to generate the counter value,
They need a single master to ensure the counters aren’t
duplicated.
Collected by Dr. Dipali Meher
Source NoSQL Distilled
Ways of creating Version Stamps
GUID
 A large random number that’s guaranteed to be unique.
 These use some combination of dates, hardware
information, and whatever other sources of randomness
they can pick up.
 The nice thing about GUIDs is that they can be generated
by anyone and you’ll never get a duplicate;
 A disadvantage is that they are large and can’t be
compared directly for recentness.
Collected by Dr. Dipali Meher
Source NoSQL Distilled
Ways of creating Version Stamps
Hash
 To make a hash of the contents of the resource.
 With a big enough hash key size, a content hash can be
globally unique like a GUID
 Generated by anyone
 Advantage: deterministic any node will generate the same
content hash for same resource data.
 Disadvantages: like GUIDs they can’t be directly compared
for recentness, and they can be lengthy.
Collected by Dr. Dipali Meher
Source NoSQL Distilled
Ways of creating Version Stamps
Timestamp
 To use the timestamp of the last update
 Like counters, they are reasonably short and can be directly
compared for recentness.
 Advantage: doesnot need a single master, Multiple machines can
generate timestamps( their clocks can be kep in synchronization
way)
 Disadvantage :One node with a bad clock can cause all sorts of
data corruptions.
too granular you can get duplicates i.e. it’s no good using timestamps
of a millisecond precision if you get many updates per millisecond.
Collected by Dr. Dipali Meher
Source NoSQL Distilled
blend the advantages of these different version stamp
schemes by using more than one of them to create a
composite stamp example CouchDB uses a combination of
counter and content hash.
version stamps are also useful for providing
Session consistency
1 sur 14

Recommandé

Consistency in NoSQLConsistency in NoSQL
Consistency in NoSQLDr-Dipali Meher
3.9K vues51 diapositives
Data models in NoSQLData models in NoSQL
Data models in NoSQLDr-Dipali Meher
953 vues29 diapositives
Polyglot Persistence Polyglot Persistence
Polyglot Persistence Dr-Dipali Meher
1.9K vues64 diapositives
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQLDr-Dipali Meher
2.2K vues72 diapositives

Contenu connexe

Tendances

Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBRavi Teja
53.4K vues20 diapositives
Nosql-Module 1 PPT.pptxNosql-Module 1 PPT.pptx
Nosql-Module 1 PPT.pptxRadhika R
339 vues94 diapositives
Apache HBase™Apache HBase™
Apache HBase™Prashant Gupta
3.7K vues58 diapositives
NOSQL- Presentation on NoSQLNOSQL- Presentation on NoSQL
NOSQL- Presentation on NoSQLRamakant Soni
28.1K vues18 diapositives
Key-Value NoSQL DatabaseKey-Value NoSQL Database
Key-Value NoSQL DatabaseHeman Hosainpana
2.9K vues33 diapositives

Tendances(20)

Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Ravi Teja53.4K vues
Nosql-Module 1 PPT.pptxNosql-Module 1 PPT.pptx
Nosql-Module 1 PPT.pptx
Radhika R339 vues
Apache HBase™Apache HBase™
Apache HBase™
Prashant Gupta3.7K vues
NOSQL- Presentation on NoSQLNOSQL- Presentation on NoSQL
NOSQL- Presentation on NoSQL
Ramakant Soni28.1K vues
Key-Value NoSQL DatabaseKey-Value NoSQL Database
Key-Value NoSQL Database
Heman Hosainpana2.9K vues
Distributed databaseDistributed database
Distributed database
ReachLocal Services India63.8K vues
Basics of MongoDB Basics of MongoDB
Basics of MongoDB
Habilelabs2.6K vues
NoSQL databases - An introductionNoSQL databases - An introduction
NoSQL databases - An introduction
Pooyan Mehrparvar4.9K vues
Complete dbms notesComplete dbms notes
Complete dbms notes
Tanya Makkar10K vues
Text MIningText MIning
Text MIning
Prakhyath Rai19.5K vues
BIG DATA and USE CASESBIG DATA and USE CASES
BIG DATA and USE CASES
Bhaskara Reddy Sannapureddy6.1K vues
Hadoop File system (HDFS)Hadoop File system (HDFS)
Hadoop File system (HDFS)
Prashant Gupta8.4K vues
MongoDBMongoDB
MongoDB
nikhil28078.6K vues
Introduction to mongodbIntroduction to mongodb
Introduction to mongodb
neela madheswari553 vues
Hive(ppt)Hive(ppt)
Hive(ppt)
Abhinav Tyagi15.4K vues
Hadoop MapReduce FundamentalsHadoop MapReduce Fundamentals
Hadoop MapReduce Fundamentals
Lynn Langit133.9K vues
OLAP & DATA WAREHOUSEOLAP & DATA WAREHOUSE
OLAP & DATA WAREHOUSE
Zalpa Rathod73.1K vues
SQL & NoSQLSQL & NoSQL
SQL & NoSQL
Ahmad Awsaf-uz-zaman1.6K vues

Similaire à Version Stamps in NOSQL Databases(20)

Plus de Dr-Dipali Meher

DataPreprocessing.pptxDataPreprocessing.pptx
DataPreprocessing.pptxDr-Dipali Meher
260 vues33 diapositives
Literature ReviewLiterature Review
Literature ReviewDr-Dipali Meher
84 vues21 diapositives
Research ProblemResearch Problem
Research ProblemDr-Dipali Meher
128 vues15 diapositives
Types of ResearchTypes of Research
Types of ResearchDr-Dipali Meher
166 vues23 diapositives

Plus de Dr-Dipali Meher(11)

DataPreprocessing.pptxDataPreprocessing.pptx
DataPreprocessing.pptx
Dr-Dipali Meher260 vues
Literature ReviewLiterature Review
Literature Review
Dr-Dipali Meher84 vues
Research ProblemResearch Problem
Research Problem
Dr-Dipali Meher128 vues
Formulation of Research DesignFormulation of Research Design
Formulation of Research Design
Dr-Dipali Meher620 vues
Types of ResearchTypes of Research
Types of Research
Dr-Dipali Meher166 vues
Research Methodology-IntorductionResearch Methodology-Intorduction
Research Methodology-Intorduction
Dr-Dipali Meher227 vues
Introduction to ResearchIntroduction to Research
Introduction to Research
Dr-Dipali Meher777 vues
Schema migrations in no sqlSchema migrations in no sql
Schema migrations in no sql
Dr-Dipali Meher473 vues
Naive bayesian classificationNaive bayesian classification
Naive bayesian classification
Dr-Dipali Meher19.6K vues
Data mining an introductionData mining an introduction
Data mining an introduction
Dr-Dipali Meher7.9K vues
Function PointerFunction Pointer
Function Pointer
Dr-Dipali Meher2.4K vues

Dernier(20)

Material del tarjetero LEES Travesías.docxMaterial del tarjetero LEES Travesías.docx
Material del tarjetero LEES Travesías.docx
Norberto Millán Muñoz57 vues
GSoC 2024GSoC 2024
GSoC 2024
DeveloperStudentClub1049 vues
Drama KS5 BreakdownDrama KS5 Breakdown
Drama KS5 Breakdown
WestHatch50 vues
ACTIVITY BOOK key water sports.pptxACTIVITY BOOK key water sports.pptx
ACTIVITY BOOK key water sports.pptx
Mar Caston Palacio132 vues
Gopal Chakraborty Memorial Quiz 2.0 Prelims.pptxGopal Chakraborty Memorial Quiz 2.0 Prelims.pptx
Gopal Chakraborty Memorial Quiz 2.0 Prelims.pptx
Debapriya Chakraborty221 vues
Education and Diversity.pptxEducation and Diversity.pptx
Education and Diversity.pptx
DrHafizKosar56 vues
2022 CAPE Merit List 2023 2022 CAPE Merit List 2023
2022 CAPE Merit List 2023
Caribbean Examinations Council3K vues
Plastic waste.pdfPlastic waste.pdf
Plastic waste.pdf
alqaseedae81 vues
Lecture: Open InnovationLecture: Open Innovation
Lecture: Open Innovation
Michal Hron82 vues
STERILITY TEST.pptxSTERILITY TEST.pptx
STERILITY TEST.pptx
Anupkumar Sharma102 vues
Industry4wrd.pptxIndustry4wrd.pptx
Industry4wrd.pptx
BC Chew153 vues
Narration  ppt.pptxNarration  ppt.pptx
Narration ppt.pptx
Tariq KHAN62 vues
Structure and Functions of Cell.pdfStructure and Functions of Cell.pdf
Structure and Functions of Cell.pdf
Nithya Murugan142 vues
Scope of Biochemistry.pptxScope of Biochemistry.pptx
Scope of Biochemistry.pptx
shoba shoba110 vues
Psychology KS5Psychology KS5
Psychology KS5
WestHatch53 vues
Azure DevOps Pipeline setup for Mule APIs #36Azure DevOps Pipeline setup for Mule APIs #36
Azure DevOps Pipeline setup for Mule APIs #36
MysoreMuleSoftMeetup75 vues

Version Stamps in NOSQL Databases

  • 1. Version Stamps Dr. Dipali Meher MCS, M.Phil,NET, Ph.D Assistant Professor Modern College of Arts Science and Commerce, Ganeshkhind, Pune 16 mailtomeher@gmail.com
  • 2. Agenda  Business and System Transactions  Version Stamps on Multiple Nodes
  • 3. Collected by Dr. Dipali Meher Source: NoSQL Distilled: Introduction  Lack of transaction in NoSQL database. But they have aggregates  Basically transactions are useful tool for programmers to support consistency Aggregate oriented NoSQL DB support atomic updates with aggregates. Transactional needs are something to take into account when you decide what database to use. But transactions have limitations In transactional system user has to deal with updates with human intervention which may hold the transaction too long.  Above is done using Version Stamps
  • 4. Collected by Dr. Dipali Meher Source NoSQL Distilled by Business & System Transactions Business Transaction: A business transaction may be something like  Browsing a product catalog  Choosing a bottle of Milton at a good price,  Filling in credit card information, and  Confirming the order Locks are held for short period of time.
  • 5. Collected by Dr. Dipali Meher Source NoSQL Distilled System Transactions System Transaction: applications only begin a system transaction at the end of the interaction with the user. Locks are held for short period of time.
  • 6. Collected by Dr. Dipali Meher Source NoSQL Distilled As locks are held for long period of time in business transactions and short period of time in system transactions… so calculations and decisions may have been made based on data that’s changed. Queries should be fired according to changes in data. Example: price list may have updated the price of the Milton, updated the customer’s address, changing the shipping charges.
  • 7. Collected by Dr. Dipali Meher Source NoSQL Distilled Version Stamp A field that changes every time the underlying data in the record changes. When you read the data you keep a note of the version stamp, so that when you write data you can check to see if the version has changed.
  • 8. Collected by Dr. Dipali Meher Source NoSQL Distilled Example Version Stamps updating resources with HTTP using etag system Whenever you get a resource, the server responds with an etag in the header. etag(opaque string that indicates the version of the resource) If you then update that resource, you can use a conditional update by supplying the etag that you got from your last GET. If the resource has changed on the server, the etags won’t match and the server will refuse the update, returning a 412 (Precondition Failed) response.
  • 9. Collected by Dr. Dipali Meher Source NoSQL Distilled by Ways of creating Version Stamps Counter GUID hash Timestamp You can use a counter always incrementing it when you update the resource. A large random number that’s guaranteed to be unique. hash of the contents of the resource timestamp of the last update
  • 10. Collected by Dr. Dipali Meher Source NoSQL Distilled Ways of creating Version Stamps Counter You can use a counter always incrementing it when you update the resource. Counters are useful since they make it easy to tell if one version is more recent than another. They require the server to generate the counter value, They need a single master to ensure the counters aren’t duplicated.
  • 11. Collected by Dr. Dipali Meher Source NoSQL Distilled Ways of creating Version Stamps GUID  A large random number that’s guaranteed to be unique.  These use some combination of dates, hardware information, and whatever other sources of randomness they can pick up.  The nice thing about GUIDs is that they can be generated by anyone and you’ll never get a duplicate;  A disadvantage is that they are large and can’t be compared directly for recentness.
  • 12. Collected by Dr. Dipali Meher Source NoSQL Distilled Ways of creating Version Stamps Hash  To make a hash of the contents of the resource.  With a big enough hash key size, a content hash can be globally unique like a GUID  Generated by anyone  Advantage: deterministic any node will generate the same content hash for same resource data.  Disadvantages: like GUIDs they can’t be directly compared for recentness, and they can be lengthy.
  • 13. Collected by Dr. Dipali Meher Source NoSQL Distilled Ways of creating Version Stamps Timestamp  To use the timestamp of the last update  Like counters, they are reasonably short and can be directly compared for recentness.  Advantage: doesnot need a single master, Multiple machines can generate timestamps( their clocks can be kep in synchronization way)  Disadvantage :One node with a bad clock can cause all sorts of data corruptions. too granular you can get duplicates i.e. it’s no good using timestamps of a millisecond precision if you get many updates per millisecond.
  • 14. Collected by Dr. Dipali Meher Source NoSQL Distilled blend the advantages of these different version stamp schemes by using more than one of them to create a composite stamp example CouchDB uses a combination of counter and content hash. version stamps are also useful for providing Session consistency