Questions tagged [synchronization]

Maintaining several related processes, threads, objects or data in a consistent state. Not to be confused with replication.

Synchronization means to maintain several related processes, threads or objects in a consistent state.

Synchronization shall not be confused with . Replication is to maintain multiple copies of the same data or objects in the same state. Replication implies synchronization, but synchronization doe not necessarily imply replication.

See also:

192 questions
62
votes
2 answers

Best practice/Patterns for two way data synchronisation

Quite often in my work the idea of 2-way data synchronisation between database systems crops up. The classic example is two slightly different CRM systems (say, Raiser's Edge and Salesforce) and the need to have a two-way sync of Contact data…
41
votes
4 answers

Best way to synchronize data between two different databases

I have to implement data synchronization between two big databases which have completely different structures. Basically, I need to grap some data about products in different tables in the first database and re-arrange them for other tables in the…
Neow
  • 535
  • 1
  • 5
  • 5
40
votes
5 answers

Does immutability entirely eliminate the need for locks in multi-processor programming?

Part 1 Clearly Immutability minimizes the need for locks in multi-processor programming, but does it eliminate that need, or are there instances where immutability alone is not enough? It seems to me that you can only defer processing and…
32
votes
5 answers

No central database

I have a client that is looking to get a website/mobile apps/desktop apps built that deal with very sensitive data (more sensitive than bank/card details). Because of the sensitive nature of the data, they do not want to save it in a central…
29
votes
1 answer

Redis vs Zookeeper

It seems silly to compare these two servers considering that they're meant for very different things. But if you think about it, they can do lots of similar things: store configuration data, distributed locking, queueing, etc. I've got an instance…
Jason Baker
  • 9,625
  • 8
  • 44
  • 67
29
votes
5 answers

How best do you represent a bi-directional sync in a REST api?

Assuming a system where there's a Web Application with a resource, and a reference to a remote application with another similar resource, how do you represent a bi-directional sync action which synchronizes the 'local' resource with the 'remote'…
Edward M Smith
  • 391
  • 1
  • 4
  • 4
27
votes
5 answers

Is "releases mutexes in reverse order" required to make this deadlock-prevention method work?

Operating System Concepts says 7.4.4 Circular Wait The fourth and final condition for deadlocks is the circular-wait condition. One way to ensure that this condition never holds is to impose a total ordering of all resource types and to require that…
Tim
  • 5,405
  • 7
  • 48
  • 84
27
votes
3 answers

Conflict resolution for two-way sync

How do you manage two-way synchronization between a 'main' database server and many 'secondary' servers, in particular conflict resolution, assuming a connection is not always available? For example, I have a mobile app that uses CoreData as the…
K.Steff
  • 4,475
  • 2
  • 31
  • 28
24
votes
9 answers

Multithreading synchronization interview question: Find n words given m threads

Is there a way this problem could benefit from a solution with multiple threads, rather than a single thread? In an interview, I was asked to solve a problem using multiple threads. It appears to me that the multiple threads lends no…
rplusg
  • 350
  • 1
  • 2
  • 7
17
votes
3 answers

How to justify using await instead of .Result() or .Wait() in .NET Core?

Since the inception of .NET Core, console apps, function apps, ASP.NET etc. are not using synchronization context in async methods (so they're synchronizing straight to Thread Pool). This means that using .Result() or .Wait() after async method…
kor_
  • 279
  • 1
  • 2
  • 7
16
votes
4 answers

Explicit DAG instead of Vector Clocks for synchronisation

I've started looking at approaches to data synchronisation among a set of peers. The peers must be able to work in a disconnected way and then synchronise together to merge their local changes. Peers should be able to merge local updates with a…
Benjohn
  • 261
  • 1
  • 5
15
votes
2 answers

When should I use StringBuilder or StringBuffer?

In a production web application, my fellow programmers used StringBuffer everywhere. Now I am taking care of application development and corrections. After reading StringBuilder and StringBuffer I have decided to replace all the StringBuffer code…
Satish Pandey
  • 1,340
  • 3
  • 10
  • 20
14
votes
1 answer

Is it time to deprecate synchronized, wait and notify?

Is there a single scenario (other than compatibility with ancient JVMs) where using synchronized is preferable to using a Lock? Can anyone justify using wait or notify over the newer systems? Is there any algorithm that must use one of them in its…
OldCurmudgeon
  • 778
  • 5
  • 11
11
votes
2 answers

Synchronization between two systems using MongoDB as changelog

We are developing two related systems. One of them (A) will be installed on our customers' machines. The remaining (B) will be used by my organization. Each system has its own database (relational) and their schemas differ. However, both systems…
k91
  • 119
  • 4
10
votes
3 answers

Can multiple synchronized methods in same object run concurrently

As far as i know when there are multiple synchronized methods(both static and instance) in a class, java allows only one such method to run at a time. But what if a thread acquires lock on an object instance(or class), then enters a synchrozed…
Yeasir
  • 103
  • 1
  • 1
  • 5
1
2 3
12 13