Skip to main content

Replication as scaling; concurrent invocations

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.

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?

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.
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.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Distributed System chapter 7 questions →