Skip to content
Katabench
Try free

Topic

Databases & EF Core

EF Core and database engineering from query shape and indexes to concurrency, pagination, and connection management.

9 min read

Transaction isolation levels: the anomalies each level allows

Database transaction isolation levels are a menu of anomalies you tolerate, not a safety dial. Watch write skew commit, then add the retry Serializable needs.

Read article →
8 min read

EF Core bulk updates with ExecuteUpdate and ExecuteDelete

An EF Core bulk update that loads 50,000 entities to change one column pays per byte and per statement. ExecuteUpdate sends one statement and skips the tracker.

Read article →
7 min read

Optimistic concurrency in EF Core: stop silent overwrites

Two users edit the same row and the last save silently wins. Use EF Core concurrency tokens, handle DbUpdateConcurrencyException, and test the race properly.

Read article →
7 min read

Connection pooling: why your app ran out of connections

Connection pooling explained from the failure end: what a connection costs, the three ways pools drain, and why the timeout blames the wrong request.

Read article →
8 min read

How do database indexes work? B-trees, page by page

How do database indexes work? A B-tree is a small sorted structure with huge fanout, so a lookup reads a handful of pages instead of the whole table.

Read article →
7 min read

Skip and Take will betray you: offset vs keyset pagination

OFFSET pagination reads every row it skips, so page 2,000 costs 2,000 pages of work. Keyset pagination seeks straight to the next page. SQL and EF Core shown.

Read article →
7 min read

EF Core habits that quietly wreck performance

Nine EF Core habits that pass every test and quietly tank production performance: missing AsNoTracking, whole-entity fetches, N+1, cartesian explosion, more.

Read article →
6 min read

Your LINQ is fast; your query plan isn't

A well-written EF Core query can still do a sequential scan: no index, or a function on a column makes it non-sargable. How to read a query plan and fix it.

Read article →
6 min read

IQueryable vs IEnumerable: the one return type that decides where your query runs

Returning IEnumerable, or calling ToList too early, moves filtering and paging into memory. One type change turns an indexed WHERE into loading a million rows.

Read article →
6 min read

The N+1 query problem in EF Core: the most expensive habit in .NET

An EF Core loop that looks innocent fires one query per row. It passes every unit test and dies in production. How N+1 happens, the SQL it generates, the fix.

Read article →

Get new puzzles and .NET tips in your inbox

A short note when fresh kata land, plus the C# and performance tricks behind the grading. No spam, unsubscribe anytime.