liveBook · Manning

ACID

As explained in Building Web APIs with ASP.NET Core

ACID is a set of transaction properties—atomicity, consistency, isolation, and durability—that define reliable behavior for database transactions.

ACID describes four transaction properties—atomicity, consistency, isolation, and durability—that support reliable database behavior. A database management system provides these properties as part of its support for structured, secure data management. section 4.1

In an ASP.NET Core web API, a DbContext commonly represents one unit of work within a single HTTP request/response lifecycle. Keeping the database operations for that business transaction together helps preserve ACID properties and coordinate concurrency-related changes. section 4.3.4

Board-game API transaction flow

A GET request can use an injected DbContext to read board games, map the resulting entities to DTOs, return JSON, and then dispose the context. A PUT request can use the same unit-of-work pattern for a mechanics-wide rename, such as replacing “war” with “conflict.” section 4.3.4

builder.Services.AddDbContext<ApplicationDbContext>(options =>
   options.UseSqlServer(
       builder.Configuration.GetConnectionString("DefaultConnection"))
   );

Configure the application DbContext with dependency injection and a SQL Server provider before using it for request-scoped database work. section 4.3.4

How Building Web APIs with ASP.NET Core covers it

How deep it goes
Defines the four properties and connects them to DbContext usage, without detailing each property’s internal implementation.
Examples
Uses board-game reads and a mechanics-wide rename as concrete transaction scenarios.
What it assumes
Assumes familiarity with databases and introduces DBMS selection before application implementation.
What you can do after
Apply it via DbContext lifetimes to organize database work within a unit of work.
How it connects
Connects ACID with database management systems, transactions, units of work, DbContext, and concurrency.

Also explained in

Compare how 7 books explain ACID →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building Web APIs with ASP.NET Core. The section links point to the parts of the book it draws on.