The Evolution of Database Systems: Indexing, Transactions, and Concurrency
Prerequisite Knowledge
This lecture builds on the following concepts from earlier lectures. If any feel unfamiliar, review the linked notes before proceeding.
Previously Covered in This Subject
- Indexing, seek time, and transfer time — covered in Lecture 10
- Hashing, hash functions, and collision handling — covered in Lecture 11
- Transactions and ACID properties — covered in Lecture 1
12.1 The Thirty-Year Cycle of Database Technology
12.1.1 One Standard, Then Many: The 1980s to 2005
Before touching any technical detail, this session asks a career-level question: why are we studying database systems at all, what is the progression of the database industry, and how can a student prepare for the changes that will arrive in the next three, five, or ten years? The honest framing is that anyone serious about a career in database systems needs to see the whole arc — not just the current tool. A student who knows only today's tool is exactly like a photographer who knows only film: they are unprepared the day the industry changes.
Hook: A technology that rules the industry for thirty years can still be wiped out in one decade. The question this section answers is not "which database is best today" but "why do the rules keep changing — and how do I stay employable through the change?"
Over the last 30 years, from the 1980s until 2005, relational database systems enjoyed complete domination — a genuine hegemony. Before that, network databases and other designs were tried, but relational systems won. A hegemony (a situation where one approach dominates everything else so completely that alternatives are marginal) describes what relational databases held for three decades. The language SQL and the frameworks around it became so famous that it was effectively the de facto standard — the standard in practice, even if no committee officially declared it — and everyone worked in SQL. One, two, or three commercial software products provided clean, convenient access to relational data. Microsoft Access is deliberately left out of that list — it was never commercially significant, only useful for learning.
Why relational won the 1980s: the relational model separates what data means (tables of rows and columns, described by a schema) from how it is stored and found. Users asked for data with SQL and let the system work out the mechanics. That single separation made relational databases the default answer for business data, which is why the era is called the relational hegemony.
Then in 2005 something drastic happened: the mass adoption of cloud computing software and the mass use of big data applications. The pattern across the industry is regular — roughly every decade or fifteen years there is a complete overhaul of the technology. The rule of survival is simple: if you cling onto the new technology, you survive; if you do not, the industry leaves you behind.
Intuition: Think of the technology industry as a surfboard and each overhaul as a wave. A surfer does not decide whether the wave is fair — they decide whether to ride it. The industry's rule is blunt: ride the new wave, or be left floating behind it.
12.1.2 The Wave Pattern: GUI, Internet, Big Data, Generative AI
The same wave has repeated four times, each time rewarding the companies that embraced it.
| Wave | When | What changed | Who thrived |
|---|---|---|---|
| GUI operating systems | Early 1980s | The Mac and graphical interfaces put computers in front of ordinary users | Any industry that used computers with GUIs |
| The internet | 1990s | Companies could reach customers and coordinate work online | The ones that used the internet to their advantage |
| Big data and smartphones | 2005 onwards | Cloud services, mobile apps, and data at unprecedented scale | The ones that used big data, cloud, and smartphone services |
| Generative AI | Now | Machines that produce text, images, and code on demand | The industries that use it for their advantage |
Companies that had been doing fine with earlier technologies were suddenly in a new world; any technology or industry that used computers with GUIs survived — or rather thrived — and the others were left away. In the 1990s every industry had to decide: do we embrace the internet, or do we keep doing what we are doing? The ones that used it to their advantage survived and thrived; the rest fell behind. From 2005 to the present the wave has been big data and smartphones.
The Kodak cautionary tale: Kodak was a hegemony at one point in time — dominant in photography — yet the shift to digital wiped it out. The lesson the professor draws is direct: the industries that use generative AI to their advantage will survive and thrive, and the others may be wiped out the way Kodak was. Being big today is no protection; being adaptable is.
12.1.3 Why the Cycle Matters to You
The relevance to a student is twofold. First, you need to be agile. If you work in the industry and keep watching how it moves, you can be better prepared and better equipped for each shift. Second, and deeper: every wave still builds on the same fundamentals. The internet helped SQL become very, very famous. When big data arrived, the limitation was how data can be kept, how it can be scaled, and how it can be used across machines. Each new generation of systems solved those problems differently, but the underlying ideas — storing data, retrieving it fast, keeping it correct under concurrency — stayed constant. The person who understands one era's technology at the ground level is the one who adopts the next era easily.
Recap: Technology overhauls itself roughly every ten to fifteen years, and each overhaul looks nothing like the last one on the surface. The constants underneath — storing data, retrieving it fast, keeping it correct under concurrency — do not change. That is precisely why the rest of this course (indexing, transactions, concurrency) matters: those are the fundamentals that survive every wave, and the professional who masters them at ground level rides every wave instead of being wiped out by it.
This is the point where the course's big arc starts: everything after this — indexing, transactions, and concurrency control — is the reusable core beneath the waves. As a career matter, a database engineer who understands how a B+ tree works and why transactions need isolation can walk into any new database product, from MongoDB to a blockchain store, and decode it quickly. That adaptability is the real return on studying this material.
12.2 The Big Data Era and the Rise of NoSQL
12.2.1 The Limits That Big Data Exposed
As big data applications arrived, relational systems hit three walls: how data can be kept, how data can be scaled, and how data can be used across many machines. A single database server has finite disk, finite memory, and a finite processor; when the data outgrows one machine, the questions "where does this byte live?", "how do I split the load?", and "how do I keep copies consistent?" stop being theoretical.
Intuition: Think of the relational era as one very large, very tidy warehouse run by one manager. Big data was the moment the warehouse overflowed — one manager and one building could no longer hold everything, so companies started renting many small warehouses (commodity machines) and had to invent rules for which item sits in which warehouse, and how to find it again.
The solution providers and entrepreneurs responded with their own file systems. Facebook is one of the most famous later examples, and before Facebook, Google and Yahoo had already created their own file systems. Out of that came Hadoop as a very famous application: many commodity systems are pooled into a cluster, and the cluster provides a lot of computing power. Commodity systems — cheap, off-the-shelf hardware rather than specialized mainframes — make the economics work: one big machine is expensive, but a thousand ordinary machines are cheap. Managing a database across many commodity systems is a serious challenge, and the Hadoop file system handled it nicely; the Google file system did the same thing at a different front.
Even with distributed file systems in place, users still wanted something that could be used as easily as SQL. That gap produced MongoDB, one of the first big NoSQL answers. Seven or eight years ago even many people with over a decade of industry experience had not heard of MongoDB to any famous extent; in the last five years it has become the kind of thing that everyone and all the applications use.
It helps to state the trade-off explicitly. A relational database system provides reliability and a very stable system. The normalization work — minimum redundancy, maximum certainty in the data — is exactly what buys that stability. (Remember the earlier lectures: normalization removes redundant copies of facts so that a fact is stored once, which is what makes updates safe and the data trustworthy.) But the applications that appeared after 2005 and up to now wanted something different: more and more scalable, faster and faster to use. That demand produced the NoSQL database paradigm we are seeing. The concept of NoSQL existed way back, over two decades ago, but its use in the enterprise industry has really only taken off in the last five to seven years.
The core trade-off: a relational database buys reliability and stability through careful design (schemas, normalization, transactions), but that discipline costs flexibility and can be hard to scale across thousands of machines. NoSQL relaxes parts of that discipline — often loosening schema or consistency guarantees — to win scale, speed, and flexible data shapes. Neither is "better"; each is a different point on the same trade-off curve.
12.2.2 The New Players: MongoDB, Cassandra, Neo4j
The market has gone from one player before 2005 to several distinct players now, and each new database has its own advantage and overcomes a specific limitation of RDBMS-style databases.
| Database | Category | What it is good at | RDBMS limitation it addresses |
|---|---|---|---|
| MongoDB | Document-oriented | Storing rich, semi-structured records (JSON-like documents) | Rigid row-and-column schema |
| Cassandra | Wide-column store | Massive write throughput spread across many machines | Scaling writes across a cluster |
| Neo4j | Graph database | Queries that follow relationships between entities (friends, routes, links) | Representing and querying connections cheaply |
MongoDB rules one type of database — the document-oriented type: data is kept as documents, each document being a self-contained bundle of fields, which maps naturally to the way application code already structures objects. In graph databases, Neo4j is a dominant player: it stores nodes and the edges between them as first-class citizens, so a query like "who are the friends of my friends" walks edges directly instead of joining tables. Cassandra is another player in this space. Note on classification: the professor places Cassandra among the document databases, while the standard classification treats Cassandra as a wide-column store (data in rows addressed by key, with columns grouped into column families) — the practical point stands either way: each player specializes in a different shape of data and a different access pattern. Each has its own distinct advantages, and each overcomes a specific limitation that RDBMS-type databases had.
The practical consequence: whenever a new project arrives at your organization, it is you who has to decide — and propose to your team — why the project should switch to a particular database, and what that switch saves in the long and short point of time. That decision power is the reason to understand this landscape: the engineer who can justify a database choice with reasons, not fashion, is the one whose proposals get approved.
12.2.3 Matching the Database to the Workload
The database you need depends on your end use case, and three contrasting workloads make the point.
Worked example — three workloads, three different databases:
- Two hundred users, one access a day. Each user hits the database rarely — say 200 requests per day total. Nothing has to scale hard; a single modest relational server, or even a file-based system, is perfectly fine. The correct decision here is to not spend money and complexity on a distributed system.
- One million users searching, ten thousand every minute. Every minute there are users searching the database. That is searches per hour. The read load is enormous and continuous, so the system must serve reads at massive parallelism — this workload rewards read-optimized engines, replication of data across many servers, and caching, exactly the strengths of a search-heavy NoSQL deployment.
- One thousand users, gigabytes per minute. Only a thousand users, but the database piles up gigabytes of data every minute — data created and stored at high velocity. At GB per minute the store grows by roughly GB per day; the storage and ingest path dominates. This workload rewards append-friendly, write-scalable stores (wide-column and log-structured designs shine here) rather than complex in-place updates.
Sense-check: the same engine would be overkill for case 1, starved of reads in case 2, and drowned in writes in case 3 — one "best database" cannot exist because the bottleneck is different in each case.
The same logic applies to the famous names: how IRCTC handles its database is very different from how Instagram handles its database, and both are very different from how a traditional website like Amazon handles its database.
The professor's analogy — IRCTC vs Instagram vs Amazon: each is a household name in databases, and each runs a different workload. IRCTC must keep seat inventory correct under a stampede of booking requests (correctness under concurrency dominates), Instagram must serve billions of photo reads fast (read latency dominates), and Amazon must balance a huge catalog, carts, and checkouts (transactional consistency at scale dominates). There is no single best database; there is a database that fits the workload.
When you build a solution, you first decide what your priorities are — "I want maximum transactional efficiency per unit point of time" — and then you pick and choose from the available packages accordingly.
12.2.4 The Two Career Paths This Opens
There are two ways this knowledge turns into value.
Career path 1 — the user: you look at a use case and choose the right system, weighting features like transactional efficiency. You are the architect who decides between PostgreSQL and MongoDB for a new product, and can defend that choice.
Career path 2 — the builder: you might work for a company that creates database software, and when you know how these technologies work internally, you can make that software more optimized.
That is the central message of this part of the course — rather than remaining a user of SQL and of the software providers, understand how the software actually works: how it analyzes the code you write, how it executes it, how it optimizes it, and how the low-level systems behave. Everything discussed after normalization — indexes, transactions, concurrency — exists to build that understanding. The course keeps coming back to one question about every topic: why are we discussing this, and how can we use it for our advantage?
When a student wonders whether any of this affects their employability or their dollar value, the answer is the paradigm argument in reverse: niche technologies multiply — for a particular industry, sector, customer type, programming language, or integration platform there will be new database software — and the person who understands the fundamentals of any one of them adapts to all of them.
Recap: big data broke the single-machine assumption, distributed file systems and NoSQL stores answered the three walls (keep, scale, use across machines), and the market fragmented into specialists. Whoever understands the fundamentals underneath any one of them can adapt to all of them — and that understanding is what this course is building toward with indexing, transactions, and concurrency.
12.2.5 Security Is a Broader Word Than It Looks
Q: With so many databases arriving, which one is better from the security point of view?
A: It depends upon the use case. Security is a very broad term — it includes continuity, it includes integrity, it includes availability, and user experience is something which you also need to respect as well. It is a different discussion that we may have at a later point of time, but it also needs to be considered when you want to work across. A database choice is a bundle of all of these; "which one is better" cannot be answered from the security angle alone.
The correction that matters: security is not one switch ("does it encrypt?") but a bundle — continuity (the system keeps working over time), integrity (data stays correct and unmodified), availability (users can reach the data when they need it), and even user experience (a secure system nobody can use well is still a failure). "Which database is more secure" is so the wrong question; the right question is "which bundle fits this use case."
12.3 Blockchain: A Different Kind of Database
12.3.1 The Question That Started It
Q: Multiple databases are coming, and more data is coming, so it makes sense to organize data into databases. But new technologies like blockchain are arriving too, and block-level storage like IPFS is offered as the only solution for that. So are we going ahead with multiple kinds of scenarios, or are NoSQL and RDBMS the only options, and for different kinds of data do we need to continue with the older kind of technology?
A: That question is exactly the motivation for the first ten minutes of this discussion. As we move towards different technologies and different use cases, the answer is yes — there are multiple, multiple, multiple technologies coming into the picture. What blockchain provides is one way of providing trust with code, where earlier that trust lived in people and institutions. There is a saying: in God we trust, but in blockchain we say, in code we trust. The pitch is code-based: decentralized autonomous organizations, removing intermediaries, providing a proper trail of evidence, and making sure that nobody can tamper with even the historical data or even the code — not even the owner of the system. That is the basic selling point of blockchain. So, is it the same older technology we continue with? No — the use case decides, and when you learn one or two of these technologies and their concepts, the value reaches way beyond this particular course.
The student's question hides the assumption this section dismantles: that the database world splits into exactly two camps, RDBMS and NoSQL. In fact the space is wider — blockchain is a third family with a different job. The test to apply to any new storage technology is not "is it like SQL?" but "what does this use case need?" Blockchain answers the use case that says: the records must be impossible for any single party — even the owner — to quietly rewrite.
12.3.2 Trust in Code: The Blockchain Pitch
Blockchain's core offering is trust delivered by code instead of by people or institutions. In a traditional database the operator is trusted: the bank that keeps your ledger, the company that keeps your orders. Blockchain replaces that institutional trust with a structure where the record-keeping rules are enforced by the system itself. The concrete mechanisms:
- Decentralized autonomous organizations (DAOs) — organizations that run on code rather than on management; the rules of the organization are written as software, not administered by people.
- Removal of intermediaries — two parties transact directly through the network instead of through a middleman who both sides must trust.
- A proper trail of evidence — every transaction is recorded in sequence, so history can be audited end to end.
- Tamper-resistance — protecting both historical data and the code itself, even from the system's owner. A block cannot be edited in place; the only operation is appending a new, verifiable block, and any alteration to an old block breaks the chain's consistency check and is detected by every participant.
The history is concrete: the first Bitcoin blockchain came into being in 2009, and Ethereum in 2016 (the two dates were run together in the discussion; the standard dates are Bitcoin's blockchain going live in 2009, and Ethereum launching in 2016). Since then there has been steady advancement in blockchain technology.
12.3.3 A Slow Database That Keeps Changing
Looked at as a database, blockchain is itself one — and an early one was considered a very slow database, block-level, without much more than that. The slowness is structural, not accidental: distributing every record to many parties and verifying every block by consensus costs far more than one machine reading its own disk. The paradigm is now changing with Solana, consensus-based chains, and other blockchains coming into the picture.
Even inside the blockchain industry the designs differ deeply:
- Solana handles its data with proof of history — a way of producing a verifiable order of events without full two-way communication at every step — so the way it creates trust and stores data is its own.
- The EVM-based systems, like Ethereum, are transaction-based systems: the Ethereum Virtual Machine executes transactions one by one under the rules of the chain, and how they handle data is completely different again.
- Newcomers in the space — spoken as "Apptoss", read as Aptos, a separate layer-1 blockchain — are different even within that specific industry.
For enterprise-level blockchain development there is an abundance of choice: what language to use, what software to use, and how the database aligns with a particular industry are all decisions you must make with awareness.
Pitfall — judging blockchain by database speed alone: calling blockchain "a slow database" and stopping there misses the point. Its goal is not throughput; it is tamper-evidence and trustlessness — properties no traditional database offers. Measure a blockchain against the job it is hired for (immutable, auditable history) and a relational database against its own job (fast, consistent transactional access). Comparing only on speed is comparing a safe against a filing cabinet on how fast each opens.
12.3.4 What This Means for the Future of Databases
The outlook the discussion paints: up to 2005 there was one thing; from 2005 to 2015 multiple things arrived; from 2015 to now there is an abundance of technologies at the cusp. The floodgates may open in the next three to five years, with very specific, very micro-specific database software arriving — including databases shaped around how particular blockchains handle data.
Recap + bridge: the takeaway is twofold. First, when new technology appears, your grounding in how SQL and relational systems work at the ground-root level is what lets you adopt and equip yourself for the new paradigm quickly. Second, this is why topics like indexing, transactions, and concurrency are studied in this course at all: they are the reusable core beneath every wave — including the blockchain wave. A blockchain is, after all, a data structure for appending records; a relational engine is a data structure for querying records; and the questions of how to find data fast (indexing) and how to keep it correct under concurrent writers (transactions, concurrency) run through both.
In the wider field, blockchain databases are where database research meets distributed-systems research: the ledger itself is a distributed log, and consensus protocols are the concurrency control of that world. The student who understands conventional transactions will meet the same anxieties — conflicting writers, ordering, durability — wearing different names on a blockchain.
12.4 Indexing: The Problem, the Mechanism, and the Payoff
12.4.1 Why the Course Spends Three Sessions on Indexing
On the surface, indexing looks like one line of SQL — create index on that particular attribute — and yet the course spends three class sessions on it. The types alone are many: hash-based indexing, indexing on B-trees and B+ trees, bitmap indexing, sparse index, dense index, clustering index, and more; and among those there is single-level and multi-level indexing, and much more besides. If all a user ever does is write create index, why study the field in such detail?
Hook: typing one SQL statement takes five seconds; understanding what it does takes three lectures. The difference between those is the difference between using a tool and mastering it — and this section shows why the gap is worth crossing.
The answer is the same as before: once you know how these indexes work — once you know how the file system works — you can easily adapt to any particular technology. And if you are creating software rather than merely using it, you are far more likely to create optimized software for your own systems. Even while studying any tool, be aware of what assumptions and constraints you are relying on: today you run a one-tier architecture, tomorrow a client-server application on a network, later a completely new paradigm — the awareness is what survives the change.
12.4.2 The Physical Problem: Seek Time and Transfer Time
The problem indexing solves is physical. A file is stored on the hard disk in blocks — chunks of data — and the data sits in a place separate from where it is processed. To answer a query, the processor must find out which blocks in the file are relevant, move the disk head to that particular area — seeking to the right track and sector — and bring the blocks into main memory, where the actual processing can happen.
Two costs appear:
- Seek time — moving the disk head mechanically to the right track. This is a physical motion: the read/write head must travel across the platter, and physics, not software, sets its speed. Typical average seek times are 4–10 milliseconds.
- Transfer time (also called access time) — moving the data into main memory once the head is in position. A block of a few kilobytes transfers in well under a millisecond at typical disk transfer rates, plus a rotational delay of about 3 ms at 10,000 rpm.
Generally, seek time is an order higher than the access time:
"An order higher" means roughly ten times larger: the mechanical positioning of the head (milliseconds) dwarfs the electronic transfer of the data once positioned (fractions of a millisecond). The reference treatment confirms this: the seek is called "the main culprit for the delay involved in transferring blocks between disk and memory," with average seeks of 4–10 ms versus transfer times of a fraction of a millisecond per block. So the goal of an index is to make seeking very, very fast. The index acts as a shortcut: instead of scanning everything, you look at the index and jump to the right blocks.
Intuition: an index is like the index at the back of a book. To find "acid" you do not read the whole book page by page; you jump to the page the index points at. Without an index, every lookup is a full scan; with one, you seek once to the index and then seek straight to the data you need.
12.4.3 Worked Scenario: Finding Students Who Scored 10–11
Worked example — finding students who scored between 10 and 11:
Setup. A course has 300+ students enrolled, and each student's record carries a lot of data — name, ID number, email ID, marks, quiz one, quiz two, whatever else. Suppose the file holds records and each disk block holds records. The file then spans
Query. Find the students who have scored between 10 and 11 in a particular test.
Without an index (full scan). The processor must locate all blocks relevant to this query, seek the disk head to each track and sector, transfer each block into main memory, and run an algorithm that checks whether each record satisfies the marks-between-10-and-11 condition. Every block costs seek time plus transfer time:
and because , the total is dominated by full seeks. With , that alone is — and a real file with millions of records runs this cost thousands of times over. The marks live scattered across many blocks, so nearly every block has to be visited to be sure no qualifying student is missed.
The cost that matters. The number of seeks — mechanical head movements — is the dominant term. Every extra seek is an extra physical journey. The full scan pays the full journey for every block.
Sense-check: the query is a range scan over a non-ordered attribute, so a full scan must check every block — 30 seeks. An index on the marks attribute lets the system jump straight to the small set of blocks that could contain marks 10–11 (and, with a B+ tree, read only that slice of leaves), replacing 30 mechanical journeys with a handful.
This is the problem indexing came into existence to solve: the same data, same query, but the number of expensive seeks collapses from "every block" to "the few blocks that matter."
12.4.4 The Index Solution and Its Cost
Instead of finding all the data and bringing it into main memory, you create an index on one or two attributes. Based on that index, you look at the index and search the file system and the blocks much faster, going straight to what is relevant.
The trade is honest: it takes time to create an index, and it takes a huge amount of effort and resources to maintain that index. That extra cost is recovered by usage — if the index is used more and more, the chances are very high that very soon the effort has been paid back, and from that point onwards there is pure advantage.
Assumptions & scope of the index payoff: the index wins only when the workload is read-heavy and the indexed attribute is actually queried. If the workload is mostly inserts and updates, every write must also update the index structures — an extra cost on the hottest path. The breakeven logic is explicit: creation and maintenance cost up front; heavy usage pays it back. An index nobody queries is a standing bill, not an asset. Similarly, an index helps point lookups and narrow range queries; a query that touches most rows (e.g., "average of all marks") is still best served by scanning.
What type of index to apply — B+ tree, bitmap, hash, sparse, dense, clustering — is a secondary front: once you understand the problem, you also need to know how to solve it.
The professor's analogy — doctor and prescription: a doctor not only diagnoses the problem but also prescribes the solution. Understanding why indexing exists (the diagnosis: seeks dominate) is only half the skill; knowing which index to apply (the prescription: B+ tree here, hash there, bitmap for low-cardinality attributes) is the other half. The course deliberately covers both halves.
The analogy can be stretched to any field where processing or decision making happens in a different place from the work itself — a supply chain is one such example — and you can extend the analogy with your own constraints and your own optimality focus. In a warehouse, the goods (data) sit far from the packing bench (processor), and a well-organized catalog of locations (the index) beats walking the aisles (the scan) every time the same items are picked repeatedly.
Recap: indexing exists because disk access is dominated by mechanical seek time, which is an order higher than transfer time. An index trades up-front creation and ongoing maintenance cost for drastically fewer seeks on every query — a bet that pays off when the index is used heavily. Knowing why (diagnosis) and which (prescription) is the complete skill.
12.4.5 Beyond Relational: Indexing Everywhere
Q: The concepts we are learning about indexing and hashing are aimed at improving database performance and retrieval. Is this universally applicable across every kind of database — like NoSQL or relational — or are these concepts specific to RDBMS?
A: Not only is it not limited to relational database systems — it is not even limited to database systems. The relevance extends to different fields of application, let alone computer science. Key-value stores like Cassandra, document systems like MongoDB, graph database systems, and even the separate blockchain-based database paradigm, where we just dump blocks of data, all face the same question: how can we access the data faster? One of the ways is to create an index for it. What type of index you use depends on how you are accessing the data — the access pattern determines the index — and that is the thing to be careful of while applying it.
This universality is the deep reason the physical picture matters. The data being at a separate place from the processing, the blocks on disk, the seek and transfer costs — that problem is the same in every storage system, whatever its name. In the wider field, this is why search engines and document stores build inverted indexes, why graph databases index on node properties, and why even blockchains keep auxiliary lookup structures: every system, relational or not, faces the same physics.
12.5 Hashing: One Science, Many Applications
12.5.1 The Domain and the Buckets
Hashing as a concept is the same thing everywhere: a huge range exists in which data can appear, but the actual values in hand are few. Say the domain of data runs from one to ten thousand:
The actual values present are only 15. One value is 5, another is 500, another is 700, and the other 13 range somewhere in between.
The mismatch at the heart of hashing: the domain (the set of all values that could ever appear, here 10,000 values) is enormous compared to the actual values in hand (here 15). If we reserved one exact storage spot per possible value, we would build a 10,000-slot structure to hold 15 records — 99.85% wasted. A hash function (a rule that maps each arriving value to a smaller address space) is the standard way to shrink that mismatch: map the big domain onto a small set of addresses, and let several values share each address when needed.
When values are inserted and deleted sporadically, it is better to have a chunk of data or a cluster of data, rather than one exact spot per value. So we make clusters — buckets holding 1 to 100, 100 to 200, and so on:
and create a hash function that stores each data value into a particular bucket. When a bucket has a collision, we do something with those collisions.
12.5.2 Worked Example: 15 Values in a Domain of Ten Thousand
Worked example — 15 values, 100 buckets:
Given the domain and 15 actual values such as 5, 500, and 700:
Step 1 — see the waste of a direct scheme. One-slot-per-value would demand 10,000 slots for 15 values spread across a 10,000-wide domain — a 99.85% waste. A sparse scheme (only 15 slots) would make sporadic insertions and deletions hard to track: inserting a new value means finding or creating a slot somewhere in the middle of nowhere.
Step 2 — define the buckets and the hash function. Cluster the domain into buckets of width 100. A bucket covers 100 consecutive values, and the bucket index of a value is
which collapses the 10,000-wide domain into 100 bucket addresses: .
Step 3 — hash all 15 values. Let the actual values be 5, 500, 700, and 13 more spread in between — say 47, 103, 156, 250, 349, 501, 690, 705, 812, 900, 950, 4,532, and 9,999:
| Value | Bucket |
|---|---|
| 5 | |
| 47 | |
| 103 | |
| 156 | |
| 250 | |
| 349 | |
| 500 | |
| 501 | |
| 690 | |
| 700 | |
| 705 | |
| 812 | |
| 900 | |
| 950 | |
| 4,532 | |
| 9,999 |
Step 4 — count the collisions. 5 and 47 collide in ; 103 and 156 collide in ; 690 and 700 collide in ; 812 and 900 collide in . That is 4 collisions among 15 values — exactly the situation the lecture describes. The bucket contents are searched locally (only the few records inside a bucket), and each collision is handled by a collision-resolution strategy rather than by expanding the domain.
Sense-check: all 16 rows land inside , every value keeps its natural bucket (no value is lost or misrouted), and the search for any value touches exactly one bucket. The bucket layout is a reasonable one for this lecture's purposes; note that a real hash function would be chosen for speed and distribution, not just for convenience — e.g., a function that spreads values uniformly so that no bucket grows long.
12.5.3 Collision Resolution: Chaining, Open Addressing, Multiple Hashing
Three collision-resolution techniques were covered in the data-structures material: open addressing, chaining, and multiple hashing (the name "multiple hashing" is kept as spoken; it is the rehashing-style family where a second hash or probe sequence is used).
The three families, as the standard treatments define them:
- Chaining — keep overflow locations (usually by extending the array with extra overflow positions) and give every record location a pointer field. On collision, place the new record in an unused overflow location and set the pointer of the occupied hash-address location to that overflow location. A linked list of overflow records is maintained per hash address; the algorithms are the simplest of the three.
- Open addressing — proceed from the occupied position and check subsequent positions in order (e.g., , then , ...) until an unused position is found. All records live inside the table itself; no overflow area, no pointer field.
- Multiple hashing — apply a second hash function if the first results in a collision; if another collision results, apply a third hash function, or fall back to open addressing.
In both chaining and multiple hashing, an overflow space is used: every data record gets an overflow pointer, and when a bucket overflows, the record follows the pointer chain to the next slot and sets the record there.
Q: For collision resolution we saw three techniques — open addressing, chaining, and multiple hashing. In both chaining and multiple hashing we give an overflow space, and in the overflow space we provide an overflow pointer to every data record so that it goes to the next pointer and then sets the record. But in open addressing, do we follow the same mechanism — do we always put a pointer to the next available record somewhere in a different address space? I was not able to catch this in the material.
A: The applications are different. When we are working on the main thing, we can use one level of storage; once there is a collision, we can use the open type of thing, where in a different file system we may have the collision even in block three or block twenty, and we would still be able to store — if there is a second level of collision, in the extendable data space we store it across, in the form of open storage. — I would have to go back to the drawing board and share some examples, because many of the terms you are specifying need to be specified per se, discussed and clarified before giving the detailed answer.
Standard treatment: the honest state of the record from the lecture is that chaining and multiple hashing use overflow space with overflow pointers, while the professor deferred the open-addressing question for examples. The standard definition settles the doubt: open addressing does not use overflow pointers or a separate address space. It keeps everything in the same table and resolves a collision by probing onward — checking , , and so on — until an empty slot is found. Where chaining moves the record out to a linked list, open addressing slides it forward within the same array. That is why deletion under open addressing is tricky (removing a record can break a probe chain), while chaining's deletion is simple.
12.5.4 Hashing in Data Structures Versus Hashing in Databases
Q: We study hashing in the data structures course (the second course name is garbled in the source; read as the DSA course). How is it the same concept in both courses?
A: The concept is identical. The range or domain of data can be huge — say one to ten thousand — while the actual values are only 15. You create clusters like 1 to 100, 100 to 200, and a hash function stores data in a particular bucket; if the bucket has a collision, you handle the collision. That discussion is verbatim the same. The algorithms remain the same — perhaps word for word. What changes is the application: in the data structures course, you may apply hashing on a data structure such as an associative array or some other structure you build; in database systems you apply it on a particular attribute to create an index out of it. Different application, same theory, same principle, same science.
Q: Databases provide indexing to speed up searching, but some communities still use third-party tools like Sphinx, or re-index data stored in the database. What is the difference?
A: I have limited knowledge of those tools right now — I would need to study them before commenting on either. I cannot say right now what they are or what the difference is between creating an index inside the database and using third-party tools that provide indexing.
The first exchange is a clean statement of the course's core idea: the science transfers, the application differs. The second is an honest boundary — the in-course model of indexing is one thing, the ecosystem of external search and index tools is another, and understanding the former is the prerequisite for judging the latter.
Recap + bridge: hashing is one science with many applications: the domain is huge, the values in hand are few, buckets cluster the values, and collisions are resolved by chaining, open addressing, or multiple hashing. The same machinery runs in a DSA-course associative array and in a database index on an attribute. The next question — who gets to write when many readers and writers touch the data at once — is where hashing hands off to transactions and concurrency.
In the wider field, hash-based indexing powers key-value stores and hash indexes in relational engines, while the same bucket-and-collision ideas reappear in distributed systems as consistent hashing — the mechanism that decides which machine in a cluster stores which key.
12.6 Transactions: The Problem of Concurrent Access
12.6.1 When Two People Touch the Same Data
The next big topic after indexing is transactions and concurrency. The problem: a database can be accessed by many people at one point of time. When one person wants to write to the database while somebody else is reading it at the same time, there can be discrepancies in the order in which somebody is accessing and somebody is writing. When that order matters — when it can really alter the output of the application — you need to be very careful.
Hook: a seat sold twice, a room booked by two guests, a payment taken for a room that was already gone. Every one of these is the same failure: two people touched the same data at almost the same time, and the system did not decide their order. This section is about why that ordering problem exists and the two mechanisms that decide the order.
Real-world: a railway reservation system, a hotel reservation system, a flight booking — whether a flight is booked or not, whether a booking is available or not, whether a seat is there or not, what the hotel rates are — all of it depends on how the database behaves under concurrent access. If thousands of people are accessing the database, each one should still feel like the only person using it.
12.6.2 The Book Price Example
Worked example — the author's five books on Amazon:
Setup. An author has written five books, and all five are available on the Amazon platform. Initially all five sell at the old price, say ₹450 each.
The two operations. The author changes the selling price of those books (say to ₹380) — a write. At almost the same point of time, a customer buys one of them — a read of the price (and a decrement of stock, also a write). Two people have impacted the database at the same time: one writing (the price change), one reading (the purchase).
The race. If the read sees the price before the change, the customer pays ₹450. If the read sees the price after the change, the customer pays ₹380. Both are valid single operations; the answer the customer sees depends entirely on which operation the system applied first.
Why it matters. Before the buy and after the buy, the prices are specifically different — the outcome of the whole interleaving is order-dependent. Whether it is write-writes (two price changes colliding) or read-writes (a price change colliding with a purchase), the order is very, very important: you must be clear about what the output is before and after.
Sense-check: nobody wrote wrong data — yet the observable result flips on timing. That is the signature of a concurrency problem: each step is fine in isolation, and the system misbehaves only through interleaving.
12.6.3 Real Systems That Live and Die by Ordering
The same pattern scales to systems where money and availability are on the line. IRCTC's database, railway and hotel reservations, flight availability, seat availability, hotel pricing — all depend on the order in which thousands of concurrent accesses are applied. If the order breaks, a customer pays for a booking that another customer just took, or a seat is sold twice. In these systems the ordering problem is not academic; it is the product. The booking engine's entire reason to exist is to apply thousands of overlapping requests in an order that leaves every seat and stay accounted for exactly once.
12.6.4 The Illusion of Being Alone
The requirement is stated in one line: with thousands of people accessing the database, it should appear as if you are the only one accessing it. If you perform the same operation today and maybe tomorrow, you should still get the same output, provided nobody else is working at that point of time — which is never the reality, since other people are always working at the same time. So the user must get the feeling of sole access. The order in which accesses happen can impact the performance and also the quality of the response that another person receives — and that is the situation these mechanisms exist to handle.
The goal in one line: each user gets the illusion of sole access — the experience of a private database — even though thousands of operations are interleaving behind the scenes. The system is judged by the experience each user receives, not by the internal gymnastics.
12.6.5 Two Mechanisms: Locking and Timestamps
The naive answer to the problem is to freeze the database: while one person accesses it, others wait; once the person exits, the next one uses it. That is one way to start, and two concrete mechanisms implement the discipline:
- Lock-based systems: lock the database, allow someone to access, then allow someone else to access. Locking can be applied at different granularities, and the mechanisms differ accordingly — you may lock a whole database, a single table, a page, or a single record, and the finer the granularity, the more concurrency survives but the more bookkeeping is needed.
- Timestamp-based systems: give each access a token. Whoever arrives gets a token, and depending on the token number, they will be served. The order of service is decided by the order of the tokens, so conflicting accesses are resolved by the timestamps instead of by who physically grabbed a lock.
The professor's analogy — tokens in everyday life: in a hospital, a bank, or a normal stall at the roadside, if anyone is served at a whimsical point of time, there would be chaos. Give the person a token — depending on the token number, you will be served. In pilgrimages, people used to stand in line for two days; now you get a token and an approximate point of time when you will be served. Hospitals and restaurants work the same way: you take a token number, you know your number, and you know the people who came before you have priority. The timestamp mechanism is the database's version of the token: the order of arrival is preserved, and each accessor knows where they stand. (Where the analogy stops: a human queue serves people in order even if they do not need the same resource; a database only needs ordering for accesses that conflict — two reads never need a token, because both can read the same value safely.)
These are the two mechanisms by which multiple people can access the database and still keep the user experience within a tolerable limit.
12.6.6 Student Questions and Answers
Q: Can I describe the problem in my own words? You and I are working together on the same database. We are accessing the database, and I want to make a payment — and suddenly the room that I was reserving becomes not available at that point of time. I reserved the room, I chose the room, and as soon as I made the payment you tell me the room is not available. That is not good.
A: Exactly — that is the problem. At that point of time we need to respect the experience even while multiple people are accessing the database. Everyone should feel they are working in isolation, and either everything works across or nothing works across. You should not hear "your money is debited, but the room is not reserved." The system also needs to be consistent — the constraints before and after need to be respected — and the changes should remain on the database. Those four properties are very general and very practical, and the mechanisms we use are what make them hold under concurrent execution.
The student's paraphrase captures the failure exactly, and the professor's answer names the four properties the mechanisms must deliver — a preview of the next section: everyone works in isolation (isolation), all or nothing (atomicity), constraints respected (consistency), changes remain (durability). The rest of the course's transaction material is, in one sentence, how to make those four promises hold when thousands of accesses interleave.
12.7 ACID: The Four Properties
A transaction is a collection of operations that forms one logical unit of work — for a user it is "book this room"; inside the database it is dozens of reads and writes. The four ACID properties are the promises the database makes about every transaction. The acronym comes from the first letters: Atomicity, Consistency, Isolation, Durability. The lecture introduces them one at a time, and the order matters: isolation is the experience, atomicity is the failure rule, consistency is the state rule, durability is the persistence rule.
12.7.1 Isolation
The first property: even when multiple people access the database at the same time, everyone should feel that they are working in isolation — as if no one else exists in the system. The user's experience is that of a private database, even though thousands of operations are interleaving behind the scenes.
Isolation in the standard form: for every pair of transactions and , it appears to that either finished before started, or started after finished. Each transaction is unaware of other transactions executing concurrently — exactly the "illusion of being alone" from the previous section, now stated as a formal promise. Isolation is what lets a student booking a seat behave as if no other student is booking the same seat at the same time.
12.7.2 Atomicity
The second property: either everything works across, or nothing works across. The forbidden outcome is the split failure — "your money is debited, but the room is not reserved." A transaction must land as one indivisible unit: all of its effects happen, or none of them do.
Atomicity in the standard form: a transaction is an indivisible unit — it executes in its entirety or not at all. If the transaction fails partway (an error, a crash, a power loss), every partial change it made must be undone; the reference treatment's example is a fund transfer where the checking account is debited but the savings account is not credited — the same split failure the lecture forbids, in another domain. Atomic comes from the Greek atomos, "uncuttable": a transaction is the smallest unit of work the database is willing to leave in a finished state.
12.7.3 Consistency
The third property: the system needs to be consistent. The constraints before and after need to be respected. If there are 10 seats, only 10 seats should be reserved — the database may never reach a state that violates its own rules, no matter how many transactions run at once. Consistency is the property that keeps the database meaningful between operations.
Consistency in the standard form: if a transaction runs on a database that starts consistent, the database must again be consistent when the transaction ends. The "10 seats" rule is an application-dependent constraint — no generic SQL check can express "reservations may never exceed inventory," so the transaction itself is responsible for preserving it. Consistency is so partly the database's job and partly the programmer's job: the database enforces declared integrity rules, and the transaction code must not violate the ones only the application knows about.
12.7.4 Durability
The fourth property: whatever happens after the person has accessed the database, the changes should remain on that database. A committed change survives — it is not lost when the access ends, when other users work, or when the system settles down. The output you were promised stays the output.
Durability in the standard form: after a transaction completes successfully, the changes it made persist even if there are system failures — a crash minutes later must not "forget" the committed booking or payment. Committed is the technical word: a transaction that has finished successfully is committed, and durability is the promise that committed work survives the crash that follows.
12.7.5 Why the Mechanisms Are Necessary
These four properties — atomicity, consistency, isolation, durability, the ACID properties — are the contract that concurrent execution is expected to ensure.
The key honesty — you cannot guarantee ACID by hand: it is generally not possible to guarantee these properties by hand, at that level of detail, not even when writing multithreaded applications. A programmer who manually interleaves reads and writes of shared variables, hoping to keep all four promises, will miss cases — races, torn updates, crashes mid-write — that are invisible in testing and catastrophic in production. That impossibility is exactly why the mechanisms exist — the lock-based and timestamp-based approaches from the previous section — and why they are discussed at the length they are. The mechanisms buy the properties; the properties buy the user's experience.
Recap + bridge: ACID is the contract of concurrent execution: isolation makes every user feel alone, atomicity forbids the split failure ("money debited, room not reserved"), consistency keeps the rules (10 seats, 10 reservations) respected before and after, and durability keeps committed changes after a crash. The next lectures build the mechanisms — locking, timestamps, recovery — that deliver these four promises when thousands of transactions interleave.
12.8 Assignment and Evaluation Guidance
12.8.1 The Evaluative Components
The evaluation for the course rests on four components: the mid-semester examination, quiz one, quiz two, and the projects. Mid-semester results (regular and makeup) are being processed; the notification channel has changed this time, which has delayed them, and once marks appear, feedback and justification will be available for discussion — evaluation is done with proper justification. The project description is posted on the Takshila portal as a notice and also in the team folder.
12.8.2 The Assignment: SQL Logic, Not an Application
Exam note: for the project assignment you do not have to develop a web application. No interface work — no HTML, CSS, JavaScript, React, Redux, or any particular front-end stack. The requirement is the logic, and in the logic, the SQL part: write the SQL and include a snapshot of the SQL. An architectural design diagram is required — you must design the ER diagram; that is part of what is evaluated.
The problem statement is real: it comes from business work done in 2021–22, shaped after 100 interviews and proper customer discovery — not something invented out of thin air — so treat the problem seriously. Whether assignment and project are separate entities is left to you, in your best judgment; any reasonable approach is acceptable.
12.8.3 Format: Handwritten, Typed, or Mixed
Exam note: you can submit handwritten, typed, or a mix of both — whatever communicates what you know. For the ER diagram, use any drawing tool that draws nicely, or pen and paper; PowerPoint and Word are fine too. There is no heuristic like "500 pages" or "one page" — no page target at all. Express yourself in a relaxed manner, and remember: the marks are not for beautification; the marks are for expressing the content. More depth while answering — without being verbose — is better for you. Present your answers in a table when a table is the clearest format; it is easier to grade and easier to read.
12.8.4 The Plagiarism and AI Policy
Exam note: the submissions are checked. There are proper tools that check plagiarism, and they check the AI part of the plagiarism as well — the checker can tell, with some degree of confidence, if you used AI, and it also checks the level of matching between different assignments. Please refrain from using AI and from copying: the intent is not to punish — zero marks and resubmission are not the goal — but the work must be done honestly and individually. If a team divides the work unfairly, measures will be taken so that each person is rewarded properly.
12.8.5 Student Questions and Answers
Q: Even if we write on our own or type on our own, a plagiarism tool will report some percentage of similarity — it can't be 100% sure that whatever you write is not present on the web. If I write my own answer, the tool still reports some plagiarism. So what is your opinion?
A: I agree — thanks for bringing it up. The purpose is not to punish every time. The evaluation is not about judging what you don't know; and it would be very difficult to claim 100% originality for any answer. The system I have in mind checks that you are doing it on your own, and applies judgment around the software's percentage rather than treating any nonzero number as a violation. The aim is to make sure no unjust case happens to anyone who has done the work honestly.
Q: Do we really need to develop a web application for the assignment?
A: No. You do not have to develop an interface, and you do not need to work across HTML, CSS, JavaScript, React, Redux, or any particular front-end thing. The assignment wants the logic — and in the logic, only the SQL part: write the SQL and include a snapshot of the SQL. Everything else is optional. Of course, if you want to build more, help is available, but the assignment does not require it.
Q: Can I use a mix of handwritten and typed answers, and use PowerPoint or Word to draw the ER diagram?
A: Yes, of course — handwritten, typed, or mixed; pen and paper, PowerPoint, Word, or any drawing tool. What matters is that you communicate what you know and that the diagram is technically correct. Marks are for expression, not beautification.
Exam Guidance Summary
- The course evaluation has four components: mid-semester, quiz one, quiz two, and the projects.
- The project assignment requires SQL logic only — no web application, no front-end stack (HTML, CSS, JavaScript, React, Redux). Write the SQL and include a snapshot of the SQL.
- An architectural design (ER) diagram is required for the assignment; any drawing tool, PowerPoint, Word, or pen and paper is acceptable.
- Submissions may be handwritten, typed, or mixed; there is no page-count heuristic. Depth of content matters more than verbosity, and presentation in tables is encouraged because it is easier to grade.
- The assignment problem statement comes from real 2021–22 business work shaped by 100 interviews and customer discovery — engage with it as a real problem.
- Plagiarism and AI-use checks apply; the checkers detect AI usage and cross-assignment matching. Work must be done honestly and individually; the policy is judgment-based around the reported percentage, not automatic punishment.
- Mid-semester marks (regular and makeup) are pending due to a change of the notification channel; feedback and justification will be available once the marks are published.
Key Industry Applications
- Real-world: relational hegemony until 2005 — SQL and its frameworks as the de facto standard for three decades; Microsoft Access noted as learning-only, not commercial.
- Real-world: the four technology waves — GUI operating systems (1980s), the internet (1990s), big data and smartphones (2005 onwards), generative AI (now); Kodak as the cautionary example of a former hegemony wiped out by the next wave.
- Real-world: Google and Yahoo built their own file systems; Hadoop pooled commodity systems into clusters; the Hadoop file system and Google file system managed data across them.
- Real-world: MongoDB went from unheard-of seven or eight years ago to being used by all the applications in the last five years; Cassandra and Neo4j lead other database niches.
- Real-world: workload-driven database choice — IRCTC, Instagram, and Amazon represent three different access patterns; the 200-users-a-day, one-million-search-users, and gigabytes-per-minute workloads each demand different systems.
- Real-world: blockchain as a database — Bitcoin (2009) and Ethereum (2016), DAOs, trust-in-code, tamper-evident trails; Solana with proof of history, EVM-based systems, and newcomers such as Aptos; IPFS as block-level storage.
- Real-world: indexing everywhere — relational, NoSQL (MongoDB, Cassandra), graph, and even blockchain databases all answer the same "how do we access data faster" question; third-party tools such as Sphinx exist outside the database engine itself.
- Real-world: transactional correctness in IRCTC railway reservations, hotel and flight booking systems, and Amazon-style price updates under concurrent users.
DDA Lecture 12 notes · The Evolution of Database Systems: Indexing, Transactions, and Concurrency
Sections Breakdown
The relational hegemony of 1980-2005, the four technology waves from GUI to generative AI, and the constants that survive every overhaul.
The three walls big data exposed, distributed file systems and Hadoop, the NoSQL players MongoDB, Cassandra and Neo4j, and workload-driven database choice.
Trust delivered by code: DAOs, removal of intermediaries, tamper-evident trails, Bitcoin and Ethereum, and judging blockchain by its own job.
Seek time versus transfer time, the worked 30-block full-scan cost, the index payoff, and the doctor-prescription framing of index choice.
The 10,000-wide domain with 15 values, bucket hashing, chaining, open addressing and multiple hashing, and one science applied to many systems.
Order-dependent outcomes like the book-price race, the illusion of sole access, and lock-based versus timestamp-based mechanisms.
Isolation, atomicity, consistency and durability defined in standard form, and why the mechanisms exist because ACID cannot be hand-guaranteed.
The four evaluative components, the SQL-logic project with ER diagram, submission formats, and the plagiarism and AI policy.
The instructor's exam guidance: evaluation components, SQL-only project with ER diagram, formats, and the judgment-based integrity policy.
How the lecture's ideas appear in industry: technology waves, NoSQL players, workload-driven choice, blockchain, and indexing everywhere.
Exam Revision Notes
Below is the distilled, exam-ready core. Every entry comes from the full explanation above. Use this section for rapid review; return to the main notes when a point needs more context.
The Thirty-Year Cycle of Database Technology
Must-know: Every 10-15 years the technology stack overhauls completely; survivors embrace the new wave. The fundamentals - storing data, retrieving it fast, keeping it correct under concurrency - stay constant across all waves.
⚠️ Top pitfall: Assuming today's dominant tool will remain dominant - Kodak was a hegemony and was still wiped out when the digital wave arrived.
Self-check: Name the four waves the lecture lists and what each rewarded.
The Big Data Era and the Rise of NoSQL
Must-know: The database you need depends on the workload: reads (10,000 searches/minute), writes (gigabytes/minute ingest), or rare access each demand different engines; RDBMS buys stability via normalization, NoSQL buys scale and speed.
⚠️ Top pitfall: Asking which database is 'more secure' - security is a bundle (continuity, integrity, availability, user experience) and the answer always depends on the use case.
Self-check: Why did MongoDB arise despite SQL being the standard? What three walls did big data expose?
Blockchain: A Different Kind of Database
Must-know: Blockchain provides trust with code: DAOs, removal of intermediaries, a proper trail of evidence, and tamper-resistance that even the system owner cannot bypass. The use case decides the technology; there are more than two database families.
⚠️ Top pitfall: Calling blockchain 'a slow database' and stopping there - it optimizes tamper-evidence and trustlessness, not throughput.
Self-check: What four concrete mechanisms make up blockchain's 'trust in code' pitch?
Indexing: The Problem, the Mechanism, and the Payoff
Must-know: t_seek >> t_access (seek time is an order higher than transfer time) is why indexes exist: they convert full scans (one seek per block) into a few targeted seeks. Index creation and maintenance cost time; heavy usage pays it back.
⚠️ Top pitfall: Indexing attributes nobody queries - the maintenance cost stays but the payback never arrives.
Self-check: Why does seek time dominate the cost of a full file scan?
Connects to: Hashing: One Science, Many Applications
Hashing: One Science, Many Applications
Must-know: Domain {1,...,10,000} vs 15 actual values - bucket by 100s (B1={1..100}, B2={101..200},...), hash each value to its bucket, resolve collisions inside the bucket. Same theory in data structures and databases; only the application (associative array vs attribute index) differs.
⚠️ Top pitfall: Assuming open addressing works like chaining (overflow pointers) - open addressing probes forward within the same table ((i+1) mod M, ...) and uses no overflow space.
Self-check: Why is a one-slot-per-value scheme wasteful for 15 values in a 10,000-wide domain?
Connects to: Indexing: The Problem, the Mechanism, and the Payoff
Transactions: The Problem of Concurrent Access
Must-know: Concurrent access creates order-dependent outcomes: read-writes and write-writes change results. The requirement: each user feels like the only user. Two mechanisms: lock-based (lock the resource, granularity varies) and timestamp-based (token per access, served in token order).
⚠️ Top pitfall: Freezing the whole database for every access (the naive answer) works but destroys concurrency - locks come in granularities, and timestamps only need to order conflicting accesses.
Self-check: Why does the book-price example's outcome flip depending on timing, even though every single operation is correct?
Connects to: ACID: The Four Properties
ACID: The Four Properties
Must-know: ACID: Atomicity (all or nothing - never 'money debited, room not reserved'), Consistency (constraints before and after, e.g. 10 seats = 10 reservations), Isolation (every user feels alone), Durability (committed changes persist even after crashes). Mechanisms (locking, timestamps) exist because these cannot be guaranteed by hand.
⚠️ Top pitfall: Believing careful programming alone can deliver ACID under concurrency - even multithreaded applications cannot guarantee these properties by hand; that is why the mechanisms exist.
Self-check: Which ACID property forbids 'your money is debited, but the room is not reserved'?
Connects to: Transactions: The Problem of Concurrent Access
Assignment and Evaluation Guidance
Must-know: Project = SQL logic only (write SQL + snapshot), plus an ER diagram; any format (handwritten/typed/mixed), no page target, no web app or front-end stack; plagiarism and AI checkers apply but judgment is applied around the reported percentage.
⚠️ Top pitfall: Building a web application for the assignment - the requirement is the logic and the SQL part with a snapshot, nothing else.
Self-check: What four components make up the course evaluation?
Exam Guidance Summary
Must-know: Four evaluation components; SQL-logic project with ER diagram; handwritten/typed/mixed allowed; judgment-based plagiarism policy.
Connects to: Assignment and Evaluation Guidance
Was this lecture useful?
BitsNotes AI Assistant
Subject Notes AssistantConfigure AI Chat
Choose how to access the chatbotSigned in as
Powered by BitsNotes — 20 messages per day. No API key needed. Want unlimited access? Use "Bring Your Own Key" mode.
Sign in to use AI Chat
Get 20 free AI messages per day to ask questions about your lecture notes. Sign in with Google or GitHub — it takes 5 seconds.
Sign In to BitsNotesSwitch to "Bring Your Own Key" tab above for unlimited access with any OpenAI-compatible provider.