Database Tutorials

Our database tutorials provide well-structured learning paths for both SQL and NoSQL databases. Covering essential concepts, query languages, database design, and optimization techniques, our tutorials are suitable for both beginners and intermediate developers. With free labs and practical examples, you'll gain hands-on experience in database operations across different database systems.

Restrict Database Access to the Application

Restrict Database Access to the Application

Limit PostgreSQL network access to the application security group and give the order application a database user with only the permissions it needs.
PostgreSQLAWS
Export and Rebuild a Database

Export and Rebuild a Database

Export a D1 database to SQL, rebuild a separate database, and compare recovered rows and constraints with the unchanged original.
CloudflareSQLite
Schedule Reservation Expiry

Schedule Reservation Expiry

Build a reservation service whose persistent Durable Object alarms survive restarts, expire only the intended hold, and remain safe when expiry work is repeated.
CloudflareSQLite
Broadcast Room Updates

Broadcast Room Updates

Build a room-scoped Durable Object WebSocket service that validates messages, broadcasts updates to connected peers, and keeps separate rooms isolated.
CloudflareSQLite
Recover an Accidental Ticket Deletion

Recover an Accidental Ticket Deletion

Recover a deleted ticket with D1 Time Travel and verify the original database binding and application reads.
CloudflareSQLite
Store and Query Customer Orders

Store and Query Customer Orders

Build an order table in PostgreSQL, insert customer orders and query the same stored data that an application reads.
PostgreSQLAWS
Add Ticket Search to a Worker

Add Ticket Search to a Worker

Build prepared CRUD queries for a D1-backed ticket API, filter records safely, and handle missing or invalid input.
CloudflareSQLite
Restore Orders from an RDS Snapshot

Restore Orders from an RDS Snapshot

Save a database snapshot, observe a controlled order deletion and recover the application's data by restoring a new RDS instance.
AWSPostgreSQL
Refresh Cached Data with TTL and Invalidation

Refresh Cached Data with TTL and Invalidation

Observe stale product data, refresh it after a short TTL and invalidate the correct cache key when the application updates its price.
RedisAWS
Persist a Room Activity Log

Persist a Room Activity Log

Build a SQLite-backed room activity log, prove that records survive local restarts and cloud redeployment, and keep each room's history isolated.
CloudflareSQLite
Keep Related Ticket Updates Consistent

Keep Related Ticket Updates Consistent

Keep ticket closure and resolution notes atomic with D1 batches, then continue sequential reads using session bookmarks.
CloudflareSQLite
Restore WebSocket Connection Context

Restore WebSocket Connection Context

Build a hibernation-compatible room service that stores safe per-connection attachments and reconstructs client context without depending on forced production eviction.
CloudflareSQLite
Coordinate Concurrent Reservations

Coordinate Concurrent Reservations

Build a bounded workshop reservation service, send requests concurrently, and prove that durable atomic updates prevent overbooking across restarts and deployments.
CloudflareSQLite
Create a PostgreSQL Database for an Application

Create a PostgreSQL Database for an Application

Create a private RDS PostgreSQL instance, connect with a standard SQL client and point an application at its database endpoint before cleaning up.
AWSPostgreSQL
Add a Cache to a Product Lookup

Add a Cache to a Product Lookup

Connect a product application to a Valkey cache and prove that repeated lookups return the same product without another source database read.
AWSRedis
Create a Support Ticket Database

Create a Support Ticket Database

Create a D1 ticket table, enforce valid data with SQL constraints, and keep local practice separate from cloud records.
CloudflareSQLite
Migrate a Ticket Schema

Migrate a Ticket Schema

Add ticket priority through ordered D1 migrations while preserving existing rows and checking local and remote rollout state.
CloudflareSQLite
Query and Index Ticket Activity

Query and Index Ticket Activity

Join tickets with activity, include zero-event counts, and justify a D1 index using the query plan.
CloudflareSQLite
  • Prev
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • ...
  • 136
  • Next