Questions tagged [synchronization]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
57
votes
2answers
36k views

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 ...
40
votes
5answers
13k views

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 ...
32
votes
5answers
5k views

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, ...
32
votes
4answers
94k views

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 ...
28
votes
1answer
18k views

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, ...
26
votes
5answers
31k views

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 ...
25
votes
3answers
15k views

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, ...
23
votes
9answers
54k views

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 ...
22
votes
5answers
3k 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 ...
16
votes
4answers
873 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 ...
14
votes
2answers
39k views

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 ...
14
votes
1answer
5k views

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 ...
11
votes
2answers
1k views

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) ...
9
votes
3answers
1k views

How do most sync programs monitor file changes?

Do sync programs like Dropbox typically track file changes by doing byte by byte comparisons, or using hashes, or using diff / keeping local commit logs like version control, or what?
9
votes
2answers
2k views

Synchronisation with offline system

I'm designing a system from which I will synchronise business data from the mobile device (that have an embedded application) that generates data and sends it back to the server. Each line ...
8
votes
1answer
2k views

HTML5 video sprites

I'm currently working on a project where there is a requirement to dynamically composite multiple synchronised video sources onto a single canvas. The initial prototype I put together loaded the video ...
7
votes
3answers
17k views

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 ...
7
votes
3answers
8k views

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 ...
7
votes
2answers
9k 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 ...
7
votes
1answer
5k views

Atomic Memcache Operations in PHP

This post is a follow up to this question: PHP Atomic Memcache on StackOverflow. Considering I am using Memcache (no d at the end) on PHP 5.3.10, I implemented a custom locking system where a client ...
7
votes
2answers
7k views

What's the best implementation for offline mobile app synchronization?

We have an Android app written as a Cordova AngularJS SPA which has now grown so that we need to add some work to it meaning we have to improve the synchronization part of the app. The app is mainly ...
7
votes
3answers
4k views

How to do data synchronisation between two applications?

Our client has a CRM application (let's call it A) and a custom built Windows application (VB.NET) (let's call it B) that directly writes to and reads from the CRM database. Application A is used (...
7
votes
1answer
174 views

Synchronization of resource that has moved out of requests filter range

I have a RESTful API with corresponding clients. If a client request fetches a set of resources (Events) based on a filter, say events taking place between 2015-04-13 - 2015-04-19. If an event which ...
6
votes
4answers
394 views

What are some approaches used in financial applications to prevent deposit/withdrawal sync problems?

I am currently facing a problem with an application that has deposit/withdraw functionality. The underlying database (Cassandra) offers no read/write locks. Now suppose user A has deposited 100$...
6
votes
2answers
14k views

How to make a method synchronized across all instances of a class

Today I was asked this interview question and could not answer. If you have two instances of a Person class which has a setAddress method that is synchronized. Now if it was only one object and ...
6
votes
2answers
107 views

Are there any techniques for detecting redundancies a stream of changes to a filesystem?

I'm working on a file-synchronization client that currently produces a stream of changes to the underlying filesystem. That is a stream of create/update/move/delete events is produced for each ...
6
votes
3answers
5k views

How much time should you allow for clock skew?

We are writing a B2B application that uses OAuth 2.0. Before a token expires we want to refresh it since it is faster to refresh a token, than to request a new one. However, we want to build in some ...
6
votes
2answers
3k views

Understanding the Single-Writer Principle

The article on the Single-Writer Principle of the Mechanical Sympathy blog explains how bad queues are (performance-wise), because they need to be able to receive messages from multiple produers, and ...
6
votes
1answer
2k views

Solutions for iOS collaborative sync (iCloud CoreData, CouchDB)?

I'm developing an iOS app where one of the features will be allowing users to share and collaborate on data (e.g. lists). From everything I've read and based on the way that iCloud CoreData sync works ...
5
votes
2answers
5k views

How to sync calendars events programmatically?

I'd like to hear some ideas how to sync calendar events. Say I have two calendars having fields (id, title, start, end, updated, location and description). I'm struggling with starting point. Its easy ...
5
votes
2answers
10k views

Real time data synchronization techniques between two systems

I need to come up with a design for real-time data update from a COTS product (a Point of Sales system) to a custom-built .NET application (an Inventory Management system). Particularly, any sales ...
5
votes
2answers
2k views

Synchronization of data across microservices

We have 2 to 3 dozen microservices that serve our customers. These services are deployed in a Kubernetes cluster, and they're only accessible to the outside world through 3 or 4 API gateways. We ...
5
votes
1answer
8k views

How to perform a 2 way sync from many client applications to central server?

I have many client applications that sync up to a central server. I am using C#, MS SQL server, Win Forms, ASP.NET MVC + API. I need to learn/figure out how to perform a 2 way sync for data changes ...
5
votes
1answer
1k views

What's a good scheme for multi-user database synchronization?

I'm working on a system to allow multiple users to collaborate on an online project. Everything is fairly straightforward, except for keeping the users in sync. Each user has their own local copy of ...
5
votes
1answer
597 views

Android: Design for fetching update/syncing from server

I'm building a meeting app where users can create, join (by invite), and edit events like meetings, outings etc. Think What's app chat groups. So I'm looking into designing how the android app would ...
5
votes
0answers
599 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 ...
4
votes
6answers
6k views

Is it possible to half-way synchronize javascript functions that include async calls?

I am wondering if there exists a way to half way synchronize javascript functions, where data is requested on the fly. I don't want to make it purely blocking (which I guess is impossible), I just ...
4
votes
4answers
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 ...
4
votes
5answers
1k views

New application development - Use existing database or create a new one?

A Client has a huge Windows Application running on a Database. This client wants you to develop an "Express" version of this application, including only, let's say, 20% of its features. This Express ...
4
votes
7answers
1k views

Sync one thousand vector3 across network with minimal bytes?

I am making a game with Unity, and am having problems attempting network synchronisation. Deterministic simulation is impossible because Unity's internal logic is float based. I am trying to make a ...
4
votes
4answers
2k views

What's the best way to synchronise an event over multiple processes?

Imagine I have two distinct OS processes (the actual OS is unimportant). Process A is responsible for playing a video file. Process B is responsible for playing the audio that accompanies the video ...
4
votes
4answers
160 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 ...
4
votes
2answers
1k views

Design for client-server synchronisation

Background I am working on improving the backend design for a video game. The game is live and working fine, but we want to improve various things. As a video game studio, we often do events which ...
4
votes
2answers
2k views

Bi-directional sync of 2 different APIs

I'm currently assigned a task, where I have to program a bidirectional synchronisation between 2 ERP-related software, one providing webservices (Visual Studio Web Reference) and the other one ...
4
votes
2answers
3k views

Is it a bad idea to sync file system with remote server using HTTP?

I have started a project which will duplicate Dropbox or Google Drive behavior but using Amazon S3 az a backend. Idea is very simple, a Node.js server that watchs a directory for file changes and PUT ...
4
votes
1answer
3k views

Architecture for real-time application, avoiding duplicate messages for queues with no active consumers

I am designing the architecture of an application which has your typical backend and frontend components. The frontend application must be semi real-time. For this requirement, the backend is pushing ...
4
votes
1answer
336 views

Why does a process set its turn to the other process in Peterson's solution for synchronization?

From Operating System Concepts by Abraham Silberschatz, Peter B. Galvin, Greg Gagne, Peterson's solution to the critical-section problem has two processes Pi and Pj, do { flag[i] = true; turn ...
4
votes
1answer
7k views

Implement a monitor in terms of semaphores

From Operating System Concepts by Abraham Silberschatz, Peter B. Galvin, Greg Gagne 5.8.3 Implementing a Monitor Using Semaphores We now consider a possible implementation of the monitor ...
4
votes
1answer
2k views

What is a good design pattern / lib for iOS 5 to synchronize with a web service?

We are developing an iOS application that needs to synchronize with a remote server using web services. The existing web services have an "operations" style rather than REST (implemented in WCF but ...
4
votes
3answers
2k views

Programmatically syncing with remote servers

My application generates text files that need to be synced with remote servers, which may be windows or linux. Sync has to happen without user's intervention. I tried with rsync but windows doesn't ...