Skip to main content
Back to Tags

Database

195 items tagged with "database"

Filter by type:

Patterns16

Pattern

Repository

Mediates between the domain and data mapping layers via a collection-like interface for accessing domain objects, hiding persistence details.

Pattern

Unit of Work

Tracks objects affected by a business transaction and coordinates writing out changes and resolving concurrency as a single commit.

Pattern

Data Mapper

Moves data between objects and a database while keeping them independent, so domain objects carry no persistence knowledge.

Pattern

Active Record

Wraps a database row in an object that carries both the data and the methods to load, save, and delete itself.

Pattern

Sharding

Horizontally partitions a data store into independent shards so capacity and load scale beyond a single node.

Pattern

Index Table

Create secondary index tables over data stores queried by non-key fields to speed up lookups that would otherwise scan.

Pattern

Materialized View

Precompute and store read-optimized views of data so expensive queries become fast lookups against ready-made results.

Pattern

Write-Through Cache

A caching strategy where every write goes to the cache and the backing store synchronously, keeping the two consistent at the cost of write latency.

Pattern

Materialized View

A precomputed, stored result set that trades storage and refresh cost for fast reads of expensive queries, aggregations, or denormalized projections.

Pattern

Polyglot Persistence

An architecture that uses multiple, purpose-fit data stores within one system, matching each store's strengths to each data access pattern.

Pattern

Star Schema

A dimensional data-modeling pattern with a central fact table linked to denormalized dimension tables, optimized for fast, intuitive analytical queries.

Pattern

Slowly Changing Dimension (SCD)

Techniques for handling changes to dimension attributes over time in a data warehouse, ranging from overwriting to preserving full historical versions.

Pattern

Optimistic Concurrency Control

A concurrency strategy that lets transactions proceed without locking and validates at commit, retrying on conflict, assuming conflicts are rare.

Pattern

Pessimistic Locking

A concurrency strategy that acquires locks on data before use to prevent concurrent modification, ensuring correctness under high contention at the cost of throughput.

Pattern

Two-Phase Commit (2PC)

A distributed-transaction protocol that coordinates multiple participants to commit or abort atomically through a prepare phase and a commit phase.

Pattern

Pagination

Splits a large result set into smaller pages so APIs and UIs can return and traverse data incrementally instead of loading everything at once.

Anti-Patterns21

Anti-Pattern

Shared Database Integration

Multiple services directly sharing the same database tables

Anti-Pattern

N+1 Query Problem

Loading a list, then firing one extra query per row to fetch related data, turning a single page load into hundreds of round-trips.

Anti-Pattern

God Table

A single table accumulating dozens or hundreds of unrelated columns for many concepts, becoming a contention and maintenance bottleneck.

Anti-Pattern

Entity-Attribute-Value (EAV) Abuse

Storing arbitrary attributes as rows of name/value pairs to fake a schemaless model, sacrificing type safety, integrity, and query performance.

Anti-Pattern

One True Lookup Table (OTLT)

Cramming every reference list into one generic lookup table keyed by category, defeating foreign keys and mixing unrelated domains.

Anti-Pattern

SELECT * Everywhere

Querying all columns by default instead of naming the ones you need, wasting I/O and creating brittle coupling to schema order and shape.

Anti-Pattern

Implicit Columns in INSERT

Writing INSERT statements without naming columns, relying on positional order so a schema change silently misaligns or corrupts data.

Anti-Pattern

Premature Denormalization

Duplicating data across tables for speed before any measured need, creating update anomalies and integrity bugs to solve a problem you may not have.

Anti-Pattern

Over-Normalization

Splitting data into so many tables that every read requires a sprawl of joins, hurting performance and readability with no integrity benefit.

Anti-Pattern

Storing Everything as JSON Blobs

Dumping structured data into opaque JSON text columns by default, abandoning constraints, indexing, and queryability the database would provide.

Anti-Pattern

Natural Primary Keys Misuse

Using mutable, business-meaningful values like email or SSN as primary keys, so a real-world change cascades breakage through every referencing row.

Anti-Pattern

Soft Delete Everywhere

Adding an is_deleted flag to every table by default, so all queries must filter it, integrity decays, and tables bloat with dead rows.

Anti-Pattern

Polling the Database

Repeatedly querying a table on a tight loop to detect changes instead of using events or notifications, wasting resources and adding latency.

Anti-Pattern

Chatty Data Access

Making many fine-grained round-trips to the database for one logical operation, so network latency dominates and throughput collapses under load.

Anti-Pattern

No Connection Pooling

Opening a fresh database connection per request or query and closing it after, paying high handshake cost and exhausting connection limits under load.

Anti-Pattern

Timestamp Without Time Zone

Storing instants in local time without zone information, so values are ambiguous across regions and DST shifts, corrupting ordering and reporting.

Anti-Pattern

Floating-Point for Money

Storing monetary amounts in binary floating point, so rounding errors accumulate and totals fail to reconcile to the cent.

Anti-Pattern

Schemaless Sprawl

Treating a schemaless store as license to skip data design, so documents drift into inconsistent shapes that no consumer can reliably read.

Anti-Pattern

Hot Partition (Hot Shard)

A partitioning key that sends a disproportionate share of traffic to one shard, overloading it while the rest sit idle and capping the system at one node's throughput.

Anti-Pattern

SQL Injection via String Concatenation

Building SQL queries by concatenating untrusted input into the query string, letting attackers alter query logic and access or destroy data.

Anti-Pattern

Leaky API Abstraction

An API that exposes internal database schemas, implementation details, or storage structures, coupling clients to internals and blocking safe evolution.

Tutorials24

Tutorial

Migrating from MySQL to PostgreSQL

Complete guide to migrating databases from MySQL to PostgreSQL

Tutorial

Database Management with Prisma

Set up Prisma ORM for type-safe database access

Tutorial

How to run stateful workloads with a Kubernetes StatefulSet

Deploy databases and other stateful apps with stable network identities and per-pod persistent storage.

Tutorial

How to build a CRUD API on Amazon DynamoDB

Model data and implement create, read, update, and delete operations against Amazon DynamoDB from Node.js.

Tutorial

How to build a CRUD API on Azure Cosmos DB

Model documents and perform CRUD operations against Azure Cosmos DB for NoSQL from a .NET application.

Tutorial

How to build a CRUD app on Google Cloud Firestore

Model collections and perform CRUD operations and queries against Google Cloud Firestore from a web app.

Tutorial

How to provision a managed PostgreSQL database on Cloud SQL

Provision, secure, and connect to a managed PostgreSQL instance on Google Cloud SQL with private IP.

Tutorial

How to design and tune PostgreSQL indexes for query performance

Find slow queries with EXPLAIN, choose the right index types, and verify gains so reads stay fast without bloating writes.

Tutorial

How to manage versioned database migrations with Flyway

Set up Flyway, write versioned SQL migrations, and apply them repeatably across environments with validation and history tracking.

Tutorial

How to manage database migrations with Liquibase changelogs

Define schema changes in declarative Liquibase changesets, apply and roll them back, and track state across environments.

Tutorial

How to run SQLAlchemy database migrations with Alembic

Generate, edit, and apply Alembic migrations for a Python SQLAlchemy project, including autogeneration and safe downgrades.

Tutorial

How to evolve a database schema with Prisma Migrate

Use Prisma Migrate to turn schema.prisma changes into versioned SQL migrations and apply them in dev and production safely.

Tutorial

How to perform a zero-downtime database schema migration

Use the expand-and-contract pattern to change a live schema without downtime, keeping old and new code compatible during rollout.

Tutorial

How to set up MySQL primary-replica replication

Configure binary log replication from a MySQL primary to a replica for read scaling and high availability, then verify it.

Tutorial

How to design an effective MongoDB document schema

Model data for MongoDB by choosing embedding vs referencing based on access patterns, then index and validate the result.

Tutorial

How to implement the cache-aside pattern with Redis

Add a Redis read-through cache with TTLs and safe invalidation to reduce database load, including stampede protection.

Tutorial

How to partition a large PostgreSQL table by range

Use declarative range partitioning to split a large table by time, improving query pruning, maintenance, and data retention.

Tutorial

How to shard a MongoDB collection for horizontal scale

Enable sharding on a MongoDB cluster, choose a shard key, and distribute a collection across shards with verified balancing.

Tutorial

How to set up vector similarity search with pgvector

Install pgvector in PostgreSQL, store embeddings, build an ANN index, and run nearest-neighbor queries for semantic search.

Tutorial

How to store and query time-series data with TimescaleDB

Turn a PostgreSQL table into a TimescaleDB hypertable, add continuous aggregates, and apply retention for time-series workloads.

Tutorial

How to migrate a PostgreSQL database using logical replication

Move a PostgreSQL database to a new server with near-zero downtime using publications, subscriptions, and a final cutover.

Tutorial

How to design Elasticsearch index mappings and analyzers

Define explicit Elasticsearch mappings, configure analyzers for text search, and index documents for fast, accurate queries.

Tutorial

How to model an analytics table in ClickHouse

Create a MergeTree table in ClickHouse with the right ordering key and partitioning, then load data and run fast aggregations.

Tutorial

How to add semantic search with embeddings and a vector database

Add meaning-based search to an app by generating text embeddings and querying a vector database for nearest neighbors.

Blueprints9

Migrations16

Migration

Ad-hoc SQL to Flyway Migration

Adopt Flyway for repeatable database schema migrations and environment parity

Migration

Ad-hoc SQL to Liquibase Migration

Adopt Liquibase changelogs for auditable, repeatable schema migrations

Migration

DynamoDB to PostgreSQL Migration

Migrate DynamoDB single-table designs to relational PostgreSQL with new schema and access patterns

Migration

Entity Framework 6 to EF Core Migration

Migrate Entity Framework 6 data access to EF Core with updated mappings and migrations

Migration

Hibernate ddl-auto to Flyway Migration

Replace Hibernate schema auto-generation with explicit Flyway migrations

Migration

Liquibase to Flyway Migration

Move from Liquibase changelogs to Flyway versioned SQL (or Java) migrations

Migration

MySQL to Aurora PostgreSQL Migration

Migrate MySQL to Aurora PostgreSQL including schema translation and cutover

Migration

MySQL to PostgreSQL Migration

Migrate MySQL schema and data to PostgreSQL, translating queries and tuning indexes

Migration

Oracle Database to SQL Server Migration

Migrate Oracle schemas and PL/SQL workloads to SQL Server with T-SQL translation and operational redesign

Migration

Oracle to PostgreSQL Migration

Migrate Oracle Database to PostgreSQL with PL/SQL conversion

Migration

PostgreSQL 12 to PostgreSQL 16 Migration

Major-version upgrade PostgreSQL 12 → 16 with extension checks, replication/cutover, and performance validation

Migration

PostgreSQL to Aurora PostgreSQL Migration

Move PostgreSQL to managed Aurora PostgreSQL with minimal downtime using replication

Migration

SQL Server to Aurora PostgreSQL Migration

Migrate SQL Server to Aurora PostgreSQL with T-SQL rewrites and managed Postgres operations

Migration

SQL Server to Azure SQL Migration

Move SQL Server workloads to Azure SQL with compatibility checks and operational runbooks

Migration

SQL Server to PostgreSQL Migration

Migrate from SQL Server to PostgreSQL including stored procedures

Migration

SQLite to PostgreSQL Migration

Migrate an app from embedded SQLite to PostgreSQL for concurrency, HA, and operational tooling

Checklists10

Checklist

Database Migration Checklist

Detailed checklist for safely migrating databases with minimal downtime

Checklist

Database Migration Cutover Checklist

Step-by-step verification for safely switching production traffic from a source database to a migrated target with minimal risk.

Checklist

Oracle to PostgreSQL Pre-Flight Checklist

Pre-migration readiness checks for moving an Oracle database to PostgreSQL, covering data types, PL/SQL, and feature gaps.

Checklist

Zero-Downtime Database Migration Checklist

Checks for migrating a production database with no service interruption using dual-write, CDC, and gradual cutover techniques.

Checklist

Schema Change Safety Checklist

Safety checks for applying database schema changes to production without locking tables or breaking running applications.

Checklist

Backup and Restore Verification Checklist

Verification checks confirming database and data backups are complete, secure, and reliably restorable within recovery targets.

Checklist

MongoDB to PostgreSQL Migration Checklist

Readiness checks for migrating a document database on MongoDB to a relational PostgreSQL model.

Checklist

NoSQL Data Modeling Review Checklist

A review checklist for validating NoSQL data models against access patterns, partitioning, and scalability before migration.

Checklist

Database Version Upgrade Checklist

Checks for upgrading a database engine to a new major version with minimal risk to data integrity and availability.

Checklist

SQL Server to PostgreSQL Migration Checklist

Pre-migration readiness checks for moving a Microsoft SQL Server database to PostgreSQL, covering T-SQL, data types, and feature gaps.

Comparisons17

Comparison

RDS vs Aurora

Amazon RDS runs standard managed database engines; Amazon Aurora is AWS's cloud-native engine with a distributed storage layer offering higher performance and availability.

Comparison

MongoDB vs DynamoDB

Document database with rich querying versus a fully managed key-value and document store built for predictable scale on AWS.

Comparison

DynamoDB vs Cassandra

Managed AWS wide-column key-value store versus open-source Apache Cassandra for write-heavy, distributed workloads.

Comparison

Redis vs Memcached

Feature-rich in-memory data structure store versus a lean, multi-threaded distributed memory cache.

Comparison

Elasticsearch vs OpenSearch

The original search and analytics engine versus its Apache-licensed open-source fork led by AWS.

Comparison

ClickHouse vs Druid

Columnar OLAP database for fast analytics versus Apache Druid's real-time analytics datastore for time-series and event data.

Comparison

Postgres vs CockroachDB

The versatile single-node-first relational database versus a distributed, Postgres-compatible SQL database built for global scale.

Comparison

MySQL vs MariaDB

The widely deployed relational database now under Oracle versus its community-driven fork with diverging features.

Comparison

Aurora vs RDS

Amazon's cloud-native, high-performance database engine versus standard managed RDS running stock database engines.

Comparison

SQLite vs Postgres

An embedded, serverless, single-file database versus a full-featured client-server relational database system.

Comparison

Neo4j vs ArangoDB

A dedicated native graph database versus a multi-model database supporting graph, document, and key-value in one engine.

Comparison

pgvector vs Pinecone

A Postgres extension that adds vector search to your existing database versus a fully managed, purpose-built vector database.

Comparison

PostgreSQL vs Cassandra

A relational ACID database for complex queries versus a distributed wide-column store built for write-heavy linear scale.

Comparison

Redis vs DynamoDB

An in-memory data store for ultra-low-latency caching and structures versus a durable, managed NoSQL database for scale.

Comparison

MySQL vs MongoDB

A widely used relational database with structured schemas versus a flexible document database for evolving data.

Comparison

TimescaleDB vs InfluxDB

A Postgres extension that turns SQL into a time-series database versus InfluxDB, a purpose-built time-series platform.

Comparison

pgvector vs Dedicated Vector Database

pgvector adds vector search to PostgreSQL; a dedicated vector database is purpose-built. The choice trades operational simplicity against scale and specialized features.

Benchmarks17

Benchmark

TPC-C

The classic OLTP benchmark simulating an order-entry warehouse workload, measuring transactions per minute (tpmC) and price/performance.

Benchmark

TPC-H

An ad-hoc decision-support benchmark of 22 complex analytical queries over a star-like schema, reporting query throughput and power at fixed scale factors.

Benchmark

TPC-DS

A modern decision-support benchmark with 99 queries over a multi-snowflake retail schema, designed to stress complex analytics, data loading, and concurrency.

Benchmark

TPC-E

An OLTP benchmark modeling a brokerage firm with realistic data and read-heavy transactions, reporting tpsE as a more representative successor to TPC-C.

Benchmark

YCSB

The Yahoo! Cloud Serving Benchmark for NoSQL and key-value stores, defining standard read/write workload mixes to compare throughput and latency.

Benchmark

sysbench

A scriptable, multi-threaded benchmark tool widely used for MySQL/PostgreSQL OLTP tests as well as CPU, memory, and file I/O microbenchmarks.

Benchmark

pgbench

PostgreSQL's built-in benchmarking tool that runs a TPC-B-like transaction load and custom scripts to measure transactions per second and latency.

Benchmark

HammerDB

An open-source database load-testing tool implementing TPROC-C and TPROC-H (TPC-C/TPC-H-derived) workloads across many relational engines.

Benchmark

BenchBase

An extensible Java framework (successor to OLTPBench) for benchmarking relational databases with many built-in workloads via a common JDBC harness.

Benchmark

ClickBench

An open benchmark for analytical databases using a single wide web-analytics table and 43 queries to compare cold and hot OLAP query latency.

Benchmark

Star Schema Benchmark (SSB)

A simplified TPC-H derivative using a classic star schema and 13 queries in four flights to measure data-warehouse query performance.

Benchmark

OLTP vs OLAP Latency Benchmark

A comparative benchmark category contrasting transactional (OLTP) point-operation latency with analytical (OLAP) scan-and-aggregate latency to evaluate HTAP systems.

Benchmark

ANN-Benchmarks

The standard open benchmark for approximate nearest neighbor search, plotting recall against queries-per-second across vector index libraries and databases.

Benchmark

BigANN Benchmark

A billion-scale approximate nearest neighbor benchmark testing vector search algorithms on large data sets with constraints on memory, throughput, and recall.

Benchmark

Time-Series Ingestion Benchmark

A benchmark category measuring write throughput, query latency, and compression for time-series databases under high-cardinality metric and event ingestion.

Benchmark

In-Memory Store Benchmark (memtier/redis-benchmark)

Benchmarks for in-memory data stores like Redis and Memcached, measuring operations per second and sub-millisecond latency under varied key/value and pipeline settings.

Benchmark

LDBC Social Network Benchmark

The standard benchmark for graph databases, measuring interactive transactional and analytical query performance over a realistic, correlated social-network graph.

FAQs15

FAQ

What is the difference between SQL and NoSQL databases?

SQL (relational) databases store data in tables with fixed schemas and use SQL for queries, offering strong consistency and powerful joins; examples i...

FAQ

What does ACID mean in databases?

ACID is a set of guarantees that make database transactions reliable: Atomicity (a transaction either fully completes or fully rolls back), Consistenc...

FAQ

What is the CAP theorem?

The CAP theorem states that a distributed data store can provide at most two of three guarantees at the same time: Consistency (every read sees the la...

FAQ

What is database sharding?

Sharding is a horizontal partitioning technique that splits a large dataset across multiple database instances, each holding a subset of the rows. A s...

FAQ

What is the difference between normalization and denormalization?

Normalization organizes data to eliminate redundancy by splitting it into related tables, which reduces anomalies and keeps a single source of truth f...

FAQ

What is a database index and why does it matter?

An index is a separate data structure, usually a B-tree, that lets the database find rows matching a query without scanning the entire table. It drama...

FAQ

What is the difference between OLTP and OLAP?

OLTP (Online Transaction Processing) handles many short, concurrent transactions like orders, payments, and updates, optimized for fast writes and row...

FAQ

What is eventual consistency?

Eventual consistency is a model in distributed systems where replicas may temporarily hold different values, but if no new writes occur they will all ...

FAQ

What is the difference between a primary key and a foreign key?

A primary key uniquely identifies each row in a table and cannot be null or duplicated; it is the column (or set of columns) the database uses to addr...

FAQ

What is a materialized view?

A materialized view is a database object that stores the precomputed result of a query physically on disk, unlike a regular view which runs its query ...

FAQ

When should I use Redis?

Redis is an in-memory key-value data store known for very low latency, making it ideal as a cache in front of a slower primary database. Beyond cachin...

FAQ

What is a vector database?

A vector database stores and searches high-dimensional vector embeddings, the numeric representations of text, images, or other data produced by machi...

FAQ

What is database replication?

Replication keeps copies of a database on multiple servers, typically a primary that accepts writes and one or more replicas that receive the changes....

FAQ

What is data partitioning?

Partitioning divides a large table or dataset into smaller, manageable pieces based on a key such as date, region, or category. In databases it improv...

FAQ

What is data modeling?

Data modeling is the practice of defining how data is structured, related, and stored to meet an application's or analytics needs. It usually progress...

Glossaries22

Glossary

Schema Migration

The process of changing a database schema from one version to another

Glossary

Block Storage

Block storage is a storage architecture that splits data into fixed-size blocks presented to a server as a raw volume, on which a file system or database can be placed for low-latency, high-performance access.

Glossary

StatefulSet

A StatefulSet is a Kubernetes controller for stateful applications that provides pods with stable, unique identities, ordered deployment and scaling, and persistent per-pod storage.

Glossary

Persistent Volume

A persistent volume is a Kubernetes resource representing a piece of durable storage in the cluster whose lifecycle is independent of any individual pod, allowing data to survive pod restarts and rescheduling.

Glossary

ACID

ACID is a set of four properties — Atomicity, Consistency, Isolation, and Durability — that guarantee database transactions are processed reliably even in the presence of errors, crashes, or concurrent access.

Glossary

BASE

BASE (Basically Available, Soft state, Eventual consistency) is a consistency model for distributed systems that favors availability and partition tolerance over the strict guarantees of ACID, allowing data to converge over time.

Glossary

CAP Theorem

The CAP theorem states that a distributed data store can simultaneously provide at most two of three guarantees — Consistency, Availability, and Partition tolerance — forcing a trade-off when a network partition occurs.

Glossary

Eventual Consistency

Eventual consistency is a guarantee that, in the absence of new updates, all replicas of a piece of data will converge to the same value over time, though reads may temporarily return stale results.

Glossary

Sharding

Sharding is a database scaling technique that horizontally splits a dataset across multiple servers (shards), each holding a distinct subset of rows, so that load and storage are distributed.

Glossary

Partitioning

Partitioning is the practice of dividing a large table or dataset into smaller, more manageable pieces called partitions, which can be queried and maintained independently while appearing as a single logical entity.

Glossary

Replication

Replication is the process of copying and maintaining database data across multiple servers so that the same data is available on more than one node, improving availability, fault tolerance, and read scalability.

Glossary

Database Index

A database index is an auxiliary data structure that improves the speed of data retrieval on a table at the cost of extra storage and slower writes, by letting the engine locate rows without scanning the entire table.

Glossary

Normalization

Normalization is the process of organizing relational database tables to reduce data redundancy and improve integrity by decomposing them according to normal forms and linking related data with keys.

Glossary

Denormalization

Denormalization is the deliberate introduction of redundancy into a database schema — by duplicating or precomputing data — to improve read performance, accepting reduced write efficiency and integrity guarantees.

Glossary

OLTP

OLTP (Online Transaction Processing) refers to database systems optimized for large numbers of short, concurrent transactions — inserts, updates, and lookups — that support day-to-day operational applications.

Glossary

OLAP

OLAP (Online Analytical Processing) refers to systems optimized for complex analytical queries over large volumes of historical data, enabling aggregation, slicing, and multidimensional analysis for reporting and decision-making.

Glossary

Data Warehouse

A data warehouse is a centralized analytical database that stores integrated, structured data from multiple sources, optimized for querying and reporting rather than transactional processing.

Glossary

Change Data Capture (CDC)

Change Data Capture (CDC) is a technique for identifying and capturing changes made to data in a source database — inserts, updates, and deletes — and streaming them to downstream systems in near real time.

Glossary

Materialized View

A materialized view is a database object that stores the precomputed result of a query physically on disk, so reads return instantly without re-executing the underlying query, at the cost of keeping the result refreshed.

Glossary

Primary Key

A primary key is a column or set of columns that uniquely identifies each row in a relational database table, enforcing uniqueness and non-null values and serving as the row's canonical identifier.

Glossary

Foreign Key

A foreign key is a column or set of columns in one relational table that references the primary key of another table, enforcing referential integrity by ensuring referenced rows exist.

Glossary

Vector Search

Vector search finds items whose embeddings are closest to a query embedding, enabling semantic retrieval by meaning rather than exact keyword match.