DVD Rental Database

From bibbleWiki
Jump to navigation Jump to search

Introduction

This is to provide details on the neon
I use this database for practicing the various languages I have learned. It is easy to install and easy to understand. They provide a Entity Relationship Diagram (ERD) to help understand the data.

DVD Rental API Caching

Whilst revisiting REST API I thought I would look at caching directives and implement them where appropriate.

Endpoint Pattern Related Tables Cache-Control Header Notes
/api/rentals rental, inventory no-store Real-time data; must not be cached anywhere.
/api/payments payment, customer no-store Financial data; sensitive and volatile.
/api/customers/{id} customer, address private, no-cache, must-revalidate User-specific; allow caching with revalidation.
/api/films film, language public, max-age=86400, immutable Stable metadata; safe for long caching.
/api/actors actor, film_actor public, max-age=86400, must-revalidate Mostly static; revalidate occasionally.
/api/categories category, film_category public, max-age=86400, immutable Rarely changes; versioned if possible.
/api/stores store, staff public, max-age=3600, must-revalidate Semi-static; allow short caching.
/api/inventory/{id} inventory, film no-cache, must-revalidate Stock levels change; revalidate before use.
/api/config Static config endpoints public, max-age=31536000, immutable Versioned config; aggressively cacheable.