Вы находитесь на странице: 1из 18

http://en.wikipedia.

org/wiki/Transaction_processing_system

Transaction processing system y y is a type of information system. collect, store, modify, and retrieve the transactions of an organization.

A transaction is an event that generates or modifies data that is eventually stored in an information system. To be considered a transaction processing system the computer must pass the ACID test. y The essence of a transaction program is that it manages data that must be left in a consistent state. o Example:  if an electronic payment is made, the amount must be both withdrawn from one account and added to the other; it cannot complete only one of those steps. Either both must occur, or neither.  In case of a failure preventing transaction completion, the partially executed transaction must be 'rolled back' by the TPS. While this type of integrity must be provided also for batch transaction processing, it is particularly important for online processing: o Example:  an airline seat reservation system is accessed by multiple operators, after an empty seat inquiry, the seat reservation data must be locked until the reservation is made, otherwise another user may get the impression a seat is still free while it is actually being booked at the time.  Without proper transaction monitoring, double bookings may occur. Other transaction monitor functions include deadlock detection and resolution (deadlocks may be inevitable in certain cases of cross-dependence on data), and transaction logging (in 'journals') for 'forward recovery' in case of massive failures.

Transaction Processing is not limited to application programs. The 'journaled file system' provided with IBMs AIX Unix operating system employs similar techniques to maintain file system integrity, including a journal. Contents [hide]

y y y

1 Types o 1.1 Contrasted with batch processing o 1.2 Real-time and batch processing 2 Features o 2.1 Rapid response o 2.2 Reliability o 2.3 Inflexibility o 2.4 Controlled processing 3 ACID test properties: first definition o 3.1 Atomicity o 3.2 Consistency o 3.3 Isolation o 3.4 Durability o 3.5 Concurrency 4 Storing and retrieving o 4.1 Databases and files o 4.2 Data warehouse o 4.3 Backup procedures  4.3.1 Recovery process  4.3.2 Types of back-up procedures  4.3.2.1 Grandfather-father-son  4.3.2.2 Partial backups  4.3.3 Updating in a batch  4.3.4 Updating in real-time 5 References 6 See also 7 Further reading

Types Contrasted with batch processing y y Batch processing is not transaction processing. Batch processing involves processing several transactions at the same time, and the results of each transaction are not immediately available when the transaction is being entered; there is a time delay. Transactions are accumulated for a certain period (say for day) where updates are made especially after work.

Real-time and batch processing There are a number of differences between real-time and batch processing. These are outlined below:

y y

Each transaction in real-time processing is unique. It is not part of a group of transactions, even though those transactions are processed in the same manner. Transactions in real-time processing are stand-alone both in the entry to the system and also in the handling of output. Real-time processing requires the master file to be available more often for updating and reference than batch processing. The database is not accessible all of the time for batch processing. Real-time processing has fewer errors than batch processing, as transaction data is validated and entered immediately. With batch processing, the data is organised and stored before the master file is updated. Errors can occur during these steps. Infrequent errors may occur in real-time processing; however, they are often tolerated. It is not practical to shut down the system for infrequent errors. More computer operators are required in real-time processing, as the operations are not centralised. It is more difficult to maintain a real-time processing system than a batch processing system.

Features Rapid response y y Fast performance with a rapid response time is critical. Businesses cannot afford to have customers waiting for a TPS to respond, the turnaround time from the input of the transaction to the production for the output must be a few seconds or less.

Reliability y y y Many organizations rely heavily on their TPS; a breakdown will disrupt operations or even stop the business. For a TPS to be effective its failure rate must be very low. If a TPS does fail, then quick and accurate recovery must be possible. This makes welldesigned backup and recovery procedures essential.

Inflexibility y y A TPS wants every transaction to be processed in the same way regardless of the user, the customer or the time for day. If a TPS were flexible, there would be too many opportunities for nonstandard operations, o Example:  a commercial airline needs to consistently accept airline reservations from a range of travel agents, accepting different transactions data from different travel agents would be a problem.

Controlled processing y y The processing in a TPS must support an organization's operations. Example: o if an organization allocates roles and responsibilities to particular employees, then the TPS should enforce and maintain this requirement. An example of this is an ATM transaction.

ACID test properties: first definition Atomicity Main article: Atomicity (database systems) y A transactions changes to the state are atomic: either all happen or none happen. These changes include database changes, messages, and actions on transducers.

Consistency y y A transaction is a correct transformation of the state. The actions taken as a group do not violate any of the integrity constraints associated with the state. This requires that the transaction be a correct program

Isolation y Even though transactions execute concurrently, it appears to each transaction T, that others executed either before T or after T, but not both.

Durability y Once a transaction completes successfully (commits), its changes to the state survive failures.

Concurrency y Ensures that two users cannot change the same data at the same time. That is, one user cannot change a piece of data before another user has finished with it. Example: o if an airline ticket agent starts to reserve the last seat on a flight, then another agent cannot tell another passenger that a seat is available.

Storing and retrieving y y Storing and retrieving information from a TPS must be efficient and effective. The data are stored in warehouses or other databases, the system must be well designed for its backup and recovery procedures.

Databases and files y The storage and retrieval of data must be accurate as it is used many times throughout the day. A database o is a collection of data neatly organized, which stores the accounting and operational records in the database. o are always protective of their delicate data, so they usually have a restricted view of certain data. o designed using hierarchical, network or relational structures; each structure is effective in its own sense. Hierarchical structure y y organizes data in a series of levels, hence why it is called hierarchal. Its top to bottom like structure consists of nodes and branches; each child node has branches and is only linked to one higher level parent node.

Network structure y y Similar to hierarchical, network structures also organizes data using nodes and branches. But, unlike hierarchical, each child node can be linked to multiple, higher parent nodes.

Relational structure y Unlike network and hierarchical, a relational database organizes its data in a series of related tables. This gives flexibility as relationships between the tables are built.

A relational structure.

A hierarchical structure.

A network structure.

The following features are included in real time transaction processing systems: Good data placement y The database should be designed to access patterns of data from many simultaneous users.

Short transactions y Short transactions enable quick processing. This avoids concurrency and paces the systems.

Real-time backup y Backup should be scheduled between low times of activity to prevent lag of the server.

High normalization y This lowers redundant information to increase the speed and improve concurrency, this also improves backups.

Archiving of historical data y Uncommonly used data are moved into other databases or backed up tables. This keeps tables small and also improves backup times.

Good hardware configuration y Hardware must be able to handle many users and provide quick response times.

In a TPS, there are 5 different types of files. The TPS uses the files to store and organize its transaction data: 1. Master file y Contains information about an organizations business situation. y Most transactions and databases are stored in the master file. 2. Transaction file y It is the collection of transaction records. y It helps to update the master file and also serves as audit trails and transaction history. 3. Report file y Contains data that has been formatted for presentation to a user. 4. Work file y Temporary files in the system used during the processing. 5. Program file y Contains the instructions for the processing of data.

Data warehouse Main article: Data warehouse A database that collects information from different sources. When it's gathered in real-time transactions, it can be used for analysis efficiently if it's stored in a data warehouse. It provides data that are consolidated, subject-oriented, historical and read-only: Consolidated y Data are organised with consistent naming conventions, measurements, attributes and semantics. It allows data from a data warehouse from across the organization to be effectively used in a consistent manner.

Subject-oriented y Large amounts of data are stored across an organization. Some data could be irrelevant for reports and makes querying the data difficult. It organizes only key business information from operational sources so that it's available for analysis.

Historical y Real-time TPS represent the current value at any time; an example could be stock levels. If past data are kept, querying the database could return a different response. It stores series of snapshots for an organisation's operational data generated over a period of time.

Read-only y Once data are moved into a data warehouse, it becomes read-only, unless it was incorrect. Since it represents a snapshot of a certain time, it must never be updated. Only operations which occur in a data warehouse are loading and querying data.

Backup procedures

A Dataflow Diagram of backup and recovery procedures. Since business organizations have become very dependent on TPSs, a breakdown in their TPS may stop the business' regular routines and thus stopping its operation for a certain amount of time. In order to prevent data loss and minimize disruptions when a TPS breaks down a well-designed backup and recovery procedure is put into use. The recovery process can rebuild the system when it goes down.

Recovery process A TPS may fail for many reasons. These reasons could include y y y y y y a system failure, human errors, hardware failure, incorrect or invalid data, computer viruses, software application errors or natural or man-made disasters.

As it's not possible to prevent all TPS failures, a TPS must be able to cope with failures. The TPS must be able to detect and correct errors when they occur. A TPS will go through a recovery of the database to cope when the system fails; it involves the backup, journal, checkpoint, and recovery manager: Journal y y A journal maintains an audit trail of transactions and database changes. Transaction logs and Database change logs are used, o a transaction log records all the essential data for each transactions, including data values, time of transaction and terminal number. o A database change log contains before and after copies of records that have been modified by transactions.

Checkpoint y y y y y The purpose of checkpointing is to provide a snapshot of the data within the database. A checkpoint, in general, is any identifier or other reference that identifies at a point in time the state of the database. Modifications to database pages are performed in memory and are not necessarily written to disk after every update. Therefore, periodically, the database system must perform a checkpoint to write these updates which are held in-memory to the storage disk. Writing these updates to storage disk creates a point in time in which the database system can apply changes contained in a transaction log during recovery after an unexpected shut down or crash of the database system.

If a checkpoint is interrupted and a recovery is required, then the database system must start recovery from a previous successful checkpoint. Checkpointing can be either transaction-consistent or non-transaction-consistent (called also fuzzy checkpointing).

Transaction-consistent checkpointing produces a persistent database image that is sufficient to recover the database to the state that was externally perceived at the moment of starting the checkpointing. A non-transaction-consistent checkpointing results in a persistent database image that is insufficient to perform a recovery of the database state. To perform the database recovery, additional information is needed, typically contained in transaction logs. o Transaction consistent checkpointing refers to a consistent database, which doesn't necessarily include all the latest committed transactions, but all modifications made by transactions, that were committed at the time checkpoint creation was started, are fully present. o A non-consistent transaction refers to a checkpoint which is not necessarily a consistent database, and can't be recovered to one without all log records generated for open transactions included in the checkpoint. Depending on the type of database management system implemented a checkpoint may incorporate indexes or storage pages (user data), indexes and storage pages. If no indexes are incorporated into the checkpoint, indexes must be created when the database is restored from the checkpoint image.

Recovery Manager y y y A recovery manager is a program which restores the database to a correct condition which can restart the transaction processing. Depending on how the system failed, there can be two different recovery procedures used. Generally, the procedures involves restoring data that has been collected from a backup device and then running the transaction processing again. Two types of recovery are backward recovery and forward recovery: o Backward recovery  used to undo unwanted changes to the database. It reverses the changes made by transactions which have been aborted. It involves the logic of reprocessing each transaction, which is very time-consuming. o Forward recovery  it starts with a backup copy of the database. The transaction will then reprocess according to the transaction journal that occurred between the time the backup was made and the present time. It's much faster and more accurate.

See also: Checkpoint restart

Types of back-up procedures There are two main types of Back-up Procedures: Grandfather-father-son and Partial backups: y Grandfather-father-son o This procedure refers to at least three generations of backup master files. Thus, the most recent backup is the son, the oldest backup is the grandfather. o It's commonly used for a batch transaction processing system with a magnetic tape. o If the system fails during a batch run, the master file is recreated by using the son backup and then restarting the batch. o However if the son backup fails, is corrupted or destroyed, then the next generation up backup (father) is required. o Likewise, if that fails, then the next generation up backup (grandfather) is required. o Of course the older the generation, the more the data may be out of date. Organizations can have up to twenty generations of backup. Partial backups o This only occurs when parts of the master file are backed up. o The master file is usually backed up to magnetic tape at regular times, this could be daily, weekly or monthly. o Completed transactions since the last backup are stored separately and are called journals, or journal files. o The master file can be recreated from the journal files on the backup tape if the system is to fail.

Updating in a batch y This is used when transactions are recorded on paper (such as bills and invoices) or when it's being stored on a magnetic tape. Transactions will be collected and updated as a batch at when it's convenient or economical to process them. Historically, this was the most common method as the information technology did not exist to allow real-time processing. The two stages in batch processing are: o o Collecting and storage of the transaction data into a transaction file this involves sorting the data into sequential order. Processing the data by updating the master file - which can be difficult, this may involve data additions, updates and deletions that

may require to happen in a certain order. If an error occurs, then the entire batch fails. y Updating in batch requires sequential access - since it uses a magnetic tape this is the only way to access data. A batch will start at the beginning of the tape, then reading it from the order it was stored; it's very time-consuming to locate specific transactions. The information technology used includes a secondary storage medium which can store large quantities of data inexpensively (thus the common choice of a magnetic tape). The software used to collect data does not have to be online - it doesn't even need a user interface.

Updating in real-time y This is the immediate processing of data. It provides instant confirmation of a transaction. This involves a large amount of users who are simultaneously performing transactions to change data. Because of advances in technology (such as the increase in the speed of data transmission and larger bandwidth), real-time updating is now possible. Steps in a real-time update involve the sending of a transaction data to an online database in a master file. The person providing information is usually able to help with error correction and receives confirmation of the transaction completion. Updating in real-time uses direct access of data. This occurs when data are accessed without accessing previous data items. The storage device stores data in a particular location based on a mathematical procedure. This will then be calculated to find an approximate location of the data. If data are not found at this location, it will search through successive locations until it's found. The information technology used could be a secondary storage medium that can store large amounts of data and provide quick access (thus the common choice of a magnetic disk). It requires a user-friendly interface as it's important for rapid response time.

Reservation Systems y Reservation systems are used for any type of business where a service or a product is set aside for a customer to use for a future time.

Transaction processing system y y y is a program or software that processes all transactions that go in and out of a business or a company. The system goes over the transactions one by one, like in an automated teller machine (ATM) that permits only one user at a time. The term transaction, in this case, does not only refer to financial aspects, but to requests for information as a whole, such as booking a flight or just logging into an online bank account.

In direct contrast to a transaction processing system is a batch processing system. y y y This system processes multiple transactionsor a batch of transactions simultaneously. The main disadvantage is that the processed transactions do not return immediate results. A modern analogy is a torrent file connected to a folder of files. The user cannot immediately access a file until all the files in the folder are completely downloaded.

The transaction process, on the contrary, yields real-time results that create more convenience and less confusion. o For example, an online shopper can instantly see the number of available products decrease as other shoppers are putting the products into their online shopping cart.

The software or program usually undergoes an ACID test to qualify as a transaction processing system. ACID stands for Atomicity, Consistency, Isolation, and Durability. Atomicity y y refers to the systems ability to carry out or forgo a transaction in its entirety. For example, registering for an online bank account requires the user to input necessary information. Leaving a field blank or closing the window will make the user forfeit his registration.

Consistency y in a transaction processing system means that the system should operate under the limitations of integrity constraints of database management. Simply put, the programming should be correct.

The characteristic of isolation means that each transaction is treated as separate and different, even if the same transactions are occurring at the same time. Durability of the system indicates that if a transaction is successfully carried out, it cannot be reversed. In case of a systems failure, the program should still retain the data through an encoded log. Aside from the necessary features that pass the ACID test, a transaction processing system should also be reliable. This means the program has a minimum or zero chance of failing. In situations of a breakdown, recovery should be swift, and a backup system also immediately kicks in. The system should also be fully accessible to limited users only. For example, a visitor can choose which seat to take in an airplane flight, but cannot cancel a reserved seat by a previous visitor, a task only an experienced programmer or staff can perform.

Transaction processing is a computer-based group of logical operations. In order for transaction processing to work, all the operations must succeed or fail as a group. A simple example of transaction processing is paying a utility bill from your bank account. The process of paying a bill from your account consists of debiting your account by say, 100 US dollars (USD), and crediting your utility providers account. This may seem like a simple transaction, but it may actually consist of several suboperations. If the debit of 100 USD was successful, but the credit did not go through to the utility providers account, then the transaction would fail. Your 100 USD would be lost somewhere in the transaction. The transaction processing system allows all the operations to be grouped into a single transaction in order to prevent problems in consistency. Systems capable of transaction processing must pass tests for atomicity, consistency, isolation and durability, otherwise known as the ACID test. Transactions are known as atomic, meaning that the transaction will either happen or not. If one account is debited, then another account has to be credited. The transaction processing system must always be consistent with its own rules. If errors occur in the transaction on either side, then the transaction will fail. Isolating transactions means that other processes never see information during the transaction. They may see information before or after the transaction, but not during the transaction. For example, if two people are booking the last theatre seat at the same time, they can both see the seat before the booking, but only one person will succeed in booking that seat. Transactions must be durable. This means that when that final seat in the theatre has been booked and you have received notification that the seat is yours, it is permanently recorded. No matter what problems occur to the system, there are back-ups in place in the transaction processing system to ensure that the record stays permanent. Transaction processing systems have been available since the 1970s, and nearly all businesses use them. The advent of the Internet has seen a boom in transaction processing systems and software. Over the years, the cost of buying and implementing the necessary software has dropped so much that most businesses can apply it profitably. Banking from home, booking a holiday on the net, shopping and working from home are all now readily available and less time consuming, thanks to transaction processing.

The success of commercial enterprises depends on the reliable processing of transactions to ensure that customer orders are met on time, and that partners and suppliers are paid and can make payment. The field of transaction processing, therefore, has become a vital part of effective business management, led by such organisations as the Association for Work Process Improvement and the Transaction Processing Performance Council. Transaction processing systems offer enterprises the means to rapidly process transactions to ensure the smooth flow of data and the progression of processes throughout the enterprise. Typically, a TPS will exhibit the following characteristics: Rapid Processing The rapid processing of transactions is vital to the success of any enterprise now more than ever, in the face of advancing technology and customer demand for immediate action. TPS systems are designed to process transactions virtually instantly to ensure that customer data is available to the processes that require it. Reliability Similarly, customers will not tolerate mistakes. TPS systems must be designed to ensure that not only do transactions never slip past the net, but that the systems themselves remain operational permanently. TPS systems are therefore designed to incorporate comprehensive safeguards and disaster recovery systems. These measures keep the failure rate well within tolerance levels. Standardisation Transactions must be processed in the same way each time to maximise efficiency. To ensure this, TPS interfaces are designed to acquire identical data for each transaction, regardless of the customer. Controlled Access Since TPS systems can be such a powerful business tool, access must be restricted to only those employees who require their use. Restricted access to the system ensures that employees who lack the skills and ability to control it cannot influence

the transaction process. Transactions Processing Qualifiers In order to qualify as a TPS, transactions made by the system must pass the ACID test. The ACID tests refers to the following four prerequisites: Atomicity Atomicity means that a transaction is either completed in full or not at all. For example, if funds are transferred from one account to another, this only counts as a bone fide transaction if both the withdrawal and deposit take place. If one account is debited and the other is not credited, it does not qualify as a transaction. TPS systems ensure that transactions take place in their entirety. Consistency TPS systems exist within a set of operating rules (or integrity constraints). If an integrity constraint states that all transactions in a database must have a positive value, any transaction with a negative value would be refused. Isolation Transactions must appear to take place in isolation. For example, when a fund transfer is made between two accounts the debiting of one and the crediting of another must appear to take place simultaneously. The funds cannot be credited to an account before they are debited from another. Durability Once transactions are completed they cannot be undone. To ensure that this is the case even if the TPS suffers failure, a log will be created to document all completed transactions. These four conditions ensure that TPS systems carry out their transactions in a methodical, standardised and reliable manner. Types of Transactions While the transaction process must be standardised to maximise efficiency, every enterprise requires a tailored transaction process that aligns with its business strategies and processes. For this reason, there are two broad types of transaction: Batch Processing Batch processing is a resource-saving transaction type that stores data for processing at pre-defined times. Batch processing is useful for enterprises that need to process large amounts of data using limited resources.

Examples of batch processing include credit card transactions, for which the transactions are processed monthly rather than in real time. Credit card transactions need only be processed once a month in order to produce a statement for the customer, so batch processing saves IT resources from having to process each transaction individually. Real Time Processing In many circumstances the primary factor is speed. For example, when a bank customer withdraws a sum of money from his or her account it is vital that the transaction be processed and the account balance updated as soon as possible, allowing both the bank and customer to keep track of funds. Further information regarding transaction processing systems can be found at the University of Illinois and John Hopkins University.

Вам также может понравиться