55 / 65 · 15 SQL & Database Testing · NoSQL Basics← prev⊞ allnext →☰ Read as one page
7.6Practical Exercise
- Write MongoDB tests: insert a document, query it, verify structure, test schema validation
- Write Redis tests: set a key with TTL, verify it exists, wait for expiration, verify it is gone
- Write a test for Redis-backed rate limiting: increment a counter, verify it resets after the window
- Test cache invalidation: update data via API, verify the cache was cleared
- Compare testing patterns between SQL constraints and MongoDB schema validation