This tag can be used by questions on distributed system concept, design, and implementations.
Questions tagged [distributed-system]
212 questions
28
votes
5 answers
I'm not seeing 'tightly coupled code' as one of the drawbacks of a monolithic application architecture
One of the most common things I see when discussing pros/cons of microservice vs monolithic architecture is that monolithic applications have, or always trend toward, 'tight coupling.'
To be honest, I'm not seeing why this is true if your developers…
Bob Dole
- 421
24
votes
2 answers
What is the meaning of fan-out
I see this word in many places but don't get it.
From the Wikipedia,
In message-oriented middleware solutions, fan-out is a messaging pattern used to model an information exchange that implies the delivery (or spreading) of a message to one or…
user3153970
- 441
14
votes
5 answers
How can I efficiently diff a CSV file against a database?
I have an inventory of products stored in Postgres. I need to be able to take a CSV file and get a list of changes—the things in the CSV file that are different to what is in the database. The CSV file has about 1.6 million rows.
The naive approach…
Isvara
- 630
- 6
- 18
14
votes
2 answers
When bounded contexts and "microservices" collide. A distributed systems dilemma in diagram form
You can't please everyone. Some people want a lot of context and background on sites like this. Others do not. If you don't want the background, skip the first three paragraphs.
I am a software architect with about 25 years experience, starting with…
allmhuran
- 316
13
votes
2 answers
Does Optimistic Concurrency per object imply Serializability if a transaction will never span multiple objects?
Given a system which provides:
Optimistic concurrency control / versioning per object (using CAS - Check-and-Set)
Transactions that never need to span more then a single object.
Snapshot Isolation
Is this system considered serializable?
From…
Geert-Jan
- 673
12
votes
2 answers
How to safely run database migrations with multiple app instances?
We have an application that has a mix of both fast (< 1 second) and slow database migrations (> 30 seconds). Right now, we're running database migrations as a part of CI, but then our CI tool has to know all of the database connection strings for…
ben_makes_stuff
- 313
10
votes
3 answers
How do distributed databases follow unique constraints?
Lets say i have an application where user can register, and the username has to be unqiue value.
Now lets say i have N partitions and for each partition i have M replicas with multiple leaders.
Now i have questions regarding these…
Johnyb
- 407
10
votes
3 answers
How acceptable is to keep business logic outside entities (in separate service classes)?
We were taught that objects are self contained things with data and behaviour and therefore they should have methods that act on their attributes. But there are several situations when this coupling between entities and their behaviour is not…
TomR
- 1,009
8
votes
4 answers
If a system talks to a database to get some previous information to serve a request, does that make the system **stateful** or **stateless**?
I've read this example which basically states that, since a method has to hold a single private field.. It is considered a stateful system.
So basically ANYTHING system that calls upon some sort of data-storage mechanism to retrieve something to…
imperialgendarme
- 191
7
votes
1 answer
Architecting basket in high scale distributed application
I'm designing an e-commerce application. Main flow is pretty straightforward: customer add items to basket, checkouts the basket (place an order) and waits for delivery.
There are following requirements:
basket is kept on backend
system should…
7
votes
3 answers
How to prevent overlap booking on a calendar booking system
As an exercise, I am trying to design a simple calendar booking system for multiple meeting rooms. I kind of got my head around some requirements such as find available rooms for a given time range, room booking look up. However, I seem to stuck a…
smurf
- 79
7
votes
3 answers
Best practices for Heartbeat in distributed systems
We had in our system in the past an external data provider (call it source) sending regular heartbeats to a java application (call it client). If the heartbeat failed, system shut itself down (to avoid serving stale data in a critical application).…
senseiwu
- 668
7
votes
2 answers
How do you solve issue of consistency in concurrent and distributed application (built around Bankers Dilemma)?
This is a classic problem which I'm sure has been solved many times by many different people. I don't have any formal training (I've not studied computer science or any other such academic subject) and so I'm not sure of the best way to solve the…
Integralist
- 171
6
votes
4 answers
Protecting against malicious duplicate IDs in a distributed environment
Let's say we have multiple (somewhat autonomous) (micro-)services, and when entities are created, the ID (UUIDs or whatever) can be set externally. How can we ensure that an ID remains unique across all services while protecting against someone…
Philippe
- 71
6
votes
1 answer
Should user and service-to-service authentications be separate?
Say I have a system with 5 microservices behind a gateway, and a user signs in through an IDP (OAuth)
A user U passes the access token in a request, and the call first reaches the gateway before it enters the services behind, say A, and then A calls…
Jerald Baker
- 171