DISTRIBUTED SYSTEM
CHAPTER 10 : CASE STUDY
LAB WORK SOLUTION- DISTRIBUTED SYSTEM
DISTRIBUTED SYSTEM -BCA -ALL SLIDES
MCQ- DISTRIBUTED SYSTEM

COMMUNICATION AND INVOCATION

Communication and invocation in distributed systems are fundamental concepts that enable the interaction between different parts of the system, which may be spread across multiple networked computers. 

Communication in Distributed Systems

  1. Message Passing:
    • Synchronous: Both sender and receiver are synchronized; the sender waits for the receiver to acknowledge receipt of the message.
    • Asynchronous: The sender sends the message and continues processing without waiting for the receiver to acknowledge receipt.
    • Examples: MPI (Message Passing Interface), RabbitMQ.
  2. Remote Procedure Call (RPC):
    • Concept: Allows a program to cause a procedure (subroutine) to execute in another address space (commonly on another physical machine).
    • Mechanism: The calling process sends a request message to a remote system, waits for a response, and processes the results.
    • Examples: gRPC, Apache Thrift.
  3. Remote Method Invocation (RMI):
    • Concept: Extends RPC by enabling objects to invoke methods on remote objects, adhering to object-oriented principles.
    • Mechanism: An object running in one Java Virtual Machine (JVM) can invoke methods on an object running in another JVM.
    • Example: Java RMI.
  4. Message Queues:
    • Concept: Uses a queue to hold messages between distributed system components.
    • Mechanism: Producers send messages to the queue, and consumers read messages from the queue, enabling decoupled communication.
    • Examples: Amazon SQS, Kafka.
  5. Publish-Subscribe:
    • Concept: Components publish messages to topics or channels, and other components subscribe to these topics to receive messages.
    • Mechanism: Decouples the producers and consumers of messages.
    • Examples: MQTT, Google Cloud Pub/Sub.

Invocation in Distributed Systems

  1. Synchronous Invocation:
    • Concept: The caller waits for the operation to complete and return results before proceeding.
    • Usage: Suitable for operations where the result is needed immediately.
    • Challenges: Increased latency and potential blocking of the caller if the network or remote service is slow.
  2. Asynchronous Invocation:
    • Concept: The caller invokes an operation and continues processing without waiting for the result.
    • Usage: Suitable for operations where immediate results are not required, improving system responsiveness and scalability.
    • Mechanism: Often involves callbacks, future objects, or message queues.
  3. Deferred Synchronous Invocation:
    • Concept: The caller invokes a method, continues processing, and later retrieves the result.
    • Mechanism: Combines synchronous and asynchronous patterns using future or promise objects.
  4. One-Way Invocation:
    • Concept: The caller sends a request without expecting any response, useful for fire-and-forget operations.
    • Usage: Suitable for logging, monitoring, or non-critical notifications.