The Sidekick event could’ve been avoided by setting up a proper backup flow using database transactions.Īnother data loss incident that could’ve been avoided using transactions is the AMAG Pharmaceuticals data loss incident. One of Sidekick's third-party providers neglected to establish a proper backup architecture using transactions, which ultimately led to all the data on these devices being lost forever. One noteworthy example is the Microsoft Sidekick incident. There have been many cases when DBAs failed to use transactions and lost crucial data. Transactions also add a layer of protection that can prevent simple mistakes from causing catastrophic failures. Transactions can also simplify many tasks by automating part or most of the work. Many database administrators use transactions to take advantage of a database's various features. The main selling point for transactions is that they are easy to handle. Why Database Administrators use Transactions This means that they are also pretty durable and dependable. If one transaction fails due to some reason, the database remains unaffected and the other transactions may still go through. PostgreSQL transactions are also isolated. If you want to learn more about what it means to be ACID compliant and what other kinds of compliance there are, please check out this article. They are the most fundamental unit of any database and are hence atomic. Transactions are consistent in the sense that the changes are propagated throughout the database at the same time-in other words, there won’t be any discrepancies. That means they are consistent, atomic, durable, and isolated. The important thing to note about PostgreSQL transactions is that they are ACID compliant. In real-world applications, transactions are usually a combination of various database operations. A transaction need not just be a single change, rather, it can contain one or more operations. Let's say that you added a new element to the database-that’s an example of a transaction. Simply put, transactions are propagations to any change in the database. In this article, we’ll answer all of those questions and more to help you get started with PostgreSQL transactions and implementation.