chapter 4 Flashcards
How can subsystems communicate?
Remote Procedure Calls (RPC)
what is the goal of RPC?
Simple programming model for distributed applications. Distributed programs can interact (transparently) in heterogenous environments.
How RPC works?
It defines an interface for the remote procedure using an Interface Definition Language (IDL). It has input and output parameters and can be independent of programming languages. After that, the interface is compiled using IDL-compiler, resulting in: client stub (proxy), server stub (skeleton), auxiliary files (header files, etc…).
The client stub is compiled and linked with client program. The client program invokes remote procedure by invoking the local client stub. It implements everything to interact with the server remotely.
The server stub (skeleton) implements the server portion of the invocation. It is compiled and linked with server code. It calls the actual procedure implemented at the server.
What is binding in RPC?
The client must locate and bind to the server. It creates/obtains a handle to the server. Encapsulates information such as IP address, port number, ethernet address, etc..
What are the advantages and disadvantages of static binding?
Advantage: Simple and efficient.
Disadvantages: Client and server are tightly coupled. Server location changes requires recompilation. Dynamic load balancing with multiple servers is not possible.
What are the advantages and disadvantages of dynamic binding?
Advantages: Addresses the problems of static binding. One can have load balancing, more sophisticated selection, etc. And no problem to change server address.
Disadvantages: It is more complex and needs a name and directory service, because it is based on logical names, signatures of procedures.
explain the 2 variants of RPC
RPC variation 1 - Distributed objects (Java RMI)
Application consists of distributed object components. Object services are invoked using Remote Method Invocation (RMI).
It utilizes/matches advantages of object-oriented computing: Object identity, encapsulation, inheritance, polymorphism, interface vs. implementation, reusability.
RPC variation 2 - stored procedures:
Named persistent code to be invoked in SQL, executed by the DBMS (SQL CALL statement)
It’s created directly in a db schema.
Stored procedure creation requires: header (signature) and body (implementation).