Topic

#Databases

107 posts tagged “Databases”.

Chisato Chisato · · 5 min read

Raft vs Paxos: Consensus Algorithms Compared

Raft and Paxos both let a distributed cluster agree on a value despite failures — Raft trades some flexibility for a design built to be understood.

#Distributed Systems #Computer Science #Databases
Chisato Chisato · · 4 min read

What Is the Outbox Pattern in Microservices?

The outbox pattern writes an event to the same database transaction as a state change, then publishes it reliably — solving the dual-write problem.

#Distributed Systems #Databases #Cloud Infrastructure
The Lycoris Team The Lycoris Team · · 4 min read

What Is a Roaring Bitmap?

A roaring bitmap is a compressed bitmap format that splits data into chunks and picks the best internal representation for each — fast and space-efficient.

#Computer Science #Data Structures #Databases
The Lycoris Team The Lycoris Team · · 4 min read

PgBouncer and Postgres Pooling Modes Explained

PgBouncer sits between clients and Postgres, reusing a small pool of real connections. Session, transaction, and statement modes trade features for scale.

#Databases #PostgreSQL #Performance
Chisato Chisato · · 4 min read

Postgres Logical Replication Explained

Logical replication streams row-level changes between Postgres databases instead of copying raw disk blocks — enabling selective sync, upgrades, and CDC.

#Databases #Cloud #DevOps
The Lycoris Team The Lycoris Team · · 4 min read

Index Cardinality: Why Some Indexes Don't Help

Cardinality is how many distinct values a column has. Low-cardinality columns make poor index candidates because the database still scans most of the table.

#Databases #SQL #Computer Science
Chisato Chisato · · 4 min read

What Are Vector Clocks? Ordering Distributed Events

A vector clock is a per-node counter array that lets distributed systems tell whether one event happened before another, without a shared clock.

#Distributed Systems #Databases #Cloud
The Lycoris Team The Lycoris Team · · 4 min read

Quorum Consensus Explained: N, W, and R

Quorum consensus lets distributed databases tune consistency and availability by requiring reads and writes to touch overlapping subsets of replicas.

#Databases #Distributed Systems #Cloud
Chisato Chisato · · 4 min read

What Is Replication Lag? Causes and Fixes

Replication lag is the delay between a write on the primary database and its arrival on a replica. What causes it, how to measure it, and how to reduce it.

#Databases #Cloud #Performance
The Lycoris Team The Lycoris Team · · 4 min read

What Is a Database View?

A database view is a saved SQL query that behaves like a table — simplifying complex joins and restricting access, without storing the data twice.

#Databases #SQL #Data
The Lycoris Team The Lycoris Team · · 5 min read

Clustered vs Non-Clustered Index Explained

A clustered index determines the physical row order on disk; a non-clustered index is a separate lookup structure. How they differ and when to use each.

#Databases #SQL #Performance
The Lycoris Team The Lycoris Team · · 4 min read

Read-Your-Writes Consistency Explained

Read-your-writes consistency guarantees a client sees its own writes immediately, even when other clients might not yet. How it's implemented.

#Databases #Distributed Systems #Computer Science
The Lycoris Team The Lycoris Team · · 5 min read

Two-Phase Commit vs. Saga Pattern Explained

Two-phase commit locks resources until every node agrees to a transaction; the saga pattern trades that guarantee for availability using compensating steps.

#Databases #Distributed Systems #Computer Science
Chisato Chisato · · 5 min read

What Is a Wide-Column Database? NoSQL Explained

A wide-column database stores data in column families keyed by row, built for massive write throughput and horizontal scale across many machines.

#Databases #Data Engineering #Cloud
The Lycoris Team The Lycoris Team · · 4 min read

SQL CTEs vs Subqueries: When to Use Which

Common table expressions and subqueries both let you build a query from smaller pieces, but they differ in readability, reuse, and optimizer behavior.

#Databases #SQL #Backend
The Lycoris Team The Lycoris Team · · 4 min read

B-Trees vs LSM-Trees: Choosing a Storage Engine

B-trees update data in place for fast, predictable reads; LSM-trees batch writes sequentially for higher write throughput. How databases pick.

#Databases #Computer Science #Data Structures
The Lycoris Team The Lycoris Team · · 5 min read

What Is a Distributed Lock?

A distributed lock coordinates exclusive access to a shared resource across multiple processes or machines, preventing race conditions in distributed systems.

#Databases #Distributed Systems #Backend
The Lycoris Team The Lycoris Team · · 4 min read

Natural Keys vs Surrogate Keys in Database Design

Natural keys use real-world data as a primary key; surrogate keys use a generated ID. Here's how to choose, with the trade-offs of each.

#Databases #SQL #Backend
Chisato Chisato · · 4 min read

PACELC Theorem Explained: Beyond CAP

PACELC extends CAP theorem by adding a tradeoff that applies even when there's no partition: latency versus consistency. Here's how it works.

#Databases #Distributed Systems #Computer Science
Chisato Chisato · · 5 min read

Synchronous vs Asynchronous Database Replication

Synchronous replication waits for a replica to confirm a write before committing; asynchronous doesn't. The choice trades latency against durability.

#Databases #Distributed Systems #Cloud
The Lycoris Team The Lycoris Team · · 4 min read

PostgreSQL JSONB Explained

JSONB stores JSON in PostgreSQL as a parsed, indexable binary format instead of raw text. How it works, and when to reach for it.

#Databases #SQL #Backend
The Lycoris Team The Lycoris Team · · 4 min read

The N+1 Query Problem: What It Is and How to Fix It

The N+1 query problem fires one query per row instead of one query total, quietly turning a fast page into hundreds of round trips. How to spot and fix it.

#Databases #Performance #SQL
The Lycoris Team The Lycoris Team · · 5 min read

Hash Join vs Nested Loop Join vs Merge Join

Hash joins, nested loop joins, and merge joins are the three ways a database executes a JOIN — here's when the query planner picks each one.

#Databases #SQL #Performance
The Lycoris Team The Lycoris Team · · 4 min read

Hash Index vs B-Tree Index: When to Use Each

A hash index gives O(1) equality lookups but no range scans; a B-tree supports both. Here's how the two database index types actually differ.

#Databases #SQL #Computer Science
Chisato Chisato · · 5 min read

IVF vs HNSW: Vector Index Algorithms Compared

IVF clusters vectors into partitions to narrow a search; HNSW builds a navigable graph. Both trade recall for speed differently at scale.

#AI #Databases #LLMs
Chisato Chisato · · 4 min read

MongoDB vs PostgreSQL: Which Database Fits?

MongoDB vs PostgreSQL compared: document vs relational modeling, schema flexibility, joins, and transactions — how to pick the right one.

#Databases #PostgreSQL #Backend
Chisato Chisato · · 4 min read

What Is DuckDB? In-Process Analytics, Explained

DuckDB is an embedded, columnar SQL database built for fast analytical queries directly inside your application process. How it works.

#Databases #SQL #Data Engineering
Chisato Chisato · · 4 min read

ACID vs BASE: Two Approaches to Database Consistency

ACID guarantees strict consistency after every transaction; BASE trades that for availability and scale. How each model works and when to pick one.

#Databases #Computer Science #Backend
The Lycoris Team The Lycoris Team · · 4 min read

What Is a Composite Index in a Database?

A composite index spans multiple columns in a fixed order, speeding up queries that filter or sort on that combination. How column order changes everything.

#Databases #SQL #Performance
The Lycoris Team The Lycoris Team · · 5 min read

When to Denormalize a Database (and Why)

Denormalization trades write-time consistency for read-time speed by duplicating data — the right call once joins become your bottleneck.

#Databases #SQL #Backend
Chisato Chisato · · 4 min read

Reverse ETL Explained

Reverse ETL moves data out of the warehouse and into operational tools like a CRM, flipping the direction of a traditional ETL pipeline. How it works.

#Databases #Data Engineering #Backend
The Lycoris Team The Lycoris Team · · 4 min read

Cache-Aside vs Read-Through Caching Explained

Cache-aside puts the application in charge of loading cache misses; read-through delegates that job to the cache itself. How each pattern works.

#Databases #Performance #Backend
The Lycoris Team The Lycoris Team · · 4 min read

What Is a Database Cursor? Row-by-Row Traversal

A database cursor is a pointer that lets you fetch a query's result set one row at a time instead of all at once. How cursors work and when to use them.

#Databases #SQL #Backend
The Lycoris Team The Lycoris Team · · 4 min read

Point-in-Time Recovery Explained: PITR for Databases

Point-in-time recovery restores a database to any moment between backups by replaying transaction logs, undoing bad deploys and accidental deletes.

#Databases #Cloud #DevOps
Chisato Chisato · · 4 min read

Prisma vs Drizzle: Comparing TypeScript ORMs

Prisma generates a type-safe client from a schema file and runs through its own query engine; Drizzle is a thinner, SQL-like query builder with no engine.

#Databases #TypeScript #Developer Tools
The Lycoris Team The Lycoris Team · · 4 min read

GROUP BY vs HAVING in SQL: What's the Difference

GROUP BY collapses rows into groups for aggregation; HAVING filters those groups afterward. How the two clauses differ and where each runs in query order.

#Databases #SQL #Backend
The Lycoris Team The Lycoris Team · · 4 min read

What Is a Bitmap Index?

A bitmap index uses a bit array per distinct value to speed up queries on low-cardinality columns, and combines multiple filters with fast bitwise AND/OR.

#Databases #SQL #Performance
The Lycoris Team The Lycoris Team · · 4 min read

What Is Write Amplification? SSDs and Databases

Write amplification is when a system writes more data physically than the logical write requested, wearing out storage faster and hurting throughput.

#Databases #Hardware #Performance
The Lycoris Team The Lycoris Team · · 4 min read

Redis Persistence: RDB vs AOF, Explained

Redis is in-memory, so RDB snapshots and the AOF log are how it survives a restart — each trades durability against performance differently.

#Redis #Databases #Performance
The Lycoris Team The Lycoris Team · · 6 min read

How to Read a Postgres EXPLAIN ANALYZE Query Plan

A step-by-step guide to running EXPLAIN ANALYZE in PostgreSQL and reading the query plan it returns — node types, costs, and where the real time went.

#Databases #SQL #Performance
The Lycoris Team The Lycoris Team · · 5 min read

What Is a Database Trigger?

A database trigger is a procedure that runs automatically on an insert, update, or delete — enforcing rules the application layer can't guarantee.

#Databases #SQL #Backend
The Lycoris Team The Lycoris Team · · 5 min read

Postgres Index Types: B-Tree vs GIN vs GiST

Postgres offers several index types beyond the default B-tree. When GIN and GiST outperform it for arrays, JSONB, full-text search, and ranges.

#Databases #SQL #Performance
The Lycoris Team The Lycoris Team · · 5 min read

What Is a Covering Index?

A covering index holds every column a query needs, letting the database answer from the index alone without a lookup back to the table.

#Databases #SQL #Performance
The Lycoris Team The Lycoris Team · · 4 min read

Data Warehouse vs Data Lake: What's the Difference?

A data warehouse stores structured, pre-modeled data optimized for queries; a data lake stores raw data of any shape. When each one fits.

#Databases #Data Engineering #Backend
The Lycoris Team The Lycoris Team · · 4 min read

Primary Key vs Foreign Key vs Unique Constraint

Primary keys identify a row, foreign keys link one table to another, and unique constraints just prevent duplicates. How the three differ in SQL.

#Databases #SQL #Backend
The Lycoris Team The Lycoris Team · · 4 min read

Database Deadlocks Explained: Causes and Prevention

A database deadlock happens when two transactions each wait on a lock the other holds. Why deadlocks occur, how databases detect them, and how to avoid them.

#Databases #SQL #Backend
The Lycoris Team The Lycoris Team · · 5 min read

The Raft Consensus Algorithm, Explained

Raft is a consensus algorithm that lets a cluster of servers agree on a shared state even when some nodes fail. How leader election and log replication work.

#Distributed Systems #Computer Science #Databases
The Lycoris Team The Lycoris Team · · 5 min read

Write-Through vs Write-Back vs Write-Around Caching

Write-through writes to cache and store together, write-back delays the store write, write-around skips the cache on writes entirely. When to use each.

#Databases #Performance #Backend
The Lycoris Team The Lycoris Team · · 4 min read

Star Schema vs Snowflake Schema: Which to Use

Star schema denormalizes dimensions into flat tables for fast queries; snowflake schema normalizes them to save space. How to choose for your warehouse.

#Databases #Data Engineering #Backend
The Lycoris Team The Lycoris Team · · 4 min read

What Is Database Vacuuming? Why Postgres Needs It

Vacuuming reclaims space left by deleted and updated rows in databases like PostgreSQL, preventing bloat and transaction ID wraparound.

#Databases #PostgreSQL #Backend
Chisato Chisato · · 4 min read

Time-Series Databases Explained

A time-series database is optimized for timestamped data — metrics, sensor readings, prices. How it differs from general-purpose databases.

#Databases #Data Engineering #Backend
The Lycoris Team The Lycoris Team · · 4 min read

What Is MVCC? Multi-Version Concurrency Control

MVCC lets readers and writers work on a database concurrently without blocking each other, by keeping multiple versions of each row instead of locking it.

#Databases #Computer Science #Backend
The Lycoris Team The Lycoris Team · · 4 min read

How Database Query Optimizers Work

A query optimizer turns declarative SQL into an execution plan by estimating the cost of alternative strategies. How that estimation works and how to read a plan.

#Databases #SQL #Backend
The Lycoris Team The Lycoris Team · · 5 min read

What Is SQLite? The Database Inside Your App

SQLite is a serverless, file-based SQL database compiled directly into an application. How it works, why it's everywhere, and when to reach for it.

#Databases #SQL #Backend
The Lycoris Team The Lycoris Team · · 4 min read

What Is an LSM Tree? Log-Structured Merge Trees

An LSM tree batches writes in memory and flushes them as sorted files on disk, trading read complexity for the fast, sequential writes many databases rely on.

#Databases #Computer Science #Data Structures
The Lycoris Team The Lycoris Team · · 5 min read

What Is Two-Phase Commit (2PC)? Distributed Transactions

Two-phase commit coordinates a transaction across multiple databases with a prepare phase and a commit phase, trading availability for strong consistency.

#Databases #Distributed Systems #Computer Science
The Lycoris Team The Lycoris Team · · 5 min read

What Is a Read Replica? Database Scaling Explained

A read replica is a synced copy of a database that serves read queries, taking load off the primary. How replication lag and failover actually work.

#Databases #SQL #Backend
The Lycoris Team The Lycoris Team · · 5 min read

What Is a Graph Database?

A graph database stores data as nodes and relationships instead of tables, making deeply connected queries fast instead of a chain of costly joins.

#Databases #Data Engineering #Backend
Chisato Chisato · · 4 min read

What Is a CRDT? Conflict-Free Replicated Data Types

A CRDT is a data structure that merges concurrent edits from multiple replicas automatically, without coordination or conflicts, using math instead of locks.

#Databases #Cloud #Computer Science
The Lycoris Team The Lycoris Team · · 4 min read

What Is a Merkle Tree? Hash Trees Explained

A Merkle tree hashes data in pairs up to a single root hash, letting huge datasets be verified for integrity without downloading all of them.

#Security #Computer Science #Databases
Chisato Chisato · · 4 min read

What Is Eventual Consistency in Distributed Systems?

Eventual consistency guarantees that replicas converge over time, not instantly. How it differs from strong consistency and when it's acceptable.

#Databases #Distributed Systems #Computer Science
The Lycoris Team The Lycoris Team · · 4 min read

What Is a CTE? Common Table Expressions Explained

A CTE is a named, temporary result set defined with WITH that you can reference elsewhere in a SQL query. How they work and when to use one.

#Databases #SQL #Backend
The Lycoris Team The Lycoris Team · · 4 min read

Optimistic vs Pessimistic Locking in Databases

Optimistic locking checks for conflicts at write time; pessimistic locking blocks other writers up front. How each works and when to pick one.

#Databases #Backend #SQL
Chisato Chisato · · 4 min read

ETL vs ELT: How Modern Data Pipelines Work

ETL transforms data before loading it into a warehouse; ELT loads raw data first and transforms it inside the destination. How the two approaches differ.

#Databases #Data Engineering #Backend
The Lycoris Team The Lycoris Team · · 4 min read

Data Lakehouse Explained: What It Is and How It Works

A data lakehouse combines a data lake's cheap object storage with a data warehouse's transactional guarantees and schema. How the architecture works.

#Databases #Data Engineering #Backend
The Lycoris Team The Lycoris Team · · 4 min read

What Is Write-Ahead Logging (WAL)?

Write-ahead logging records changes to a log before applying them to a database, making crash recovery and replication possible. Here's how it works.

#Databases #SQL #Backend
The Lycoris Team The Lycoris Team · · 4 min read

Columnar vs. Row-Oriented Databases

Row-oriented databases store each record together on disk; columnar databases store each column together. The layout decides which workloads are fast.

#Databases #Data Engineering #Backend
Chisato Chisato · · 4 min read

What Is a Knowledge Graph?

A knowledge graph stores facts as entities and labeled relationships instead of rows or documents, letting queries traverse connections directly.

#AI #Databases #LLMs
The Lycoris Team The Lycoris Team · · 4 min read

What Is Change Data Capture (CDC)? Explained

Change data capture streams row-level inserts, updates, and deletes out of a database in real time, powering sync pipelines, caches, and event-driven systems.

#Databases #Data Engineering #Backend
The Lycoris Team The Lycoris Team · · 4 min read

What Is a B-Tree? The Structure Behind DB Indexes

A B-tree is a self-balancing tree that keeps data sorted with logarithmic search, insert, and delete time — the structure behind most database indexes.

#Computer Science #Data Structures #Databases
Chisato Chisato · · 4 min read

What Is SQL Injection? The Attack and the Fix

SQL injection lets attackers run arbitrary database queries by smuggling SQL into user input. Parameterized queries close the hole. Here's how it works.

#Security #Databases #Web Development
The Lycoris Team The Lycoris Team · · 4 min read

Consistent Hashing Explained

Consistent hashing maps keys and nodes onto the same ring so adding or removing a server only reshuffles a small fraction of keys, not all of them.

#Computer Science #Algorithms #Databases
The Lycoris Team The Lycoris Team · · 5 min read

The N+1 Query Problem and How to Fix It

The N+1 query problem turns one database request into hundreds by issuing a separate query per row. Here's how to spot it and fix it.

#Databases #SQL #Performance
The Lycoris Team The Lycoris Team · · 4 min read

OLTP vs OLAP: Two Very Different Ways to Query Data

OLTP systems handle many small, fast transactions like orders and logins; OLAP systems run large analytical queries across historical data for reporting.

#Databases #SQL #Backend
Chisato Chisato · · 4 min read

SQL Window Functions Explained (With Examples)

SQL window functions compute values across a set of rows without collapsing them, unlike GROUP BY. How OVER, PARTITION BY, and ranking work.

#Databases #SQL #Backend
The Lycoris Team The Lycoris Team · · 4 min read

ACID Transactions Explained: Database Guarantees

ACID — atomicity, consistency, isolation, durability — defines the guarantees a database transaction makes so concurrent, failure-prone operations stay correct.

#Databases #SQL #Backend
The Lycoris Team The Lycoris Team · · 4 min read

What Is an ORM? Object-Relational Mapping Explained

An ORM lets you query a database using your programming language's objects instead of raw SQL. How they work, what they trade off, and when to skip one.

#Databases #Developer Tools #Web Development
Chisato Chisato · · 4 min read

CAP Theorem Explained: Consistency vs Availability

CAP theorem says a distributed system can't guarantee consistency, availability, and partition tolerance all at once. What the trade-off means in practice.

#Databases #Distributed Systems #Computer Science
The Lycoris Team The Lycoris Team · · 4 min read

What Is Database Normalization? A Practical Guide

Database normalization organizes tables to eliminate redundant data and update anomalies. The normal forms explained with a worked example.

#Databases #SQL #Backend
The Lycoris Team The Lycoris Team · · 5 min read

What Is Database Sharding? Scaling Explained

Database sharding splits one dataset across many servers so no single machine holds it all. How sharding works, how to pick a shard key, and the trade-offs.

#Databases #Scalability #Backend
The Lycoris Team The Lycoris Team · · 4 min read

What Is Database Indexing? Faster Queries, Explained

A database index is a sorted data structure that lets the engine find rows without scanning the whole table. How indexes work, and when they help or hurt.

#Databases #SQL #Performance
Chisato Chisato · · 5 min read

Build Your Own Redis in 200 Lines of Python

Build a Redis clone in Python that the real redis-cli can talk to — a TCP server, the RESP protocol, key expiry, and an in-memory store in under 200 lines.

#Databases #Developer Tools #Python
Chisato Chisato · · 6 min read

What Is Caching? Cache Strategies, Explained

Caching keeps a copy of expensive data somewhere faster. How cache-aside, write-through, and TTLs work — and why invalidation is the hard part.

#Performance #Databases #Web Development
Chisato Chisato · · 3 min read

What Are Vector Embeddings? Meaning as Numbers

A vector embedding turns text, images, or audio into numbers where similar meanings land close together — the foundation of semantic search and RAG.

#AI #Machine Learning #Databases
Chisato Chisato · · 5 min read

Redis vs Memcached: Which Cache Should You Use?

Redis and Memcached are both in-memory caches, but they differ on data types, persistence, and threading. How to choose — and when each one wins.

#Redis #Databases #Performance
The Lycoris Team The Lycoris Team · · 4 min read

What Is Apache Kafka? Event Streaming, Explained

Apache Kafka is a distributed event-streaming platform built on a durable, append-only log. How topics, partitions, and consumers power real-time pipelines.

#Databases #DevOps #Cloud
Chisato Chisato · · 6 min read

What Is Redis? The In-Memory Data Store, Explained

Redis is an in-memory key-value store used as a cache, database, and message broker. How it works, why it's sub-millisecond fast, and when to use it.

#Redis #Databases #Performance
The Lycoris Team The Lycoris Team · · 4 min read

SQL vs NoSQL: How to Actually Choose

SQL and NoSQL aren't rivals — they suit different shapes of data. How relational and non-relational databases compare, and how to pick.

#Databases #Cloud #Developer Tools
The Lycoris Team The Lycoris Team · · 5 min read

The Quiet Rise of Edge Databases

Putting compute at the edge is old news — now the data is moving there too. Edge databases promise low latency everywhere, with some real trade-offs.

#Cloud #Databases #Edge

← All topics