InterviewTreedInterviewTreed
All learning paths

Data, Cloud & DevOps

Databases & Caching

Prepare for database and caching interviews, covering relational and NoSQL databases, database architecture, indexing, transactions, Redis, distributed caching, performance optimization, and data consistency.

Your learning roadmap

Explore the key concepts

Use these subtopics as a study checklist. Start with the fundamentals, then progress to practical examples and interview preparation.

Database fundamentals

Understand the foundations of database systems, including data storage, retrieval, organization, database engines, and the role of databases in modern applications.

Start learning

Relational database concepts

Learn how relational databases organize information into tables, rows, and columns, using relationships, keys, constraints, and SQL to manage structured data.

Start learning

SQL and NoSQL databases

Compare SQL and NoSQL databases in terms of data models, schemas, query capabilities, consistency, scalability, and suitability for different application requirements.

Start learning

Database management systems

Explore database management systems and their responsibilities for storing, querying, securing, indexing, and maintaining application data.

Start learning

Database architecture

Understand database architecture, including storage engines, query processors, transaction managers, memory structures, connection handling, and client-server communication.

Start learning

Database schema design

Learn how to design database schemas by identifying entities, attributes, relationships, data types, constraints, and structures that support application requirements.

Start learning

Database normalization and denormalization

Understand normalization techniques for reducing data duplication and update anomalies, along with denormalization strategies for improving read performance.

Start learning

Primary keys and foreign keys

Learn how primary keys uniquely identify records and foreign keys establish relationships between tables while maintaining referential integrity.

Start learning

Database relationships

Explore how database tables relate through keys and constraints, including relationship cardinality, referential integrity, and entity associations.

Start learning

One-to-one, one-to-many, and many-to-many relationships

Understand one-to-one, one-to-many, and many-to-many relationships, including foreign key placement, junction tables, and practical relational schema design.

Start learning

Database constraints

Learn how NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK, and DEFAULT constraints enforce data integrity and business rules at the database level.

Start learning

Indexes and index types

Understand how database indexes accelerate data retrieval and explore common index types, their internal structures, storage costs, and impact on write operations.

Start learning

Clustered and non-clustered indexes

Compare clustered and non-clustered indexes, including their storage organization, lookup behavior, key structures, and impact on database query performance.

Start learning

Composite indexes

Learn how composite indexes use multiple columns to support multi-condition queries, including column ordering, leftmost-prefix behavior, and index selection.

Start learning

Covering indexes

Understand covering indexes that contain all columns required by a query, reducing additional table lookups and improving read performance.

Start learning

Unique indexes

Explore unique indexes for enforcing uniqueness across one or more columns while supporting efficient lookups and preventing duplicate values.

Start learning

Index fragmentation and maintenance

Learn how index fragmentation affects database performance and how index reorganizations, rebuilds, statistics updates, and maintenance schedules improve efficiency.

Start learning

Index seek vs index scan

Compare index seeks and index scans, understand how database engines access indexed data, and identify query patterns that influence execution plan choices.

Start learning

Database query execution plans

Understand how database query execution plans represent operations such as scans, seeks, joins, sorts, and lookups, and how to interpret estimated and actual plans.

Start learning

Query optimization

Learn SQL query optimization techniques involving efficient joins, filtering, indexing, projections, subqueries, execution plans, and reducing unnecessary data processing.

Start learning

Database performance tuning

Explore database performance tuning through query analysis, index optimization, resource monitoring, configuration changes, workload analysis, and bottleneck investigation.

Start learning

SQL statistics and cardinality estimation

Understand database statistics and cardinality estimation, including histograms, data distribution, selectivity, and how query optimizers estimate operation costs.

Start learning

Transactions and ACID properties

Learn the ACID properties of database transactions—atomicity, consistency, isolation, and durability—and how they protect data correctness during concurrent operations.

Start learning

Transaction management

Understand transaction management through begin, commit, and rollback operations, including nested operations, error handling, and transaction boundaries in application workflows.

Start learning

Transaction isolation levels

Explore transaction isolation levels and how they control visibility of concurrent changes, balancing data consistency with transaction throughput and locking overhead.

Start learning

Read uncommitted, read committed, repeatable read, and serializable

Compare Read Uncommitted, Read Committed, Repeatable Read, and Serializable isolation levels, including dirty reads, non-repeatable reads, phantom reads, and concurrency trade-offs.

Start learning

Snapshot isolation

Understand snapshot isolation and multi-version concurrency control, including versioned data visibility, consistent reads, and differences from traditional locking approaches.

Start learning

Concurrency control

Learn how databases coordinate simultaneous transactions using locking, versioning, isolation levels, and concurrency-control mechanisms to maintain consistent data.

Start learning

Optimistic and pessimistic concurrency

Compare optimistic concurrency, which detects conflicting updates, with pessimistic concurrency, which locks resources to prevent conflicts before they occur.

Start learning

Locking and blocking

Understand database locking and blocking, including lock acquisition, transaction conflicts, lock waits, resource contention, and techniques for reducing blocking.

Start learning

Shared and exclusive locks

Learn how shared locks support concurrent reads while exclusive locks protect modifications, including lock compatibility and their role in transaction isolation.

Start learning

Deadlocks and deadlock prevention

Explore how database deadlocks occur when transactions wait on conflicting resources and how consistent access ordering, shorter transactions, and retry handling reduce deadlock risk.

Start learning

Stored procedures and functions

Understand stored procedures and database functions, including parameters, reusable SQL logic, execution plans, return values, and when database-side processing is appropriate.

Start learning

Views and materialized views

Compare standard views, which represent stored queries, with materialized views, which persist query results, including refresh strategies and performance considerations.

Start learning

Database partitioning

Learn how database partitioning divides large tables or indexes into smaller manageable sections to improve maintenance, query performance, and data organization.

Start learning

Horizontal and vertical partitioning

Compare horizontal partitioning, which distributes rows across partitions, with vertical partitioning, which separates columns into different storage structures.

Start learning

Database sharding

Understand database sharding as a horizontal scaling technique that distributes data across multiple database instances using shard keys and routing strategies.

Start learning

Database replication

Explore database replication techniques for maintaining copies of data across multiple servers to support availability, read scaling, and disaster recovery.

Start learning

Primary and replica architecture

Understand primary-replica database architecture, including write handling, replication streams, replica synchronization, failover, and consistency considerations.

Start learning

Read replicas and write scaling

Learn how read replicas distribute read workloads across database instances and explore the challenges of write scaling, replication lag, and read-after-write consistency.

Start learning

Database backup and recovery

Understand full, differential, and transaction log backups, along with restore strategies, point-in-time recovery, recovery objectives, and backup verification.

Start learning

High availability and disaster recovery

Explore database high availability and disaster recovery through replication, clustering, failover, backups, geographic redundancy, and recovery planning.

Start learning

Connection pooling

Understand database connection pooling, including connection reuse, pool sizing, timeouts, connection limits, and how pooling reduces connection-management overhead.

Start learning

Database migrations

Learn how database migrations manage schema changes across application versions using versioned scripts, migration tools, rollback strategies, and deployment coordination.

Start learning

Database versioning

Understand database versioning practices for tracking schema evolution, coordinating application releases, managing migration history, and maintaining compatibility across environments.

Start learning

Entity Framework Core performance

Explore Entity Framework Core performance optimization through efficient LINQ queries, projections, no-tracking queries, compiled queries, batching, and query analysis.

Start learning

ORM fundamentals

Understand object-relational mapping and how ORM frameworks map application classes to database tables, track entity changes, manage relationships, and generate SQL queries.

Start learning

SQL vs NoSQL database selection

Learn how to choose between SQL and NoSQL databases based on data structure, relationships, consistency requirements, query patterns, scalability, and operational complexity.

Start learning

Document databases

Understand document databases that store records as flexible documents, including nested structures, schema evolution, document relationships, and document-oriented queries.

Start learning

Key-value databases

Explore key-value databases that store values against unique keys, including lookup performance, simple data access patterns, expiration, and caching use cases.

Start learning

Column-family databases

Learn how column-family databases organize data into rows and column families, supporting distributed storage and high-volume workloads with flexible column structures.

Start learning

Graph databases

Understand graph databases that represent entities as nodes and relationships as edges, enabling efficient traversal and analysis of highly connected data.

Start learning

MongoDB fundamentals

Learn MongoDB fundamentals, including databases, collections, BSON documents, CRUD operations, flexible schemas, queries, and application integration.

Start learning

Document modeling in MongoDB

Explore MongoDB document modeling techniques, including embedding, referencing, nested documents, schema validation, and choosing structures based on application access patterns.

Start learning

MongoDB indexing and aggregation

Understand MongoDB indexing and aggregation pipelines, including compound indexes, query optimization, filtering, grouping, sorting, and data transformation.

Start learning

Consistency models in NoSQL databases

Explore consistency models used by NoSQL databases, including strong consistency, eventual consistency, tunable consistency, and the trade-offs between availability and coordination.

Start learning

Distributed databases

Understand distributed database architecture, including data distribution, replication, partitioning, coordination, fault tolerance, and operation across multiple nodes.

Start learning

CAP theorem

Learn the CAP theorem and its implications for distributed databases, including consistency, availability, and partition tolerance during network failures.

Start learning

Strong and eventual consistency

Compare strong consistency, which provides up-to-date reads after successful writes, with eventual consistency, where replicas converge over time.

Start learning

Database scalability

Explore database scalability techniques such as vertical scaling, horizontal scaling, sharding, replication, partitioning, and workload distribution.

Start learning

Caching fundamentals

Understand caching as a technique for storing frequently accessed data closer to applications, reducing repeated computation, database queries, and response latency.

Start learning

Why caching is needed

Learn why applications use caching to improve response times, reduce database load, handle traffic spikes, lower infrastructure costs, and improve overall scalability.

Start learning

Client-side and server-side caching

Compare client-side caching in browsers and applications with server-side caching in backend services and infrastructure, including their benefits and invalidation challenges.

Start learning

In-memory caching

Understand in-memory caching, where frequently accessed data is stored in application memory for fast retrieval, including memory limits, expiration, and process-local cache behavior.

Start learning

Distributed caching

Explore distributed caching systems that share cached data across multiple application instances, including centralized cache servers, consistency, availability, and network overhead.

Start learning

Cache-aside pattern

Learn the cache-aside pattern, where applications check the cache first, retrieve missing data from the database, and populate the cache for subsequent requests.

Start learning

Read-through caching

Understand read-through caching, where the cache retrieves missing data from the underlying data source automatically and manages population during read operations.

Start learning

Write-through caching

Explore write-through caching, where updates are written to the cache and underlying data store together to maintain a consistent read path.

Start learning

Write-behind caching

Learn write-behind caching, where updates are first stored in the cache and persisted to the database asynchronously, improving write throughput with durability trade-offs.

Start learning

Cache invalidation strategies

Understand cache invalidation techniques for keeping cached data accurate, including explicit deletion, update-based invalidation, time-based expiration, and event-driven invalidation.

Start learning

Cache expiration and eviction policies

Explore cache expiration and eviction strategies, including time-based removal, memory-pressure eviction, and policies for deciding which cached entries should be discarded.

Start learning

Time-to-live (TTL)

Learn how Time-to-Live determines how long cached entries remain valid before expiration, including TTL configuration and its impact on data freshness and cache hit rates.

Start learning

Least Recently Used (LRU)

Understand the Least Recently Used eviction policy, which removes entries that have not been accessed recently when cache capacity needs to be reclaimed.

Start learning

Least Frequently Used (LFU)

Explore the Least Frequently Used eviction policy, which removes entries with lower access frequency to retain data that is requested more often.

Start learning

Cache consistency

Understand cache consistency challenges that arise when cached values differ from database state, including stale reads, concurrent updates, invalidation, and synchronization approaches.

Start learning

Cache stampede and cache penetration

Learn how cache stampedes occur when many requests simultaneously rebuild an expired entry and how cache penetration results from repeated requests for nonexistent data.

Start learning

Cache warming

Explore cache warming techniques that preload frequently accessed data before traffic arrives, reducing cold-start latency and improving initial application performance.

Start learning

Redis fundamentals

Understand Redis as an in-memory data store used for caching, messaging, counters, sessions, and fast data access through a rich set of data structures.

Start learning

Redis architecture

Explore Redis architecture, including its event-driven execution model, memory management, client connections, persistence mechanisms, replication, and cluster deployment.

Start learning

Redis data structures

Learn Redis data structures and their supported operations, including strings, lists, sets, hashes, sorted sets, streams, and their application use cases.

Start learning

Redis strings, lists, sets, and hashes

Understand Redis strings, lists, sets, and hashes, including their commands, data organization, performance characteristics, and practical caching and application patterns.

Start learning

Redis sorted sets

Explore Redis sorted sets, which associate unique members with scores to support ranking, range queries, leaderboards, priority processing, and time-based data retrieval.

Start learning

Redis Pub/Sub

Redis Pub/Sub: Learn its key concepts, practical implementation, architecture, and interview considerations.

Start learning

Redis persistence

Understand Redis persistence options, including RDB snapshots and AOF logs, their durability characteristics, recovery behavior, and configuration trade-offs.

Start learning

Redis replication

Explore Redis replication, including primary-replica synchronization, replication streams, asynchronous replication, failover considerations, and read distribution.

Start learning

Redis Sentinel

Learn how Redis Sentinel monitors Redis instances, detects failures, performs automatic failover, and provides service discovery for highly available Redis deployments.

Start learning

Redis Cluster

Understand Redis Cluster architecture, including hash slots, data sharding, node communication, replication, failover, and distributed key management.

Start learning

Redis transactions and pipelines

Compare Redis transactions using MULTI, EXEC, and WATCH with pipelining, which batches commands to reduce network round trips and improve throughput.

Start learning

Redis caching strategies

Explore practical Redis caching strategies, including cache-aside, TTL-based expiration, key naming, cache invalidation, data serialization, and memory management.

Start learning

Redis security

Learn how to secure Redis using authentication, access control lists, network restrictions, TLS, protected deployment settings, and secure credential management.

Start learning

Caching in ASP.NET Core

Caching in ASP.NET Core: Learn its key concepts, practical implementation, architecture, and interview considerations.

Start learning

IMemoryCache

Learn how IMemoryCache stores application data in process memory, including cache entries, expiration policies, size limits, cache priorities, and dependency-based invalidation.

Start learning

IDistributedCache

Understand the IDistributedCache abstraction in .NET for accessing shared cache providers such as Redis and SQL Server across multiple application instances.

Start learning

Response caching

Explore ASP.NET Core response caching, including middleware configuration, cache-control behavior, HTTP headers, and caching eligible HTTP responses.

Start learning

Output caching

Learn how ASP.NET Core output caching stores generated endpoint responses on the server, including policies, expiration, variation, resource limits, and cache invalidation.

Start learning

HTTP caching headers

Understand HTTP caching headers such as Cache-Control, Expires, Age, and Vary, and how they control response freshness and browser or intermediary cache behavior.

Start learning

ETags and conditional requests

Explore ETags and conditional HTTP requests using headers such as If-None-Match and If-Match to validate cached responses and avoid unnecessary data transfers.

Start learning

CDN caching

Understand how Content Delivery Networks cache static and dynamic content at geographically distributed edge locations to reduce latency and origin-server workload.

Start learning

Cache performance optimization

Learn how to optimize cache performance by measuring hit ratios, choosing suitable expiration policies, reducing serialization overhead, managing memory, and avoiding excessive cache misses.

Start learning

Database and cache integration

Explore how applications coordinate database operations and cache updates through cache-aside workflows, write strategies, transaction boundaries, and data synchronization.

Start learning

Cache invalidation in distributed systems

Understand cache invalidation challenges across multiple services and cache nodes, including event-driven invalidation, versioned keys, synchronization, and stale-data prevention.

Start learning

Distributed data consistency

Learn how distributed applications maintain data consistency across databases, replicas, services, and caches using coordination, versioning, replication, and eventual consistency strategies.

Start learning

Monitoring database and cache performance

Explore monitoring techniques for databases and caches using query latency, connection usage, cache hit ratios, memory consumption, throughput, replication lag, and operational alerts.

Start learning

Real-world database architecture scenarios

Apply database and caching concepts to real-world architecture problems involving high traffic, read-heavy workloads, transactional systems, distributed services, scalability, and reliability.

Start learning

Practice & revise

Interview questions

Practice interview questions with answers, key points, and practical examples.

Test your knowledge

Explore 80 questions for this topic, covering concepts, practical examples, and interview scenarios.

Browse 80 questions

Keep learning step by step

Work through the concepts, practice explaining them in your own words, and use interview questions to check your understanding.

Explore another learning path