🔴 Redis
Beginner
What does FLUSHDB do in Redis?
Answer
FLUSHDB deletes all keys in the currently selected database. FLUSHALL deletes all keys across all databases on the Redis server. Both commands are synchronous by default (blocking until complete) and accept an ASYNC modifier (FLUSHDB ASYNC) to perform deletion in a background thread so the server remains responsive during the operation — important on large datasets. These are destructive operations with no confirmation prompt, so they must be used with extreme caution in production environments. Many teams restrict access to these commands via ACLs. Common legitimate uses: resetting a test/staging environment, clearing a cache namespace during a deployment, or recovering from corrupted state.