Real Time happens live! And it means there's no turning back!
Batch Processing means things are put into queue and it is processed when a certain amount if items is reached, or when a certain period has passed.
Transaction is like real time except that it allows you to rollback, or to undo changes.
In a bank transaction, Bob tried to deposit money to his account.
In REAL TIME, the money is DEPOSITED right away as soon as Bob handed the money.. and there's no turning back! :)
In BATCH PROCESSING, the bank would just queue Bob's request to deposit amount. A better example would be if you try to deposit money to a foreign account (bank account in another country), the bank would just put your request in queue with all the other inter-bank/country requests and process them at the end of the day or when they reach a certain amount.
In TRANSACTIONS, it's just like the first example, but you have the option to "cancel" it. If you have heard of SQL Queries, you can do something like this:
BEGIN; #signifies transaction started
DELETE FROM tablename; #deletes everything from a table!
ROLLBACK; #cancels the deletion and restores the data, it also ends the "transaction"
You can also do this:
BEGIN; #start of transaction
DELETE FROM tablename; #delete data!
COMMIT; #oops! data deleted, no going back now. end of transaction! :)
Hope it helps.
· 1 decade ago