Shared Flashcard Set

Details

COMP3017 - Lecture 8 (A) - Message Queues
COMP3017 - Lecture 8 (A) - Message Queues
22
Computer Science
Undergraduate 2
05/04/2014

Additional Computer Science Flashcards

 


 

Cards

Term
Give an overview on transactions
Definition
  • Complete units of work - ACID
  • Transactions may be distributed across more than one processor
    • Dedicated link between programs
    • Operations synchronized
    • Distributed two phase commit
  • Many transactions need not be competed synchronously
    • Communication must still be guaranteed
    • Work can be completed later
Term
Give a comparison of synchronous vs anynchronous DBMSs
Definition
  • HTTP is a synchronous protocol
    • Request from client to server is followed by reply from server to client in the same TCP connection
  • SMTP is an asynchronous protocol
    • Email messages are sent on a store-and-forward basis
    • Final message recipint need not be available when message is sent
Term
What are the principles of Message Queuing?
Definition
  • Enables programs to communicate accross a network asynchronously
    • No private, dedicated link required
    • Systems can be heterogeneous
    • Message delivery is guaranteed
  • Messages are placed on queues by one system and taken off by another
    • Similar idea to email, but more sophisticated mechanism
  • MQ can also be used between programs running on the same system
Term
What are the weakenesses of conventional (direct) transaction processing?
Definition
  • Designed for synchronous processing
  • Has difficulties with long-lived transactions and communication errors
  • Difficult to balance loads between several servers carrying out the same tasks
  • Difficult to prioritise one request over another
Term
Describe a server failure in a direct transaction processing problem
Definition
  • If server is down, client does not receive immediate answer
  • Cannot distinguish between:
    • Request not delivered to server
    • Server failure
    • Reply not delivered to client
Term
Describe a client failure in a direct transaction processing problem
Definition
Cannot tell if response has been received by client
Term
Describe an unbalanced load in a direct transaction processing problem
Definition
Cannot ensure that severs carrying out a task have an even load
Term
Describe a no prioritisation in a direct transaction processing problem
Definition
Tasks handled on a first-come, first-served basis; cannot process high-priority requests early
Term
What are the pricniple components of message queues?
Definition
  • Client - adds request to the queue (enqueues)
  • Server - removes request from queue (dequeues)

If server is unavailable (busy, down, disconnected), the request is stored in the queue until the server is able to process it

Term
What are the characteristics of bidirectional queues?
Definition
Communication is bidirectional between client and server, and requires a separate queue for communication in each direction.
Term
What is the application structure?
Definition
[image]
Term
What is the principle of load balancing?
Definition
When a sever finishes processing a request, it takes the next from the queue
Term
Show a diagram of queued transaction processing
Definition
[image]
Term
What happens if the transaction aborts in a queued transaction processing?
Definition
  • Request returned to input queue
  • Changes made by transaction are rolled back
  • If necessary, reply removed from output queue

Repeated aborts (due to poisoned message) may be prevented with a maximum limit on replies

Term
Show a diagram of multiple transactions in queued transaction processing
Definition
[image]
Term
What are some principles of message ordering?
Definition
  • Description of message queues so far does not consider how messages are ordered in a queue
    • First-come, first-served
    • Highest-priority-first
  • Aborted transactions may lead to out-of-order processing:
    • T1 dequeues M1
    • T2 dequeues M2
    • T2 commits
    • T1 aborts, returns M1 to queue
Term
What are the benefits of message queueing?
Definition
  • Simple APIs hide communication complexity
  • Fewer constraints on inter-program operation
    • Programs comunicate indirectly - asynchronous
    • Client and serve do not need to be running at the same time
  • Fewer network sessions needed, and programs are less vulnerable to network failures
  • Business change easier to hadnle
  • Assured message delivery
  • Asynchronous transaction processing
Term
What are the implementation and standards of message queuing?
Definition
  • Message Queuing is not a new idea - used, for example, within IBM's IMS 30 years ago
  • Both proprietary and open source APIs and platforms
    • IBM websphere MQ, Microsoft Message Queueing, Oracle Advanced Queuing
    • Apache ActiveMQ, Rabbit MQ
  • Some products inter-operate via common standards
    • AMQP, MQTT
Term
  • Solve the following Problem
    • Insurance agents throughout the country request insurance quotations using an online system
    • This system is implemented as a traditional client server application, with client programs (the insurrance agents) sending requests for quotations to a central server program.
    • The server does some calculations using data from a central insurrance database, then sends quotation to the requesting agent
Definition
  • Client programs put request messages on a single queue, from which the server program takes them
  • Responses may be sent back to clients via extra message queues (one per client)
Term
  • Solve the following problem
    • A device providing a service is output-only and does not send messages back to the requester. Only one-way message flows are required
    • Output-only devices
      • Printing devices
      • Displays: Stock exchange, Flight arrivals and departures
      • Factory floor robotics
Definition

Robotics controller is in control of an automated manufacturing process. It puts messages on:

      • Queue 1 for the robotics program, which directs some welding machinery and on
      • Queue 2 for the robotics B program, whch controls a paint sprayer
Term
  • Solve the following problem
    • A department store writes its sales figures to a file throughout the day's trading. Overnight, a report of the day's sales is produced using this file of data as input. The report must be on the sales manager's desk before the next day's trading begins
      • The amount of time available for producing the report is limited to the "window" of time between the end of business on one day nad the start of business of the next
Definition
Instead of operating in a sequence and communicating via a file, the two programs could run independently using a message queue
Supporting users have an ad free experience!