Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7368285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T03:38:52+00:00 2026-05-29T03:38:52+00:00

Imagine following situation: There is a distributed key/value database stored on computer network. One

  • 0

Imagine following situation:

There is a distributed key/value database stored on computer network. One central “main” computer that fetches request, and multiple child machines that store portions of data.
I.e. something like this:

main computer
     |
     +--child A
     +--child B
     +--child C
     .....

I.e. “star” topology.

Additional description:

  1. Portions of database overlap, and several different versions of record with same “key” can be stored on several machines at same time.
  2. Key is not guaranteed to exist on all machines or on specific machines.
  3. “Children” do not synchronize data with each other.
  4. Data is requested/read only via main computer, which must return most recent version of data for requested key.
  5. Data is written only through children – they receive new values from several sources.
  6. Data is never deleted.

Now the main problem:

With such structure, how do I determine which version is most recent?

I can think of two ways to deal with the problem:

  1. Add timestamp for every record, when it is written into database vial child machine, use timestamp to determine version.
  2. Use “revision number” or “write operation index” (issued by main computer, increments by one for every write operation) instead of timestamps.

However, both approaches are not perfect:
1st approach requires perfect clock synchronization for all machines, otherwise system will fail to deliver most recent record value.
2nd approach will cause every child to ask main machine for timestamp via network, which will introduce writing delays, plus main machine will have to be locked by mutex, so multithreading performance will suffer.

What is the better way to deal with this situation?
How do real clustered databases deal with this situation (most recent record version in cluster)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T03:38:52+00:00Added an answer on May 29, 2026 at 3:38 am

    Your statement that the first approach requires perfect clock synchronization is not correct.

    You do not care about the absolute timestamps issued by a child, only the relative timestamps. So as long as the clocks advance at the same rate, they need not be synchronized; you can correct for the known offsets.

    If the clocks on the children advance at different rates, then you must use a method which involves coordination (writing cannot be lock-free in the slow path). This is provable by contradiction, since obviously two children independently writing a value with time-records that cannot be related to each other will not let an outside observer determine which was written later.

    However, you can do the coordination in parallel with the actual write: write to the child and, simultaneously, to an ordered log which allows a determination of which write happened first (you don’t need a ticket-type system like you seem to suggest if you’ve got a write log). So it doesn’t necessarily delay the process of writing at all!

    Take a look at logical-timestamp key-value systems like Accumulo, an HBase alternative (currently in Apache-project incubation) – this is real world clustered database doing exactly what you’re asking for.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Imagine the following situation: I have two branches: DEV and MAIN. I'm working on
Probably a very basic beginner question. Imagine the following situation: I have an ASP.NET
Imagine the following problem: You have a database containing about 20,000 texts in a
Imagine the following database: Table 'companies' has fields id, name and flagship_product_id. Table 'products'
Imagine I have the following situation: Test1.java import java.lang.ref.WeakReference; public class Test1 { public
Imagine the following situation: example http://img4.imageshack.us/img4/9849/oop2.png As may notice the Handler -childs and the
Imagine the following situation: class IAlarm : public boost::enable_shared_from_this<IAlarm> { boost::shared_ptr<IAlarm> getThisPointerForIAlarm() { return
Imagine the following situation: var array = new Array ( [0,0,0,0], [0,0,1,0], [0,0,0,0] );
I'd like your opinion on the following subject: Imagine we have a method that
Imagine you have the following situation: for i in xrange(100000): account = Account() account.foo

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.