Tuesday, June 23, 2009

Exercise 19: TP monitors and transaction protocols

  1. Give a description in your own words of the ACID properties of a transaction.
  2. Atomic means that all portions of a transaction will process successfully or none of them will.
    Consistant means that if a transaction is repeated then the same result will eventuate.
    Isolated means that the transaction is not affected by other transactions.
    Durable means that the result are stored permanently.
  3. Describe a TP monitor environment. How can a TP monitor stop an operating system being overwhelmed?
  4. A TP (Transaction Processing) monitor is a complex program which manages the execution of a transaction starting with the client executing the transaction; it will normally employ a number of servers and then return any results to the client. TP monitors carry out two important processes: they manage the concurrent execution of the threads and processes that make up a transaction and ensure that the ACID properties detailed earlier in the chapter are enforced; for example, a TP monitor ensures that when a transaction updates a shared item of data when other transactions wish to access the data then the result of the updating is consistent.(Ince, p365)
  5. What is difference in load balancing with traditional and transactional MOM, RPC and conversations?
  6. According to (Wikipedia) load balancing is a technique to spread work between two or more computers, network links, CPUs, hard drives, or other resources, in order to get optimal resource utilization, maximize throughput, and minimize response time.

    Message-oriented middleware (MOM) is infrastructure focused on message sending that increases the interoperability, portability, and flexibility of an application by allowing the application to be distributed over multiple heterogeneous platforms. It reduces the complexity of developing applications that span multiple operating systems and network protocols by insulating the application developer from the details of the various operating system and network interfaces

    In traditional MOM, messages are addressed to their recipients, although sender and receiver are loosely coupled and need not synchronise to communicate.(IEEE)

    Remote procedure call (RPC) is an Inter-process communication technology that allows a computer program to cause a subroutine or procedure to execute in another address space (commonly on another computer on a shared network) without the programmer explicitly coding the details for this remote interaction.

  7. How can TP Monitors save money?
  8. TP monitors save money by making use of the processer idle time between user requests. This usage relieves the need for purchasing additional hardware for each individual to utilise. It also means that you make the hardware that you do have work more efficiently from a business perspective.
  9. Why is a two-phase commit protocol better than a one-phase atomic commit protocol?
  10. The two-phase commit protocol is better in a distributed environment in that it allows a server to make a unilateral decision to abort a transaction if required.
    (Ince, p361) The description of the protocol is detailed below in steps 3.1 to 3.4. The general rule about aborting or committing a transaction is: 1. If the client requests that a transaction is aborted, for example the client is building up an order in a shopping cart and decides not to complete the order, then the coordinator will inform all the servers involved in the transaction that they should abort. 2. If one of the servers decides to abort a transaction, for example in order to release a lock, then the coordinator informs all the servers involved in the transaction; they will then all abort. 3. If the client asks for a transaction to be committed then the two-phase commit protocol starts and steps 3.1 to 3.4 are carried out. 3.1 The coordinator asks each server whether they can commit. 3.2 Each server decides whether it can commit or not and sends back a reply which indicates the result of its decision. If it cannot commit then it aborts its transaction. 3.3 If all the servers have voted to commit their transactions then the coordinator informs all the servers that they can commit. 3.4 If at least one server cannot commit then the coordinator decides to abort the transaction and sends an abort message to all the servers involved. 4. Those servers which have agreed to commit to a transaction wait for the final decision from the coordinator. This will be either a commit instruction or an abort instruction. They will then act on this.
  11. What is CICS by IBM?
  12. (Ince, p365-366) CICS is a complex TP monitor marketed by IBM. It will:
    • Initiate and destroy threads to carry out transactional operations. Many transaction monitors will access a pool of threads which have been set up when the monitor was started.
    • Manage the resources that are being accessed, for example ensuring that updates are carried out in such a way that the resource does not lend itself in an inconsistent state.
    • Ensure that if a transaction fails then suitable action is taken; this action can be provided by a programmer as code to be executed. In order to do this most TP monitors will use a two-phase atomic commit protocol.
    • Schedule threads so that low-priority transactions, for example batch transactions, are allocated a smaller share of resources than high-priority transactions such as online transactions.
    • Enable the processing load on a distributed system to be shared between a number of servers.
    • Enable a distributed system to function – even in the presence of the failure of one or more servers.

References
IEEE, (2009). Message-Oriented Middleware. Retrieved 9 July 2009, from http://dsonline.computer.org/portal/site/dsonline/menuitem.9ed3d9924aeb0dcd82ccc6716bbe36ec/index.jsp?&pName=dso_level1&path=dsonline/topics/middleware&file=intro_MOM.xml&xsl=article.xsl
Ince, D. (2006). Developing Distributed & E-commerce Applications: Prentice-Hall, Inc. Upper Saddle River, NJ, USA.
Wikipedia. Load balancing (computing). Retrieved 9 July 2009, from http://en.wikipedia.org/wiki/Load_balancing_(computing)
Wikipedia. Message-oriented middleware. Retrieved 9 July 2009, from http://en.wikipedia.org/wiki/Message-oriented_middleware
Wikipedia. Remote procedure call. Retrieved 9 July 2009, from http://en.wikipedia.org/wiki/Remote_procedure_call

No comments:

Post a Comment