0% found this document useful (0 votes)
5 views

DS 3

Distributed System
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

DS 3

Distributed System
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

2/16/24, 8:00 PM Vector Clocks in Distributed Systems - GeeksforGeeks

90% Refund @Courses Aptitude Engineering Mathematics Discrete Mathematics Operating System DBM

Vector Clocks in Distributed Systems


Read Courses Jobs

Vector Clock is an algorithm that generates partial ordering of events and


detects causality violations in a distributed system. These clocks expand on
Scalar time to facilitate a causally consistent view of the distributed system,
they detect whether a contributed event has caused another event in the
distributed system. It essentially captures all the causal relationships. This
algorithm helps us label every process with a vector(a list of integers) with
an integer for each local clock of every process within the system. So for N
given processes, there will be vector/ array of size N.

How does the vector clock algorithm work :

Initially, all the clocks are set to zero.


Every time, an Internal event occurs in a process, the value of the
processes’s logical clock in the vector is incremented by 1
Also, every time a process sends a message, the value of the processes’s
logical clock in the vector is incremented by 1.

Every time, a process receives a message, the value of the processes’s


logical clock in the vector is incremented by 1, and moreover, each element
is updated by taking the maximum of the value in its own vector clock and
the value in the vector in the received message (for every element).

Example :
Consider a process (P) with a vector size N for each process: the above set of
rules mentioned are to be executed by the vector clock:

We use cookies to ensure you have the best browsing experience on our website. By using
our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Got It !
Policy

https://www.geeksforgeeks.org/vector-clocks-in-distributed-systems/ 1/7
2/16/24, 8:00 PM Vector Clocks in Distributed Systems - GeeksforGeeks

The above example depicts the vector clocks mechanism in which the vector
clocks are updated after execution of internal events, the arrows indicate
how the values of vectors are sent in between the processes (P1, P2, P3).

To sum up, Vector clocks algorithms are used in distributed systems to


provide a causally consistent ordering of events but the entire Vector is sent
to each process for every message sent, in order to keep the vector clocks in
sync.

Unlock the Power of Placement Preparation!


Feeling lost in OS, DBMS, CN, SQL, and DSA chaos? Our Complete
Interview Preparation Course is the ultimate guide to conquer placements.
Trusted by over 100,000+ geeks, this course is your roadmap to interview
triumph.
Ready to dive in? Explore our Free Demo Content and join our Complete
Interview Preparation course.

Get paid for your published articles and stand a chance to win tablet, smartwatch
and exclusive GfG goodies! Submit your entries in Dev Scripter 2024 today.
We use cookies to ensure you have the best browsing experience on our website. By using
our site, you acknowledge that you have read and understood our Cookie Policy & Privacy
Policy

https://www.geeksforgeeks.org/vector-clocks-in-distributed-systems/ 2/7
2/16/24, 8:00 PM Vector Clocks in Distributed Systems - GeeksforGeeks

Participate in Three 90 Challenge! Enroll in any GeeksforGeeks course and get 90%
refund by completing 90% course. Explore offer now.

Last Updated : 22 Nov, 2021 20

Previous Next

Lamport's Algorithm for Mutual Event Ordering in Distributed System


Exclusion in Distributed System

Share your thoughts in the comments Add Your Comment

Similar Reads
Distributed Consensus in Distributed Heterogeneous and other DSM systems
Systems | Distributed systems

Distributed System - Thrashing in Interprocess Communication in


Distributed Shared Memory Distributed Systems

File Caching in Distributed File Systems Synchronization in Distributed Systems

Date's Twelve Rules for Distributed Distributed File Systems


Database Systems

Language Synchronization Mechanism Self Stabilization in Distributed


in Distributed Systems Systems

K kondalalit… Follow

Article Tags : Distributed System , Computer Subject , Operating Systems


We use cookies to ensure you have the best browsing experience on our website. By using
our site, you acknowledge that you have read and understood our Cookie Policy & Privacy
Additional Information Policy
https://www.geeksforgeeks.org/vector-clocks-in-distributed-systems/ 3/7
2/16/24, 8:00 PM Vector Clocks in Distributed Systems - GeeksforGeeks

A-143, 9th Floor, Sovereign Corporate


Tower, Sector-136, Noida, Uttar Pradesh -
201305

Company Explore
About Us Job-A-Thon Hiring Challenge
Legal Hack-A-Thon
Careers GfG Weekly Contest
In Media Offline Classes (Delhi/NCR)
Contact Us DSA in JAVA/C++
Advertise with us Master System Design
GFG Corporate Solution Master CP
Placement Training Program GeeksforGeeks Videos
Apply for Mentor Geeks Community

Languages DSA
Python Data Structures
Java Algorithms
C++ DSA for Beginners
PHP Basic DSA Problems
We use cookies to ensure you have the best browsing experience on our website. By using
GoLang
our site, you acknowledge that DSA Roadmap
you have read and understood our Cookie Policy & Privacy
Policy

https://www.geeksforgeeks.org/vector-clocks-in-distributed-systems/ 4/7
2/16/24, 8:00 PM Vector Clocks in Distributed Systems - GeeksforGeeks

SQL Top 100 DSA Interview Problems


R Language DSA Roadmap by Sandeep Jain
Android Tutorial All Cheat Sheets
Tutorials Archive

Data Science & ML HTML & CSS


Data Science With Python HTML
Data Science For Beginner CSS
Machine Learning Tutorial Web Templates
ML Maths CSS Frameworks
Data Visualisation Tutorial Bootstrap
Pandas Tutorial Tailwind CSS
NumPy Tutorial SASS
NLP Tutorial LESS
Deep Learning Tutorial Web Design

Python Computer Science


Python Programming Examples GATE CS Notes
Django Tutorial Operating Systems
Python Projects Computer Network
Python Tkinter Database Management System
Web Scraping Software Engineering
OpenCV Python Tutorial Digital Logic Design
Python Interview Question Engineering Maths

DevOps Competitive Programming


Git Top DS or Algo for CP
AWS Top 50 Tree
Docker Top 50 Graph
Kubernetes Top 50 Array
Azure Top 50 String
GCP Top 50 DP
DevOps Roadmap Top 15 Websites for CP

System Design JavaScript


Highyou
We use cookies to ensure Level
haveDesign
the best browsing experience on our website. ByJavaScript
using Examples
our site, you acknowledge
Lowthat
Levelyou have read and understood our Cookie Policy & PrivacyTypeScript
Design
Policy

https://www.geeksforgeeks.org/vector-clocks-in-distributed-systems/ 5/7
2/16/24, 8:00 PM Vector Clocks in Distributed Systems - GeeksforGeeks

UML Diagrams ReactJS


Interview Guide NextJS
Design Patterns AngularJS
OOAD NodeJS
System Design Bootcamp Lodash
Interview Questions Web Browser

NCERT Solutions School Subjects


Class 12 Mathematics
Class 11 Physics
Class 10 Chemistry
Class 9 Biology
Class 8 Social Science
Complete Study Material English Grammar

Commerce UPSC Study Material


Accountancy Polity Notes
Business Studies Geography Notes
Economics History Notes
Management Science and Technology Notes
HR Management Economy Notes
Finance Ethics Notes
Income Tax Previous Year Papers

SSC/ BANKING Colleges


SSC CGL Syllabus Indian Colleges Admission & Campus Experiences
SBI PO Syllabus List of Central Universities - In India
SBI Clerk Syllabus Colleges in Delhi University
IBPS PO Syllabus IIT Colleges
IBPS Clerk Syllabus NIT Colleges
SSC CGL Practice Papers IIIT Colleges

Companies Preparation Corner


META Owned Companies Company-Wise Recruitment Process
Alphabhet Owned Companies Resume Templates
We use cookiesTATA Groupyou
to ensure Owned Companies
have the best browsing experience on our website. ByAptitude
using Preparation
our site, you acknowledge that youCompanies
Reliance Owned have read and understood our Cookie Policy & Privacy Puzzles
Policy

https://www.geeksforgeeks.org/vector-clocks-in-distributed-systems/ 6/7
2/16/24, 8:00 PM Vector Clocks in Distributed Systems - GeeksforGeeks

Fintech Companies Company-Wise Preparation


EdTech Companies

Exams More Tutorials


JEE Mains Software Development
JEE Advanced Software Testing
GATE CS Product Management
NEET SAP
UGC NET SEO - Search Engine Optimization
Linux
Excel

Free Online Tools Write & Earn


Typing Test Write an Article
Image Editor Improve an Article
Code Formatters Pick Topics to Write
Code Converters Share your Experiences
Currency Converter Internships
Random Number Generator
Random Password Generator

@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved

We use cookies to ensure you have the best browsing experience on our website. By using
our site, you acknowledge that you have read and understood our Cookie Policy & Privacy
Policy

https://www.geeksforgeeks.org/vector-clocks-in-distributed-systems/ 7/7

You might also like