Skip to content

feat(learning): add roadmap "Cache-aside with Redis" (en/fr)#71

Merged
Derssa merged 1 commit into
mainfrom
feat/learning-cache-aside-roadmap
Jul 17, 2026
Merged

feat(learning): add roadmap "Cache-aside with Redis" (en/fr)#71
Derssa merged 1 commit into
mainfrom
feat/learning-cache-aside-roadmap

Conversation

@OthmaneZ05

Copy link
Copy Markdown
Collaborator

Summary of Changes

Adds the second flagship learning roadmap, "Cache-aside with Redis" (roadmaps/cache-aside-redis.json + French translation cache-aside-redis.fr.json, same id and step ids). Pure content at the frozen v1 roadmap format — zero backend/frontend changes.

The arc (8 steps, ~30 min, sequel to the Nimbus Books story): rebuild a minimal store (web + PostgreSQL, least-privilege security groups from day one) → feel a catalog page that costs ~1500 ms of database time on every request → add a Redis node → implement the cache-aside read path at the terminal (GET → miss → query → SETEX 180 s) → prove the hit with the badge, the Key Explorer and a live TTL countdown → finish on cache invalidation: insert a new book, watch customers get a stale page, validate while stale to read the failure, then DEL the key.

Uses 6 validator types: container_running, table_exists, edge_exists, http_get_contains, redis_key_exists (glob cache:* climax), and a port_denied lock-in check that keeps the cache out of the database. Key/table names (cache:*, books) are chosen not to collide with the explorer demo seeds. Validator order in the cache-aside step is deliberate: the HTTP check's own request causes the first miss that fills the cache, so the key check deterministically fails while the old (non-caching) server is still running.

Types of Changes

  • New feature / node type addition
  • Bug fix (non-breaking change resolving an issue)
  • Refactoring / structural cleanup
  • Documentation update

Verification & Testing

Automated Checks

  • Run npm run lint successfully with no errors
  • Run npm run build successfully with no compilation errors
  • Run npm test successfully (all tests pass)

Both files pass npm run roadmap:validate. Backend: 246 tests green. Frontend: 225 tests green.

Manual Verification

Played end-to-end against real Docker containers, twice, with an API driver that mirrors the canvas UI (same network-config/save semantics, prepended SG rules, real docker exec for terminal steps):

  • All 8 steps observed fail in the naive state, then pass after the instructed action.
  • Counter-tests: validating the cache-aside step with the old server still running fails deterministically on the key check; opening the database to Anywhere flips the port_denied lock-in check red until tightened back to Source=web; the stale-catalog step validated before invalidation fails with served from cache visible in the observed excerpt; stopping web then starting it revives the app via the baked .bashrc boot line; stopping cache leaves the store up (slow, served from database) thanks to the client timeouts + try/except taught in the step.
  • Completed steps stay green when re-validated later (e.g. step 4 after the cache exists).
  • UI pass (headless Chrome against the dev servers): catalog shows both roadmaps with coherent titles/durations/difficulty; step 1 fail→pass through the player buttons; reopening the roadmap resumes on the first incomplete step with ✓ markers restored; the http://localhost:<port> link on the hit-proving step serves the store from the host; the Redis Key Explorer shows cache:books next to the demo keys and TTL cache:books counts down in the Redis Shell; switching EN→FR mid-roadmap keeps the progression and reopening loads the French file; killing and restarting the backend mid-roadmap resumes on the right step; the finale (stale fail → DEL → pass) completes the roadmap in French.
  • Real-traffic spot checks inside the containers: the naive page costs ~1.5 s on every request; the cached page answers in under a millisecond; TTL returns the configured 180 s.

Checklist

  • My code follows the repository's code style and lint standards
  • I have updated the documentation or instructions if necessary
  • All unit and integration tests are passing

@OthmaneZ05
OthmaneZ05 requested a review from Derssa as a code owner July 17, 2026 06:58
@Derssa
Derssa merged commit fc1f40f into main Jul 17, 2026
2 checks passed
@Derssa
Derssa deleted the feat/learning-cache-aside-roadmap branch July 17, 2026 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants