4 - RPC and Distributed Transactions Flashcards

1
Q

What are the goals and main ideas of RPC?

A

Approach for communication of subsystems in a distributed IS. Use notion of procedure to TRANSPARENTLY call code residing in a remote node.

In distributed IS, it is important to support distributed transactions

A simple programming model: ABSTRACT LOCATION: transparency + heterogeneity

Fundamental concept in the middleware (RPC = abstraction + infrastructure)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Give an overview of how RPC works

A

1 - Define remote interface using IDL (interface definition language). Abstract representation of procedure (signature): input + output (Can be language independent)

2 - compile interface with IDL-compiler: Clients stub (proxy) + server stub (skeleton)

Proxy: linked with client application - serialize arguments, sends package, unpack and deliver results

Skeleton: server side of communication - invokes target procedure, sends result back

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Explain the concept of Binding in RPC and its approaches

A

Step where client (proxy) locates and binds to the appropriate sever (obtain server handle (EPR))

Static binding: handle specified in the code of client stub. Simple and efficient, but tighly coupled / inflexible.

Dynamic binding: name and directory service (level of indirection (load balancing!)). Registers available procedures, provide handles to the clients. Look up API can be on client or in separate ND service.

  • Helps to achieve location transparency (but not on dynamic case: needs to locate handle)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the basic idea of the distributed objects variation of RPC?

A

Extend RPC concepts for objects: remote method invocation - utilizes advantages of OO programming.

Locate and bind to remote object (client stub can be ……

Also implemented by object-based middleware (CORBA, EJB)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Give an overview of the development process with RMI

A

JAVA = IDL + prog. language

  • Define remote interface, implement corresponding class on server side (Comm is transparent)
  • Client instantiates interface with lookup in registry, which connects to remote object
  • Server must add binding procedures to constructor code of object
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How does the deployment and runtime process work in RMI?

A

Deployment = generate stub and skeleton + invoke server code that creates and registers remote object

Runtime = client stub can be download when performing lookup (transparently invoke methods)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Give an overview of stored procedures as an RPC variation

A

Standard SQL stored procedures: can be implemented in Java/C

Invoked with SQL CALL statement, no IDL, signature specified in header of CREATE PROCEDURE (no stub/skeleton)

Invocation is not transparent! Packing/unpacking incorporated in DB-GW

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Give an overview of Transactional RPC and its requirements

A

Support for transaction with RPC! Distributed (2PC)

Servers become resource managers

RPCs are issued in the context of a transaction, specified on the client by BOT/EOT boundaries.
- TRPC stubs transmit TA-context with invocation (TR-ID global)

Additional steps: bind RPC to TRID, register receivers as TA-participants, bind processes to transactions: if proc. terminates, TA must be aborted.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Give an overview of the X/OPEN standard in the local scenario

A

Standardization of transaction processing in distributed systems

3-componets: APP, TA-manager, Resource-manager

Interactions:

    • AP -> TM: being of transaction, generates global TRID
    • TM -> RM: optionally communicate TRID to preferred/freq. used RMs (start msg)
    • AP -> RM: requests (SQL) together with TRID. If RM does not know that TRID, perform join with TM
    • AP -> TM: end of transaction (commit/rollback): completes with 2PC (RM = agent, TM = coordinator). Prepare, commit, callback msg from TM to RMs
  • Thread of control associated to at most one TRID at a time
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How does the distributed extension of X/OPEN work?

A

Occurs just like local X/OPEN until a remote request (TRPC) is issued by AP.

  • Adds a communication manager to the picture:
    • AP -> CM: issues remote request
    • CM -> TM: notifies that transaction context is leaving local environment (out going)
    • CM -> CM: relays request to remote node
    • CM -> TM: notifies there is a new transaction coming from remote node (in coming). At this point, TM can start the server if necessary
    • CM -> Server: delivers TRPC to server implementing the procedure
    • Server -> RM: processes request like in local environment
  • When commit happens:
    • AP -> TM: end of transaction - because of previous outgoing msg from CM, the TM knows it must perform Hierarchical-2PC. CM acts as an agent, relaying 2PC messages to and from remote TM (local CM + remote CM)
  • Variations of XOPNE/DTP cocur in object-based middlware (CORBA OTS, Java JTA/JTS). Foundation of disributed transactions.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly