Skip to content
This repository has been archived by the owner on Oct 7, 2022. It is now read-only.

sync 03

Nicolas Sebrecht edited this page Mar 17, 2016 · 2 revisions

One side state controller

In this case, the full state backend is run as a controller (so inside a driver worker).


  {worker}                        {worker}                         {worker}
+---------+-------+             +----------+                     +----------+
|         |       |   (drives)  |          |      (drives)       |          |
|  driver | state |<------------|  engine  +-------------------->|  driver  |
|         |       |             |          |                     |          |
+---------+-------+             +----------+                     +----------+

Use case

  • In the engine:
right.search(searchConditions) # Async
leftMessages = left.search(searchConditions) # Sync
rightMessages = right.getSearchResult_sync() # Sync

# 3-way merge.

left.update(mergedMessages) # Async?
right.update_sync(mergedMessages) # We have to keep track on successful writes.

I stopped, here. The implementation would be very very tricky.

Pros

  • ?

Cons

  • All the successful writes of one side must be forwarded to the other.
  • Is it the expected job for a sync engine?
  • Asymmetric calls from the engine. That sucks hard.
  • Keeping track on write results might be hard to get it right in fully async environement.
  • Very complex implementation.
  • The engine needs a way to update the chain of controllers.
Clone this wiki locally