A hard dependency on redis servers being available, with no way to implement a fallback if they're not.
The refresh token requests are dependent on our redis servers being available to store tokens (#3237) . If the redis server is down, refresh token requests will not complete. PR: https://scm.starbucks.com/starbucks-web/core/pull/3469
Inform consumers of the redis being in a faulted state (cannot connect, redis crashed, redis out of memory, servers not available, etc.), so they can implement a fallback strategy. e.g. If redis is down, go directly to the api for data that was expected to be in cache.
pane 1:
start-redis
pane 2:
redis-cli
pane 3:
NODE_CONFIG_DIR=../config/ node --inspect ./cache-client-test.js | grep "CONSUMER"
NODE_CONFIG_DIR=../config/ node --inspect ./cache-client-test.js | ../node_modules/.bin/bunyan
Show before, and after.
const cacheClient = require('./shared/server/lib/cache-client');
const getMyData = () => {
return cacheClient.get('mykey')
.then(reply => {
// Cached data from a healthy redis-server
return reply;
})
.catch(err => {
if (cacheClient.isCacheError(err)) {
// redis server is in a faulted state, fallback to an api call
return fetch('api/my-data');
}
// Error isn't redis-server related, so do something else or rethrow.
throw error;
});
}