Database Performance
Read/write model separation, N+1 avoidance, row limits, and AsNoTracking for EF Core and Dapper data access.
- CCM score
- 65 of 100
- skills.sh installs
- 741
- GitHub stars
- 1.3K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers CQRS-style read/write separation, with distinct read projections and write commands per aggregate
- Includes guidance on N+1 avoidance via
Includein EF Core andQueryMultipleAsyncbatching in Dapper - Enforces configurable row limits on every read method and keeps joins in SQL rather than application code
- Designed for teams choosing between EF Core and Dapper for read-heavy data access layers
Install
$ npx -y skills add aaronontheweb/dotnet-skills --skill database-performance -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Database Performance Patterns
When to Use This Skill
Use this skill when:
- Designing data access layers
- Optimizing slow database queries
- Choosing between EF Core and Dapper
- Avoiding common performance pitfalls
Core Principles
- Separate read and write models - Don't use the same types for both
- Think in batches - Avoid N+1 queries
- Only retrieve what you need - No SELECT *
- Apply row limits - Always have a configurable Take/Limit
- Do joins in SQL - Never in application code
- AsNoTracking for reads - EF Core change tracking is expensive
Read/Write Model Separation (CQRS Pattern)
Read and write models are fundamentally different - they have different shapes, columns, and purposes. Don't create a single "User" entity and reuse it everywhere.
- Read models are denormalized, optimized for query efficiency, and return multiple projection types (UserProfile, UserSummary, UserDetailForAdmin)
- Write models are normalized, validation-focused, and accept strongly-typed commands (CreateUserCommand, UpdateUserCommand)
Architecture
Details
- Repository
- github.com/aaronontheweb/dotnet-skills
- Categories
- Databases, .NET & C#
- First seen
- Jun 3, 2026
Questions
What does the database-performance skill do?
The database-performance skill gives data access patterns for performance, such as separating read and write models, avoiding N+1 queries, using AsNoTracking, applying row limits, and doing joins in SQL. It works with both EF Core and Dapper.
How do I install the database-performance skill?
Run npx -y skills add aaronontheweb/dotnet-skills --skill database-performance -y in your project. This lets the agent apply these data access patterns when you design data layers or optimize slow queries.
Which other skills are in the Databases category?
The database-performance skill sits in the Databases category alongside supabase-postgres-best-practices, prisma-client-api, prisma-database-setup, prisma-cli and prisma-postgres. It stands out by focusing on EF Core and Dapper access patterns for performance.
Does the database-performance skill need EF Core or Dapper?
The skill covers both EF Core and Dapper, so it helps whichever you use. Its examples show AsNoTracking and Include for EF Core, and QueryMultipleAsync batch queries for Dapper.
More from aaronontheweb/dotnet-skills
All 34- Dependency Injection Patterns741
- Dotnet Project Structure731
- Api Design723
- Type Design Performance723
- Ilspy Decompile695
- Package Management644
- Microsoft Extensions Configuration643
- Serialization630
- Testcontainers Integration Tests629
- Dotnet Slopwatch618
- Crap Analysis610
- Playwright Blazor Testing589
- Dotnet Local Tools579
- Aspire Integration Testing552
- Mjml Email Templates541
- Aspire Service Defaults526
- Snapshot Testing515
- Aspire Configuration514
- Dotnet Devcert Trust486
- Skills Index Snippets485
- Playwright Ci Caching483
- Akka Net Best Practices477
- Mailpit Integration471
- OpenTelemetry NET Instrumentation464
Similar to Database Performance
More Databasesoptimizing-ef-core-queriesdotnet/skills8.3K installsOptimize slow EF Core queries by cutting generated SQL, round-trips, and in-memory materialization.
efcore-patternsaaronontheweb/dotnet-skills1.7K installsEntity Framework Core guidance covering NoTracking defaults, query splitting, migration handling, and a dedicated migration service.
cqrs-implementationsickn33/agentic-awesome-skills207 installsArchitecture guide for separating read and write models, with CQRS patterns and projection workflows.
ef-coregithub/awesome-copilot9.7K installsChecklist of Entity Framework Core best practices covering DbContext design, queries, migrations, and testing.
sql-best-practicesmindrally/skills855 installsOpinionated SQL style guide covering formatting, joins, indexing, transactions, and injection safety for query writing.
projection-patternswshobson/agents11.3K installsPractical patterns for building read models and projections from event streams in CQRS systems.