Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [synchronization]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
3k views

Two way data synchronization between web application and REST API server

I have a web application and a REST API server (Microsoft Dynamics CRM 2016) that I don't have access to it's code, but I have access to the available resources. I need to create a data sync between ...
8 votes
2 answers
10k views

A simple approach for data synchronisation

I want to synchronise the local database of mobile devices with the server's database. This synchronisation will happen for example when user comes online, to update the local as well as the remote ...
0 votes
2 answers
465 views

Best approach to sync data between mobile app cache and the server db? [duplicate]

I have an offline-first mobile app. The user enters data, data is saved into local SQLite database. The server has Postgres database. I need to build a two-directional sync strategy that keeps data on ...
0 votes
4 answers
466 views

Synchronization in the given Code

I had an interview few weeks back, and I was asked to write a code with Setters and Getters. I had written the following code; // Just an example Class ABC{ private int num; public void ...
1 vote
3 answers
155 views

Ensuring run-once behavior in a multi-threaded environment via volatile lambdas?

I'm coding an enum strategy pattern where one of the strategies makes use of an ScheduledExecutor: class ControllerImpl { //... boolean applyStrat(StratParam param) { getStrat().apply(...
0 votes
0 answers
44 views

Synchranization issue in async jobs created and finished before main thread ends

Main execution thread creates asynchronous job (started and executed by different process) that works on same data that the main thread. For example we create some database entries, that we want to ...
4 votes
4 answers
14k views

How would you approach developing a Hotel Reservation System?

Till now, I have had the experience of developing either a desktop application or a Website. But, with this Hotel reservation system, I am interfacing a problem that needs both. The application ...
0 votes
2 answers
119 views

How do I guarantee ordered processing of occurring events in concurrent environment?

I have a Kafka topic providing events of the following type: id(hash):[ADD|REMOVE]. These events may be generated at a high rate and are idempotent, i.e. getting 123:ADD one time and ten times in a ...
3 votes
5 answers
3k views

Best practice to sync long paths to filesystems where path length is limited?

I wrote a sync tool to synchronize folders/files from Alfresco to Windows. PROBLEM: In Alfresco, /files/can/have/very/very/very/long/filepaths/like/this.txt The Windows API prevents me from creating ...
1 vote
1 answer
90 views

How best to keep Excel Workbook field in sync across class instances

I know almost nothing about threads, synchronization, ... That being said, I am working on a record handler, that hits Excel sheet to pull/push data. There exist, in my code base, a BaseRecordHandler, ...
3 votes
3 answers
297 views

What are the existing theories or methodologies around synchronizing tree structures?

I need to compare and synchronize two tree data structures. I have Tree A (the "Reference Tree") and Tree B (the "Target Tree"). I need to bring the Target Tree into compliance ...
0 votes
1 answer
254 views

Terminology for partial offline database synchronization

I am looking for solutions for a field where I think I don't know the adequate terminology. The problem is that I have a central SQL database in the cloud. Then I have child databases only containing ...
0 votes
1 answer
88 views

Data backup/slave node with replicated data, to be writeable while master is offline

I'm developing and designing a system which runs mostly on intranet of client companies. The system consists of one main database which is MariDB, for now one web-application as system management and ...
0 votes
2 answers
3k views

Race condition in Distributed Systems

We have a set of micro-services that are functionally dependent and have intertwined validation logic. e.g. consider 'Credit-Card' service and 'Loan' service. When user has a credit card then loan ...
6 votes
5 answers
7k views

Why do we need read locks in read-write locks?

in read-write locks, why do we need read locks since processes can read a file at the same time? Would only a write lock suffice? Thanks.
1 vote
0 answers
210 views

If you run a function in a different thread, but you wait for it to finish in your main thread, is that function asynchronous?

Backstory Probably a stupid question, but I just have a sneaking suspicion that "asynchronous" is the wrong terminology to us for naming my template function here: template <class T> ...
3 votes
3 answers
4k views

Synchronous vs Asynchronous Event Driven Architecture

I have been searching extensively about the difference between synchronous and asynchronous patterns and how this relates to event driven architecture. On its face it is quite obvious, I simply ...
4 votes
1 answer
1k views

One producer - multiple consumers queue, best way to guard against rare duplicates?

I have a classical one producer - multiple consumers queue, each item can be processed independently. On rare occasions (<1%) there can be multiple queue items related to the same object the ...
1 vote
1 answer
833 views

Full, 2-way table synchronization

I need to synchronize tables of data between two different systems. This is a multi-master setup; data can get changed in either system. After a synchronization runs I'd like the data in each table to ...
0 votes
1 answer
130 views

Right way to combine data between Mongo and DynamoDB

I am looking for a way of dealing with the following situation: 1- Have an items collection in MongoDB 2- Have a users collection in DynamoDB 3- Each document in the items collection has a "...
-1 votes
1 answer
144 views

How state updates to existing instances/sessions are generally done?

This is a very broad question, but maybe someone has a worthwhile response. There is a general synchronization issue that often has to be solved, but always seems to be difficult. Here's an example: ...
5 votes
1 answer
815 views

Is Event sourcing a good fit for database sync (master-multiple-slaves)?

I'm looking for a good way to maintain in sync local sqlite databases that could be offline to a master one, for a invoice app. Then I read about EventSourcing and Log structured storage and wonder ...
0 votes
0 answers
38 views

Sync image files from network with mariadb-Database

i have as a mechanical engineering student in my practice semester to create a database that includes about 100k+ paths to images in our network. Every, lets say week, i have to synchronize all ...
-1 votes
3 answers
493 views

Is it possible to solve this synchronization problem using mutex and conditional variables?

I am trying to solve this synchronization problem in C to practice for my lectures of Operating Systems where we use POSIX and Linux. I've been trying for days to find an approach to this problem with ...
4 votes
4 answers
3k views

What will you do if multiple users access your application at the same time?

I'm an experienced Software Engineer but very weak in concurrency because of no prior experience in that. I've been interviewing with several companies in which I was asked similar kind of questions ...
4 votes
3 answers
1k views

Do critical section and atomicity imply each other?

Is it correct that In concurrent programming, a critical section is a sequence of statements which can't be executed by more than one processes/threads at the same time. Atomicity (as "A" ...
-1 votes
1 answer
654 views

Design pattern to sync local databases with the cloud [closed]

I would like to find the best way to solve the following problem: I need a database for a software. The software needs to use the data to populate the UI and allow the user to interact with them (edit,...
-2 votes
1 answer
519 views

How to sync async and await Tasks?

With threads you could use Semaphore, mutex, ManualResetEvent, etc... to sync a shared data, how do you accomplish the same thing with tasks? Essentially, if I have shared data between different ...
27 votes
5 answers
7k views

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 ...
1 vote
0 answers
47 views

How to support text editing when the text has to be synchronized with fixed audio?

In my application, we record audio of people speaking, send this to a speech-to-text (STT) service, and present the text to the user for editing. Simplifying a bit, the STT service returns results in ...
0 votes
1 answer
103 views

Sync customers between shop and CRM-system (two-way)

I have a shop system that is based on a MySQL database and over which I have full control. On this system runs my synchronization plugin. And then there is an external CRM system with a fixed API. ...
0 votes
0 answers
133 views

Fill Docker Container from existing remote database

I do have n nodes managed by Kubernetes, all of them running several containers. A container may contain a database alongside with an application. As containers should be stateless, all data within ...
2 votes
0 answers
41 views

Breadth first event synchronization based on a frequency or time series

I have an interesting and problem I'm facing. I'm trying to maintain a set of metrics independently based off of a time frequency. Note: This is a simplification of the problem I've omitted pieces of ...
1 vote
2 answers
944 views

Calling an API and synchronising database

I am calling a payments API to send a payment. At the same time, I need to mark the payment as sent in my database. If I call the API first, then the database crashes, the payment will be sent twice. ...
1 vote
1 answer
587 views

Synchronizing Multiple Local SQL databases with Server

I'm trying to understand what general mechanisms and/or concepts are available in SQL database last to synchronize local. Here are my inputs and requirements. Multiple clients have a full copy of the ...
2 votes
3 answers
1k views

Multithreaded UI desktop application issues

I am involved into development a rich UI project: desktop windows application. Application uses asynchronous invocations and in its turn it should be ready to process external messages (events). The ...
0 votes
0 answers
53 views

What is best approach to designing a local-to-cloud cloud-to-local Infrastructure?

I plan to have a cloud web application(CWA) and several local web application(LWA), let's assume 3 LWAs and 1 CWA. CWA === LWA. This web application would consist of a database server, file storage ...
-1 votes
1 answer
63 views

Design solution for updating different lists with common items

I needed some design suggestions for a tricky workflow we have to implement in our system: At a basic level the application allows users to work on a "list" of "items" she cares about To work on any ...
5 votes
2 answers
1k views

Hexagonal/Clean Architecture - threads, locks, synchronization

All the examples across the internet try to pretend that every application is run on a single thread. There is no problem with synchronization, multithreading etc. Uncle Bob, in his "Clean ...
16 votes
4 answers
1k views

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 ...
1 vote
1 answer
59 views

Poll based database operations with a load balanced application

I have a .NET Core application that is hosted as multiple load balanced instances (separate servers, obviously pointing to the same database). I have written a service within the application that ...
2 votes
1 answer
3k views

Why does a condition variable's wait() release the associated mutex before blocking and reacquire it before returning?

Stallings' Operating System book says about condition variable in Solaris, A condition variable is used to wait until a particular condition is true. Condition variables must be used in ...
-4 votes
3 answers
640 views

What is "it is possible for one process to lock a binary semaphore and for another to unlock it" useful for?

Here are some discussions about mutex (lock) and binary semaphore from two OS books. Stalling's Operating Systems book says A concept related to the binary semaphore is the mutex . A key ...
-2 votes
2 answers
263 views

How to syncronize one object from two sources

I want to synchronize one variable (Node.Value) to two separate sources. Both sources can read or write to their internalValue variable. How do I keep track of the newest value and update ...
1 vote
2 answers
2k views

Why is it that "the process that locks the mutex must be the one to unlock it "?

Here are some discussions about mutex (lock) and binary semaphore from two OS books. Stalling's Operating Systems book says A concept related to the binary semaphore is the mutex . A key ...
1 vote
1 answer
1k views

Is there still busy waiting in the process-blocking implementation of a semaphore?

Operating System Concepts discusses two implementations of a semaphore, by busy waiting in Section 5.5 and by blocking the current process in Section 5.6: Section 5.5 A semaphore S is an integer ...
0 votes
1 answer
1k views

Is a mutex lock always implemented as spin waiting?

Is a mutex lock always implemented as spin waiting? Can a mutex lock be implemented as block waiting? (Operating System Concepts section 5.4 only mentions the implementation by spin waiting. See below....
1 vote
1 answer
431 views

Does a safe state not lead to a starvation state?

In Operating System Concepts: 7.5.1 Safe State A state is safe if the system can allocate resources to each process (up to its maximum) in some order and still avoid a deadlock. More formally, a ...
-1 votes
1 answer
226 views

Why does "producers and consumers check availability before getting the mutex" avoid deadlock?

In Little Book of Semaphores: 4.1.6 Finite buffer producer-consumer solution Finite buffer consumer solution 1 items.wait () 2 mutex.wait () 3 event = buffer .get () 4 mutex. signal () 5 spaces . ...
4 votes
4 answers
2k views

How to understand the first and second readers-writers problems?

Computer Systems: a Programmer's Perspective says The readers-writers problem has several variations, each based on the priorities of readers and writers. The first readers-writers problem, which ...