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 learningRelational database concepts
Learn how relational databases organize information into tables, rows, and columns, using relationships, keys, constraints, and SQL to manage structured data.
Start learningSQL 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 learningDatabase management systems
Explore database management systems and their responsibilities for storing, querying, securing, indexing, and maintaining application data.
Start learningDatabase architecture
Understand database architecture, including storage engines, query processors, transaction managers, memory structures, connection handling, and client-server communication.
Start learningDatabase schema design
Learn how to design database schemas by identifying entities, attributes, relationships, data types, constraints, and structures that support application requirements.
Start learningDatabase normalization and denormalization
Understand normalization techniques for reducing data duplication and update anomalies, along with denormalization strategies for improving read performance.
Start learningPrimary keys and foreign keys
Learn how primary keys uniquely identify records and foreign keys establish relationships between tables while maintaining referential integrity.
Start learningDatabase relationships
Explore how database tables relate through keys and constraints, including relationship cardinality, referential integrity, and entity associations.
Start learningOne-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 learningDatabase 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 learningIndexes 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 learningClustered 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 learningComposite indexes
Learn how composite indexes use multiple columns to support multi-condition queries, including column ordering, leftmost-prefix behavior, and index selection.
Start learningCovering indexes
Understand covering indexes that contain all columns required by a query, reducing additional table lookups and improving read performance.
Start learningUnique indexes
Explore unique indexes for enforcing uniqueness across one or more columns while supporting efficient lookups and preventing duplicate values.
Start learningIndex fragmentation and maintenance
Learn how index fragmentation affects database performance and how index reorganizations, rebuilds, statistics updates, and maintenance schedules improve efficiency.
Start learningIndex 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 learningDatabase 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 learningQuery optimization
Learn SQL query optimization techniques involving efficient joins, filtering, indexing, projections, subqueries, execution plans, and reducing unnecessary data processing.
Start learningDatabase performance tuning
Explore database performance tuning through query analysis, index optimization, resource monitoring, configuration changes, workload analysis, and bottleneck investigation.
Start learningSQL statistics and cardinality estimation
Understand database statistics and cardinality estimation, including histograms, data distribution, selectivity, and how query optimizers estimate operation costs.
Start learningTransactions 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 learningTransaction management
Understand transaction management through begin, commit, and rollback operations, including nested operations, error handling, and transaction boundaries in application workflows.
Start learningTransaction isolation levels
Explore transaction isolation levels and how they control visibility of concurrent changes, balancing data consistency with transaction throughput and locking overhead.
Start learningRead 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 learningSnapshot isolation
Understand snapshot isolation and multi-version concurrency control, including versioned data visibility, consistent reads, and differences from traditional locking approaches.
Start learningConcurrency control
Learn how databases coordinate simultaneous transactions using locking, versioning, isolation levels, and concurrency-control mechanisms to maintain consistent data.
Start learningOptimistic and pessimistic concurrency
Compare optimistic concurrency, which detects conflicting updates, with pessimistic concurrency, which locks resources to prevent conflicts before they occur.
Start learningLocking and blocking
Understand database locking and blocking, including lock acquisition, transaction conflicts, lock waits, resource contention, and techniques for reducing blocking.
Start learningShared 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 learningDeadlocks 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 learningStored 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 learningViews and materialized views
Compare standard views, which represent stored queries, with materialized views, which persist query results, including refresh strategies and performance considerations.
Start learningDatabase partitioning
Learn how database partitioning divides large tables or indexes into smaller manageable sections to improve maintenance, query performance, and data organization.
Start learningHorizontal and vertical partitioning
Compare horizontal partitioning, which distributes rows across partitions, with vertical partitioning, which separates columns into different storage structures.
Start learningDatabase sharding
Understand database sharding as a horizontal scaling technique that distributes data across multiple database instances using shard keys and routing strategies.
Start learningDatabase replication
Explore database replication techniques for maintaining copies of data across multiple servers to support availability, read scaling, and disaster recovery.
Start learningPrimary and replica architecture
Understand primary-replica database architecture, including write handling, replication streams, replica synchronization, failover, and consistency considerations.
Start learningRead 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 learningDatabase backup and recovery
Understand full, differential, and transaction log backups, along with restore strategies, point-in-time recovery, recovery objectives, and backup verification.
Start learningHigh availability and disaster recovery
Explore database high availability and disaster recovery through replication, clustering, failover, backups, geographic redundancy, and recovery planning.
Start learningConnection pooling
Understand database connection pooling, including connection reuse, pool sizing, timeouts, connection limits, and how pooling reduces connection-management overhead.
Start learningDatabase migrations
Learn how database migrations manage schema changes across application versions using versioned scripts, migration tools, rollback strategies, and deployment coordination.
Start learningDatabase versioning
Understand database versioning practices for tracking schema evolution, coordinating application releases, managing migration history, and maintaining compatibility across environments.
Start learningEntity Framework Core performance
Explore Entity Framework Core performance optimization through efficient LINQ queries, projections, no-tracking queries, compiled queries, batching, and query analysis.
Start learningORM 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 learningSQL 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 learningDocument databases
Understand document databases that store records as flexible documents, including nested structures, schema evolution, document relationships, and document-oriented queries.
Start learningKey-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 learningColumn-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 learningGraph databases
Understand graph databases that represent entities as nodes and relationships as edges, enabling efficient traversal and analysis of highly connected data.
Start learningMongoDB fundamentals
Learn MongoDB fundamentals, including databases, collections, BSON documents, CRUD operations, flexible schemas, queries, and application integration.
Start learningDocument modeling in MongoDB
Explore MongoDB document modeling techniques, including embedding, referencing, nested documents, schema validation, and choosing structures based on application access patterns.
Start learningMongoDB indexing and aggregation
Understand MongoDB indexing and aggregation pipelines, including compound indexes, query optimization, filtering, grouping, sorting, and data transformation.
Start learningConsistency 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 learningDistributed databases
Understand distributed database architecture, including data distribution, replication, partitioning, coordination, fault tolerance, and operation across multiple nodes.
Start learningCAP theorem
Learn the CAP theorem and its implications for distributed databases, including consistency, availability, and partition tolerance during network failures.
Start learningStrong and eventual consistency
Compare strong consistency, which provides up-to-date reads after successful writes, with eventual consistency, where replicas converge over time.
Start learningDatabase scalability
Explore database scalability techniques such as vertical scaling, horizontal scaling, sharding, replication, partitioning, and workload distribution.
Start learningCaching fundamentals
Understand caching as a technique for storing frequently accessed data closer to applications, reducing repeated computation, database queries, and response latency.
Start learningWhy 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 learningClient-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 learningIn-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 learningDistributed caching
Explore distributed caching systems that share cached data across multiple application instances, including centralized cache servers, consistency, availability, and network overhead.
Start learningCache-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 learningRead-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 learningWrite-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 learningWrite-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 learningCache 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 learningCache 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 learningTime-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 learningLeast 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 learningLeast 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 learningCache consistency
Understand cache consistency challenges that arise when cached values differ from database state, including stale reads, concurrent updates, invalidation, and synchronization approaches.
Start learningCache 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 learningCache warming
Explore cache warming techniques that preload frequently accessed data before traffic arrives, reducing cold-start latency and improving initial application performance.
Start learningRedis 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 learningRedis architecture
Explore Redis architecture, including its event-driven execution model, memory management, client connections, persistence mechanisms, replication, and cluster deployment.
Start learningRedis data structures
Learn Redis data structures and their supported operations, including strings, lists, sets, hashes, sorted sets, streams, and their application use cases.
Start learningRedis 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 learningRedis 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 learningRedis Pub/Sub
Redis Pub/Sub: Learn its key concepts, practical implementation, architecture, and interview considerations.
Start learningRedis persistence
Understand Redis persistence options, including RDB snapshots and AOF logs, their durability characteristics, recovery behavior, and configuration trade-offs.
Start learningRedis replication
Explore Redis replication, including primary-replica synchronization, replication streams, asynchronous replication, failover considerations, and read distribution.
Start learningRedis Sentinel
Learn how Redis Sentinel monitors Redis instances, detects failures, performs automatic failover, and provides service discovery for highly available Redis deployments.
Start learningRedis Cluster
Understand Redis Cluster architecture, including hash slots, data sharding, node communication, replication, failover, and distributed key management.
Start learningRedis 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 learningRedis caching strategies
Explore practical Redis caching strategies, including cache-aside, TTL-based expiration, key naming, cache invalidation, data serialization, and memory management.
Start learningRedis security
Learn how to secure Redis using authentication, access control lists, network restrictions, TLS, protected deployment settings, and secure credential management.
Start learningCaching in ASP.NET Core
Caching in ASP.NET Core: Learn its key concepts, practical implementation, architecture, and interview considerations.
Start learningIMemoryCache
Learn how IMemoryCache stores application data in process memory, including cache entries, expiration policies, size limits, cache priorities, and dependency-based invalidation.
Start learningIDistributedCache
Understand the IDistributedCache abstraction in .NET for accessing shared cache providers such as Redis and SQL Server across multiple application instances.
Start learningResponse caching
Explore ASP.NET Core response caching, including middleware configuration, cache-control behavior, HTTP headers, and caching eligible HTTP responses.
Start learningOutput 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 learningHTTP 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 learningETags 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 learningCDN caching
Understand how Content Delivery Networks cache static and dynamic content at geographically distributed edge locations to reduce latency and origin-server workload.
Start learningCache 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 learningDatabase and cache integration
Explore how applications coordinate database operations and cache updates through cache-aside workflows, write strategies, transaction boundaries, and data synchronization.
Start learningCache 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 learningDistributed data consistency
Learn how distributed applications maintain data consistency across databases, replicas, services, and caches using coordination, versioning, replication, and eventual consistency strategies.
Start learningMonitoring 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 learningReal-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 learningPractice & 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.
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