7 - Transactions (1/2) - Information Systems for Engineers - ETH Zurich - Fall 2026
Overview
Ghislain Fourny explains how PostgreSQL fits into a production website’s three-tier architecture: web servers handle HTTP and pages, application servers run business logic and SQL, and database servers store organized data. He then shows why concurrent users need transactions and introduces the ACID guarantees: atomicity, consistency, isolation, and durability.
Key takeaways
- A production website commonly separates responsibilities across web servers, application servers, and a PostgreSQL database tier.
- The application tier turns user requests into SQL queries, applies business logic to returned data, and passes results to the web tier for presentation.
- A transaction groups multiple database operations into one logical task, such as checking and booking a train seat.
- Concurrent overwrites can cause a lost update: two credits of 1,000 and 2,000 to a 1,000 balance should yield 4,000, but naive updates can leave only 3,000.
- ACID stands for atomicity, consistency, isolation, and durability, four guarantees used by relational systems such as PostgreSQL to manage transactions.
- Consistency concerns database constraints at transaction boundaries, while isolation concerns interference among concurrent users.
Chapters
- A teaching setup connects one user directly to PostgreSQL through a Jupyter notebook, while production databases often support websites and many simultaneous users.
- Database administrators manage access, database designers create schemas, and power users such as full-stack developers write SQL and application code.
- The common production design separates database servers, application servers, and web servers into a three-tier architecture.
- A browser resolves a domain such as amazon.com through DNS, then sends an HTTP request to a server in a data center.
- Web servers return HTML, CSS, JavaScript, and images; application servers use Java, C++, Python, or JavaScript to run business logic and query PostgreSQL with SQL.
- Database tables can be organized into schemas and databases, so a table reference may implicitly resolve to a default such as postgres.public.my_table.
- Production databases may serve millions of users at once, unlike an exam machine where one person runs queries in isolation.
- A task such as booking an SBB train ticket involves multiple queries: finding trains, checking seat availability, and reserving a selected seat.
- A transaction groups queries that belong together, while concurrency control helps prevent conflicting operations such as assigning the same seat to two customers.
- Two users read Albert’s initial balance of 1,000, then independently apply credits of 1,000 and 2,000.
- If each update overwrites the balance based on the earlier value, the stored result can become 3,000 instead of the intended 4,000.
- The first user may reread 3,000 after writing 2,000, an unexpected result that illustrates how concurrent transactions can lose updates.
- Atomicity means a transaction’s operations all succeed or none do; a database should not leave a user with only half of a multi-query operation applied.
- Consistency means constraints such as UNIQUE, NOT NULL, and CHECK hold at the beginning and end of a transaction.
- Isolation aims to make each user’s transaction feel as if it were running without interference from other users.
- Durability means successfully committed changes persist, even after events such as a power outage.
Transcript excerpt
0:01 So let's go for the next part. You have half an hour left, be less than half an hour. All right. Welcome back. So I would like now to tell you about uh the bigger picture of the uh of the um the systems that we have around a database because the the the PostgreSQL database system lives within an environment with even more things and that's what I want to show you. In this course and like in any database course, it's pretty simple. You install all PostgreSQL on your laptop, you access it via Jupiter notebooks, you type a few queries, you see results,
0:48 right? And on exam date it's the same. That of course is a setup for teaching, right? Uh some some data analysts might also do that if they download a data set, put it in PostgreSQL and analyze it with Jupiter notebook, works very well. But very often in practice, this database is going to be the back end of some website. You you're setting things over the internet, you might have a database of scientific publications like and you store it in a database sitting in a website. So this is what I want to show you now. So data analysts, they directly connect with the Jupiter notebook and analyze. There's other people working in customer support very often who don't even type any queries, they directly get a user interface, but in fact there's a
1:35 database behind and so for example, somebody calls, the client identifies and they find them in the database just with some user interface, typing the name, clicking on search, finding the client and then they see appearing on a window all the latest information. There's no sequel involved. These are called parametric users, right? They they just use some software, some
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Ghislain Fourny's lectures.