# How to Redis - Kesha
- Redis PubSub blog post series
- Shared library for FS/FN projects mainly, more projects possible. Also possibility to publish it in the future.
- Avoid one abstract interface, do more flexible utils functions
- *Responsible gurus:*
- pavel.svagr@ackee.cz (FS)
- jaroslav.smolik@ackee.cz (FN)
- Alternative names: Cashew, reDish, Feshka, Kshanda, myschka, Kesha+++
**Kesha**
## What to include
### FN
- [getJSON](https://gitlab.ack.ee/Backend/flash-news-shared-pei/-/blob/master/src/lib/redis/repository/redis.ts#L50) β
- [setJSON](https://gitlab.ack.ee/Backend/flash-news-shared-pei/-/blob/master/src/lib/redis/repository/redis.ts#L10) β
- [processRedisStream]( https://gitlab.ack.ee/Backend/flash-news-shared-pei/-/blob/master/src/lib/redis/repository/redis.ts#L24) π
- [unlinkPattern](https://gitlab.ack.ee/Backend/flash-news-shared-pei/-/blob/master/src/lib/redis/repository/redis.ts#L51) π
- [zsetUnlinkPattern]( https://gitlab.ack.ee/Backend/flash-news-shared-pei/-/blob/master/src/lib/redis/repository/redis.ts#L62) β
- [custom del](https://gitlab.ack.ee/Backend/flash-news-shared-pei/-/blob/master/src/lib/redis/repository/redis.ts#L22) β
donβt use, imo maybe rename?
- [custom set](https://gitlab.ack.ee/Backend/flash-news-shared-pei/-/blob/master/src/lib/redis/repository/redis.ts#L13) β
donβt use, imo maybe rename?
- [cacheize](https://gitlab.ack.ee/Backend/flash-news-shared-pei/-/blob/master/src/lib/utils/cacheize.ts#L3) π
- [Redis PubSub write-up](https://hackmd.io/t5irfgo3TCiNmrbsJFBfhA)
- Monitoring - --slowlog , --bigkeys ; --hotkeys doesnβt work (we would need LFU / LRU) β
- [createDataLoader, createCompoundDataLoader, validItems](https://gitlab.ack.ee/Backend/flash-news-papillon/-/blob/development/src/app/components/dataLoaders/genericLoaders.ts) π (compound vynechat)
- Refactored into [`createDataLoaderFactory`, `RedisDataLoaderOptions`](https://gitlab.ack.ee/Backend/flash-news-papillon/-/blob/3d98271e1d70cee62b4e93b37cd0cf625a39f695/src/app/components/dataLoaders/genericLoaders.ts#L23-69)
- `createCompoundDataLoader` is just a cachezie effectively, we don't need it
- [barrier](https://gitlab.ack.ee/Backend/flash-news-papillon/-/blob/development/src/app/components/utils.ts#L122) π
- [hashRequest](https://gitlab.ack.ee/Backend/flash-news-papillon/-/blob/development/src/app/middlewares/cacheMiddleware.ts#L149) β
### FS
- [barrier](https://gitlab.ack.ee/Backend/flash-sport-userapi/-/blob/development/src/components/barrier.ts) + ["barriered loader"](https://gitlab.ack.ee/Backend/flash-sport-userapi/-/blob/development/src/components/applicationCache.ts#L68) - smtg. like that
- [Basic template](https://gitlab.ack.ee/Backend/flash-sport-userapi/-/blob/development/src/components/cacheStorage.ts) - Move to utils like on FN
- [DataLoaders](https://gitlab.ack.ee/Backend/flash-sport-userapi/-/blob/development/src/components/dataLoaders.ts) - Some template fn?
- [Some key generators](https://gitlab.ack.ee/Backend/flash-sport-userapi/-/blob/development/src/components/applicationCache.ts#L43) β
- [CacheMiddleware](https://gitlab.ack.ee/Backend/flash-sport-userapi/-/blob/development/src/app/middlewares/cacheMiddleware.ts)
- [dataloaders typings](https://gitlab.ack.ee/Backend/flash-sport-ls-adapter/-/blob/7fc477d20ba49945953278956cb4be4dcbd084b4/src/declarations.ts#L26) π (definitely typed?)
- [health check](https://gitlab.ack.ee/Backend/flash-sport-ls-adapter/-/blob/7fc477d20ba49945953278956cb4be4dcbd084b4/src/app/controllers/healthz.ts#L7) β
- [client with retry mechanism](https://gitlab.ack.ee/Backend/flash-sport-ls-adapter/-/blob/7fc477d20ba49945953278956cb4be4dcbd084b4/src/app/services/redisConnector.ts#L18) β
- [rate limiter](https://gitlab.ack.ee/Backend/flash-sport-ls-adapter/-/blob/7fc477d20ba49945953278956cb4be4dcbd084b4/src/components/rateLimiter.ts) π