---
title: "Replication as scaling; concurrent invocations"
subject: "Distributed System"
chapter: 7
key: "semester_7/distributed_system:replication-concurrent-invocations"
source: https://www.bctengineer.com/q/semester_7/distributed_system/replication-concurrent-invocations
site: BCT Engineering
---

# Replication as scaling; concurrent invocations

Distributed System · Chapter 7: Replication

- Asked in: 2070 Asar, 2+4 marks
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_7/distributed_system/replication-concurrent-invocations
- Whole chapter: https://www.bctengineer.com/md/semester_7/distributed_system/chapter-7

## Question

How do you say that replication is one of the scaling techniques in Distributed System? How to handle concurrent invocations with object replication in distributed object based system?

## Short answer

Replication scales distributed systems by sharing load among replicas, placing copies near clients to reduce latency and traffic, and using caching; the trade-off is consistency. To handle concurrent invocations on replicated objects, all replicas must apply invocations in the same order using a sequencer or totally ordered multicast, and deterministic scheduling. Replicated invocations are avoided by having a coordinator forward calls or by detecting duplicates via invocation identifiers.

## Answer

#### Replication as a scaling technique
Scalability problems (size, geographic, administrative) appear when many clients access one server. **Replication** puts copies of a service or data on several machines, so:
- The load is shared among replicas, so the server is not a bottleneck (size scalability).
- A client can use a nearby replica, which reduces latency and network traffic (geographic scalability).
- Caching, which is a form of replication, avoids repeated remote access.

The price is **consistency**: when one copy is updated, others must be updated, which needs global synchronization (e.g. total ordering) that itself limits scalability. The trade-off is handled by relaxing consistency, so replication helps scaling mainly when reads are far more common than writes.

#### Handling concurrent invocations on replicated objects
In an object-based system, if an object is replicated, concurrent invocations by different clients may reach different replicas in different orders and leave the replicas inconsistent. Two problems must be solved.

1. **Ordering of invocations**: all replicas must apply invocations in the same order.
   - **Centralized coordination**: one replica (the **sequencer/primary**) gives each invocation a sequence number; all replicas execute in that order.
   - **Totally ordered multicast**: invocations are multicast to all replicas with a total-order protocol (Lamport timestamps), so each receives them in the same order.
   - **Deterministic scheduling**: an object server is usually multithreaded, so even when invocations arrive in the same order, each replica must schedule its threads deterministically (e.g. through a replication-aware object adapter in the middleware) so that all replicas execute the calls in the same way.
2. **Replicated invocations**: if a replicated object A calls another object B, then each replica of A would send the same call to B, which would execute it many times. The solutions are:
   - A **coordinator** replica forwards the call to B and multicasts the reply to the other replicas, which suppress their own calls.
   - The middleware **detects duplicates** by invocation identifiers so B executes it only once and returns the same reply to every caller; replies are multicast to all replicas.

```text
Client1, Client2 --> sequencer --> R1, R2, R3 (same order)
R1,R2,R3 --> (one call only) --> Object B
```
This keeps the replicas consistent and makes sure each nested call is executed only once.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Why does replication help scalability mainly when reads are far more common than writes?
   A. Because reads need global synchronization
   B. Because updates must be applied to all copies, which needs synchronization that limits scalability
   C. Because writes are always faster
   D. Because replicas cannot serve reads
   Answer: B. Consistency maintenance for updates needs global synchronization such as total ordering, so heavy writes erode the benefit. (Key point: Replication and scaling)

2. What problem arises when concurrent invocations reach different replicas of an object?
   A. The replicas may apply them in different orders and become inconsistent
   B. The invocations are automatically merged
   C. The client receives no reply
   D. The object is deleted
   Answer: A. All replicas must apply invocations in the same order; otherwise their states diverge. (Key point: Ordering of invocations)

3. How does a sequencer (centralized coordination) ensure consistent ordering?
   A. It gives each invocation a sequence number and all replicas execute in that order
   B. It runs the invocation on one replica only
   C. It randomly reorders requests
   D. It discards concurrent invocations
   Answer: A. The sequencer or primary assigns sequence numbers so every replica executes in the same order. (Key point: Sequencer)

4. A replicated object A calls object B. What is the problem and a solution?
   A. B is called once per replica of A; a coordinator replica can forward one call and multicast the reply
   B. B cannot be called at all; replication must be removed
   C. A's replicas never need B's reply; ignore it
   D. B is replicated automatically and so has no problem
   Answer: A. Each replica of A would send the same call so B would execute it many times; duplicates are suppressed by a coordinator or by invocation identifiers. (Key point: Replicated invocations)

## Related in Distributed System

- [Object replication; process resilience](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Aobject-replication-resilience) — Distributed System, chapter 7
- [Distributed object, IDL; RPC vs RMI](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Aobject-idl-rpc-rmi) — Distributed System, chapter 2
- [Reasons for replication; active replication](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Aactive-replication-reasons) — Distributed System, chapter 7, asked 2×
- [Passive vs active replication; availability](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Apassive-vs-active-available) — Distributed System, chapter 7, asked 2×
- [Active vs passive; active replication working](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Aactive-passive-working) — Distributed System, chapter 7
- [Replication, fault tolerance, scalability](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Areplication-scalability-ft) — Distributed System, chapter 7

## Related in other subjects

- [Distributed object versus multiprocessor architecture](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Adistributed-object-vs-multiprocessor) — Software Engineering, chapter 3
- [Client-server versus distributed object architecture](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Aclient-server-vs-distributed-object) — Software Engineering, chapter 3
- [Multiplexing techniques; analog one explained](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Alist-mux-techniques) — Data Communication, chapter 6
- [Short note: Distributed system implementation](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Ashort-note-distributed-implementation-issues) — Object Oriented Analysis and Design, chapter 4
