Summary
Keywords
Full Transcript
Database systems need to deal with transaction management. A database transaction is a set of related queries that must be either completed or rejected as a whole. Otherwise, there may be some queries with inconsistent or incorrect data. For example, If there was Venmo transaction transfers funds from one bank account to another. If they buyer sends $50 from his or her account to the sellers account, but if only the first query was successful where the money was sent, but the second query fails and the $50 is not received by the buyer, then where did that money go? To prevent incorrect data, the transaction either processes both queries if they are successful, or process none of them if a query fails. When processing transactions, databases must: Process all or nothing. A computer or application might fail while processing a transaction, and must reverse partial results, restoring the database to the values prior to the transaction. - Prevent conflicts. A conflict occurs when multiple transactions access the same data at the same time. Ex: Bob selects a seat on an airplane flight. Mary buys the same seat in a different transaction before Bob completes his transaction. When Bob clicks the 'purchase' button, his seat is no longer available. - Prevent data loss. All transaction, whether successful or failed, must always be saved on storage, when completed. Subscribe to Appficial for more programming videos coming soon. Also, don't forget to click LIKE and comment on the video if it helped you out!
