Version Stamps in NOSQL Databases

Dr-Dipali Meher
Dr-Dipali MeherAssistant Professor em 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 de 14

Recomendados

Introduction to NoSQL por
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQLDr-Dipali Meher
2.2K visualizações72 slides
Consistency in NoSQL por
Consistency in NoSQLConsistency in NoSQL
Consistency in NoSQLDr-Dipali Meher
3.9K visualizações51 slides
Data models in NoSQL por
Data models in NoSQLData models in NoSQL
Data models in NoSQLDr-Dipali Meher
978 visualizações29 slides
Polyglot Persistence por
Polyglot Persistence Polyglot Persistence
Polyglot Persistence Dr-Dipali Meher
1.9K visualizações64 slides
SQL/NoSQL How to choose ? por
SQL/NoSQL How to choose ?SQL/NoSQL How to choose ?
SQL/NoSQL How to choose ?Venu Anuganti
50.6K visualizações43 slides
Schema migrations in no sql por
Schema migrations in no sqlSchema migrations in no sql
Schema migrations in no sqlDr-Dipali Meher
479 visualizações31 slides

Mais conteúdo relacionado

Mais procurados

NoSQL Data Architecture Patterns por
NoSQL Data ArchitecturePatternsNoSQL Data ArchitecturePatterns
NoSQL Data Architecture PatternsMaynooth University
4.1K visualizações62 slides
NOSQL- Presentation on NoSQL por
NOSQL- Presentation on NoSQLNOSQL- Presentation on NoSQL
NOSQL- Presentation on NoSQLRamakant Soni
28.4K visualizações18 slides
Parallel Database por
Parallel DatabaseParallel Database
Parallel DatabaseVESIT/University of Mumbai
69.1K visualizações83 slides
6 Data Modeling for NoSQL 2/2 por
6 Data Modeling for NoSQL 2/26 Data Modeling for NoSQL 2/2
6 Data Modeling for NoSQL 2/2Fabio Fumarola
12.2K visualizações45 slides
distributed shared memory por
 distributed shared memory distributed shared memory
distributed shared memoryAshish Kumar
100.7K visualizações108 slides
Chapter 6.pptx por
Chapter 6.pptxChapter 6.pptx
Chapter 6.pptxRanjanaShevkar
103 visualizações42 slides

Mais procurados(20)

NoSQL Data Architecture Patterns por Maynooth University
NoSQL Data ArchitecturePatternsNoSQL Data ArchitecturePatterns
NoSQL Data Architecture Patterns
Maynooth University4.1K visualizações
NOSQL- Presentation on NoSQL por Ramakant Soni
NOSQL- Presentation on NoSQLNOSQL- Presentation on NoSQL
NOSQL- Presentation on NoSQL
Ramakant Soni28.4K visualizações
6 Data Modeling for NoSQL 2/2 por Fabio Fumarola
6 Data Modeling for NoSQL 2/26 Data Modeling for NoSQL 2/2
6 Data Modeling for NoSQL 2/2
Fabio Fumarola12.2K visualizações
distributed shared memory por Ashish Kumar
 distributed shared memory distributed shared memory
distributed shared memory
Ashish Kumar100.7K visualizações
Chapter 6.pptx por RanjanaShevkar
Chapter 6.pptxChapter 6.pptx
Chapter 6.pptx
RanjanaShevkar103 visualizações
Hadoop File system (HDFS) por Prashant Gupta
Hadoop File system (HDFS)Hadoop File system (HDFS)
Hadoop File system (HDFS)
Prashant Gupta8.4K visualizações
Web Mining & Text Mining por Hemant Sharma
Web Mining & Text MiningWeb Mining & Text Mining
Web Mining & Text Mining
Hemant Sharma14.1K visualizações
Distributed dbms architectures por Pooja Dixit
Distributed dbms architecturesDistributed dbms architectures
Distributed dbms architectures
Pooja Dixit10K visualizações
parallel Questions & answers por Md. Mashiur Rahman
parallel Questions & answersparallel Questions & answers
parallel Questions & answers
Md. Mashiur Rahman4.3K visualizações
Neo4j session por Dr-Dipali Meher
Neo4j sessionNeo4j session
Neo4j session
Dr-Dipali Meher2.5K visualizações
Major issues in data mining por Slideshare
Major issues in data miningMajor issues in data mining
Major issues in data mining
Slideshare36.3K visualizações
Data integrity por Rahul Gupta
Data integrityData integrity
Data integrity
Rahul Gupta18.5K visualizações
Server system architecture por Faiza Hafeez
Server system architectureServer system architecture
Server system architecture
Faiza Hafeez1.2K visualizações
Distributed design alternatives por Pooja Dixit
Distributed design alternativesDistributed design alternatives
Distributed design alternatives
Pooja Dixit4.3K visualizações
Locking base concurrency control por Prakash Poudel
  Locking base concurrency control  Locking base concurrency control
Locking base concurrency control
Prakash Poudel1K visualizações
Database 2 ddbms,homogeneous & heterognus adv & disadvan por Iftikhar Ahmad
Database 2 ddbms,homogeneous & heterognus adv & disadvanDatabase 2 ddbms,homogeneous & heterognus adv & disadvan
Database 2 ddbms,homogeneous & heterognus adv & disadvan
Iftikhar Ahmad4.1K visualizações
13. Query Processing in DBMS por koolkampus
13. Query Processing in DBMS13. Query Processing in DBMS
13. Query Processing in DBMS
koolkampus43.8K visualizações
Replication in Distributed Systems por Kavya Barnadhya Hazarika
Replication in Distributed SystemsReplication in Distributed Systems
Replication in Distributed Systems
Kavya Barnadhya Hazarika17.5K visualizações

Similar a Version Stamps in NOSQL Databases

Streaming is a Detail por
Streaming is a DetailStreaming is a Detail
Streaming is a DetailHostedbyConfluent
39 visualizações12 slides
Big Data Serving with Vespa - Jon Bratseth, Distinguished Architect, Oath por
Big Data Serving with Vespa - Jon Bratseth, Distinguished Architect, OathBig Data Serving with Vespa - Jon Bratseth, Distinguished Architect, Oath
Big Data Serving with Vespa - Jon Bratseth, Distinguished Architect, OathYahoo Developer Network
790 visualizações19 slides
Handling Data in Mega Scale Web Systems por
Handling Data in Mega Scale Web SystemsHandling Data in Mega Scale Web Systems
Handling Data in Mega Scale Web SystemsVineet Gupta
1.1K visualizações54 slides
UnConference for Georgia Southern Computer Science March 31, 2015 por
UnConference for Georgia Southern Computer Science March 31, 2015UnConference for Georgia Southern Computer Science March 31, 2015
UnConference for Georgia Southern Computer Science March 31, 2015Christopher Curtin
1K visualizações76 slides
Robustness In HDFS por
Robustness In HDFSRobustness In HDFS
Robustness In HDFSErin Moore
3 visualizações77 slides
MongoDB Schema Design by Examples por
MongoDB Schema Design by ExamplesMongoDB Schema Design by Examples
MongoDB Schema Design by ExamplesHadi Ariawan
2.5K visualizações15 slides

Similar a Version Stamps in NOSQL Databases(20)

Streaming is a Detail por HostedbyConfluent
Streaming is a DetailStreaming is a Detail
Streaming is a Detail
HostedbyConfluent39 visualizações
Big Data Serving with Vespa - Jon Bratseth, Distinguished Architect, Oath por Yahoo Developer Network
Big Data Serving with Vespa - Jon Bratseth, Distinguished Architect, OathBig Data Serving with Vespa - Jon Bratseth, Distinguished Architect, Oath
Big Data Serving with Vespa - Jon Bratseth, Distinguished Architect, Oath
Yahoo Developer Network790 visualizações
Handling Data in Mega Scale Web Systems por Vineet Gupta
Handling Data in Mega Scale Web SystemsHandling Data in Mega Scale Web Systems
Handling Data in Mega Scale Web Systems
Vineet Gupta1.1K visualizações
UnConference for Georgia Southern Computer Science March 31, 2015 por Christopher Curtin
UnConference for Georgia Southern Computer Science March 31, 2015UnConference for Georgia Southern Computer Science March 31, 2015
UnConference for Georgia Southern Computer Science March 31, 2015
Christopher Curtin1K visualizações
Robustness In HDFS por Erin Moore
Robustness In HDFSRobustness In HDFS
Robustness In HDFS
Erin Moore3 visualizações
MongoDB Schema Design by Examples por Hadi Ariawan
MongoDB Schema Design by ExamplesMongoDB Schema Design by Examples
MongoDB Schema Design by Examples
Hadi Ariawan2.5K visualizações
Hadoop bank por AMIT BHARTIYA
Hadoop bankHadoop bank
Hadoop bank
AMIT BHARTIYA281 visualizações
Relational databases vs Non-relational databases por James Serra
Relational databases vs Non-relational databasesRelational databases vs Non-relational databases
Relational databases vs Non-relational databases
James Serra22.7K visualizações
Hadoop and Voldemort @ LinkedIn por Hadoop User Group
Hadoop and Voldemort @ LinkedInHadoop and Voldemort @ LinkedIn
Hadoop and Voldemort @ LinkedIn
Hadoop User Group9.3K visualizações
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010 por Bhupesh Bansal
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Bhupesh Bansal1.3K visualizações
Netezza fundamentals for developers por Biju Nair
Netezza fundamentals for developersNetezza fundamentals for developers
Netezza fundamentals for developers
Biju Nair106K visualizações
The Evolution of a Scrappy Startup to a Successful Web Service por Poornima Vijayashanker
The Evolution of a Scrappy Startup to a Successful Web ServiceThe Evolution of a Scrappy Startup to a Successful Web Service
The Evolution of a Scrappy Startup to a Successful Web Service
Poornima Vijayashanker12.3K visualizações
Bhupeshbansal bigdata por Bhupesh Bansal
Bhupeshbansal bigdata Bhupeshbansal bigdata
Bhupeshbansal bigdata
Bhupesh Bansal675 visualizações
MongoDB_Spark por Mat Keep
MongoDB_SparkMongoDB_Spark
MongoDB_Spark
Mat Keep1K visualizações
Enabling SQL Access to Data Lakes por Vasu S
Enabling SQL Access to Data LakesEnabling SQL Access to Data Lakes
Enabling SQL Access to Data Lakes
Vasu S21 visualizações
Big Data por NGDATA
Big DataBig Data
Big Data
NGDATA67.4K visualizações
Black Friday and Cyber Monday- Best Practices for Your E-Commerce Database por Tim Vaillancourt
Black Friday and Cyber Monday- Best Practices for Your E-Commerce DatabaseBlack Friday and Cyber Monday- Best Practices for Your E-Commerce Database
Black Friday and Cyber Monday- Best Practices for Your E-Commerce Database
Tim Vaillancourt301 visualizações
Need for Time series Database por Pramit Choudhary
Need for Time series DatabaseNeed for Time series Database
Need for Time series Database
Pramit Choudhary1.3K visualizações
Big Data with hadoop, Spark and BigQuery (Google cloud next Extended 2017 Kar... por Imam Raza
Big Data with hadoop, Spark and BigQuery (Google cloud next Extended 2017 Kar...Big Data with hadoop, Spark and BigQuery (Google cloud next Extended 2017 Kar...
Big Data with hadoop, Spark and BigQuery (Google cloud next Extended 2017 Kar...
Imam Raza1.4K visualizações
NoSQLEU: Different NoSQL tools in Production por Bit Zesty
NoSQLEU: Different NoSQL tools in ProductionNoSQLEU: Different NoSQL tools in Production
NoSQLEU: Different NoSQL tools in Production
Bit Zesty1.5K visualizações

Mais de Dr-Dipali Meher

DataPreprocessing.pptx por
DataPreprocessing.pptxDataPreprocessing.pptx
DataPreprocessing.pptxDr-Dipali Meher
267 visualizações33 slides
Literature Review por
Literature ReviewLiterature Review
Literature ReviewDr-Dipali Meher
88 visualizações21 slides
Research Problem por
Research ProblemResearch Problem
Research ProblemDr-Dipali Meher
129 visualizações15 slides
Formulation of Research Design por
Formulation of Research DesignFormulation of Research Design
Formulation of Research DesignDr-Dipali Meher
694 visualizações23 slides
Types of Research por
Types of ResearchTypes of Research
Types of ResearchDr-Dipali Meher
168 visualizações23 slides
Research Methodology-Intorduction por
Research Methodology-IntorductionResearch Methodology-Intorduction
Research Methodology-IntorductionDr-Dipali Meher
236 visualizações24 slides

Mais de Dr-Dipali Meher(10)

DataPreprocessing.pptx por Dr-Dipali Meher
DataPreprocessing.pptxDataPreprocessing.pptx
DataPreprocessing.pptx
Dr-Dipali Meher267 visualizações
Literature Review por Dr-Dipali Meher
Literature ReviewLiterature Review
Literature Review
Dr-Dipali Meher88 visualizações
Research Problem por Dr-Dipali Meher
Research ProblemResearch Problem
Research Problem
Dr-Dipali Meher129 visualizações
Formulation of Research Design por Dr-Dipali Meher
Formulation of Research DesignFormulation of Research Design
Formulation of Research Design
Dr-Dipali Meher694 visualizações
Types of Research por Dr-Dipali Meher
Types of ResearchTypes of Research
Types of Research
Dr-Dipali Meher168 visualizações
Research Methodology-Intorduction por Dr-Dipali Meher
Research Methodology-IntorductionResearch Methodology-Intorduction
Research Methodology-Intorduction
Dr-Dipali Meher236 visualizações
Introduction to Research por Dr-Dipali Meher
Introduction to ResearchIntroduction to Research
Introduction to Research
Dr-Dipali Meher783 visualizações
Naive bayesian classification por Dr-Dipali Meher
Naive bayesian classificationNaive bayesian classification
Naive bayesian classification
Dr-Dipali Meher19.7K visualizações
Data mining an introduction por Dr-Dipali Meher
Data mining an introductionData mining an introduction
Data mining an introduction
Dr-Dipali Meher7.9K visualizações
Function Pointer por Dr-Dipali Meher
Function PointerFunction Pointer
Function Pointer
Dr-Dipali Meher2.5K visualizações

Último

Pharmaceutical Analysis PPT (BP 102T) por
Pharmaceutical Analysis PPT (BP 102T) Pharmaceutical Analysis PPT (BP 102T)
Pharmaceutical Analysis PPT (BP 102T) yakshpharmacy009
116 visualizações29 slides
Six Sigma Concept by Sahil Srivastava.pptx por
Six Sigma Concept by Sahil Srivastava.pptxSix Sigma Concept by Sahil Srivastava.pptx
Six Sigma Concept by Sahil Srivastava.pptxSahil Srivastava
51 visualizações11 slides
UNIDAD 3 6º C.MEDIO.pptx por
UNIDAD 3 6º C.MEDIO.pptxUNIDAD 3 6º C.MEDIO.pptx
UNIDAD 3 6º C.MEDIO.pptxMarcosRodriguezUcedo
150 visualizações32 slides
A Guide to Applying for the Wells Mountain Initiative Scholarship 2023 por
A Guide to Applying for the Wells Mountain Initiative Scholarship 2023A Guide to Applying for the Wells Mountain Initiative Scholarship 2023
A Guide to Applying for the Wells Mountain Initiative Scholarship 2023Excellence Foundation for South Sudan
87 visualizações26 slides
MercerJesse3.0.pdf por
MercerJesse3.0.pdfMercerJesse3.0.pdf
MercerJesse3.0.pdfjessemercerail
163 visualizações6 slides
Thanksgiving!.pdf por
Thanksgiving!.pdfThanksgiving!.pdf
Thanksgiving!.pdfEnglishCEIPdeSigeiro
568 visualizações17 slides

Último(20)

Pharmaceutical Analysis PPT (BP 102T) por yakshpharmacy009
Pharmaceutical Analysis PPT (BP 102T) Pharmaceutical Analysis PPT (BP 102T)
Pharmaceutical Analysis PPT (BP 102T)
yakshpharmacy009116 visualizações
Six Sigma Concept by Sahil Srivastava.pptx por Sahil Srivastava
Six Sigma Concept by Sahil Srivastava.pptxSix Sigma Concept by Sahil Srivastava.pptx
Six Sigma Concept by Sahil Srivastava.pptx
Sahil Srivastava51 visualizações
UNIDAD 3 6º C.MEDIO.pptx por MarcosRodriguezUcedo
UNIDAD 3 6º C.MEDIO.pptxUNIDAD 3 6º C.MEDIO.pptx
UNIDAD 3 6º C.MEDIO.pptx
MarcosRodriguezUcedo150 visualizações
MercerJesse3.0.pdf por jessemercerail
MercerJesse3.0.pdfMercerJesse3.0.pdf
MercerJesse3.0.pdf
jessemercerail163 visualizações
NodeJS and ExpressJS.pdf por ArthyR3
NodeJS and ExpressJS.pdfNodeJS and ExpressJS.pdf
NodeJS and ExpressJS.pdf
ArthyR350 visualizações
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37 por MysoreMuleSoftMeetup
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
MysoreMuleSoftMeetup54 visualizações
Berry country.pdf por MariaKenney3
Berry country.pdfBerry country.pdf
Berry country.pdf
MariaKenney380 visualizações
INT-244 Topic 6b Confucianism por S Meyer
INT-244 Topic 6b ConfucianismINT-244 Topic 6b Confucianism
INT-244 Topic 6b Confucianism
S Meyer49 visualizações
ICS3211_lecture 09_2023.pdf por Vanessa Camilleri
ICS3211_lecture 09_2023.pdfICS3211_lecture 09_2023.pdf
ICS3211_lecture 09_2023.pdf
Vanessa Camilleri147 visualizações
Education of marginalized and socially disadvantages segments.pptx por GarimaBhati5
Education of marginalized and socially disadvantages segments.pptxEducation of marginalized and socially disadvantages segments.pptx
Education of marginalized and socially disadvantages segments.pptx
GarimaBhati547 visualizações
JQUERY.pdf por ArthyR3
JQUERY.pdfJQUERY.pdf
JQUERY.pdf
ArthyR3107 visualizações
REFERENCING, CITATION.pptx por abhisrivastava11
REFERENCING, CITATION.pptxREFERENCING, CITATION.pptx
REFERENCING, CITATION.pptx
abhisrivastava1141 visualizações
BUSINESS ETHICS MODULE 1 UNIT I_A.pdf por Dr Vijay Vishwakarma
BUSINESS ETHICS MODULE 1 UNIT I_A.pdfBUSINESS ETHICS MODULE 1 UNIT I_A.pdf
BUSINESS ETHICS MODULE 1 UNIT I_A.pdf
Dr Vijay Vishwakarma92 visualizações
Guess Papers ADC 1, Karachi University por Khalid Aziz
Guess Papers ADC 1, Karachi UniversityGuess Papers ADC 1, Karachi University
Guess Papers ADC 1, Karachi University
Khalid Aziz105 visualizações
Papal.pdf por MariaKenney3
Papal.pdfPapal.pdf
Papal.pdf
MariaKenney373 visualizações

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