tinkoff / cachalot Goto Github PK
View Code? Open in Web Editor NEWCache manager for nodejs with support different cache strategies
License: Apache License 2.0
Cache manager for nodejs with support different cache strategies
License: Apache License 2.0
Right now readThrough is called like this:
readThrough(
cacheKey,
async () => executor(...params),
{ tags },
);
Meaning that we need to know tags before executor call. But there are cases when tags depend on executor result
I suggest to add ability to pass getTags function to options which will be called after executor success and would have executorResult as its argument. getTags would return array of tags which will be added to other tags
here is an example
readThrough(
cacheKey,
async () => executor(...params),
{ tags, getTags: (executorResult) => [<additional tags>] },
);
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates are currently rate-limited. Click on a checkbox below to force their creation now.
ioredis
, @types/ioredis
)@types/jest
, jest
)@typescript-eslint/eslint-plugin
, @typescript-eslint/parser
)@types/jest
, jest
, ts-jest
)@typescript-eslint/eslint-plugin
, @typescript-eslint/parser
)These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
@semantic-release/changelog
, semantic-release
)uuid
, @types/uuid
).github/workflows/build.yml
actions/checkout v3
actions/setup-node v3
actions/checkout v3
actions/setup-node v3
redis 5
.github/workflows/codeql-analysis.yml
actions/checkout v2
github/codeql-action v1
github/codeql-action v1
github/codeql-action v1
package.json
@semantic-release/changelog ^6.0.1
@semantic-release/git ^10.0.1
@types/ioredis ^4.27.5
@types/jest ^27.0.2
@types/memcached ^2.2.7
@types/node ^10.17.60
@types/uuid ^8.3.1
@typescript-eslint/eslint-plugin ^4.32.0
@typescript-eslint/parser ^4.32.0
eslint ^7.32.0
eslint-config-prettier ^8.3.0
ioredis ^4.27.9
jest ^27.2.4
memcached ^2.2.2
prettier ^2.4.1
semantic-release ^19.0.2
ts-jest ^27.0.5
typescript ^4.4.3
uuid ^8.3.2
node >=10.0.0
I think today's systems need more like classic caches and your approach goes a lot further. I don't need a cache, I need a distributed memory manager. The problem at the moment is that the cache is always seen as an intermediate layer to data sources (DB, API) and a "cost / benefit" decision must always be made.
I think it should be easier! The cache should basically be the basis for storing data - and then, depending on the configuration, reduce latency and computing power in a distributed environment.
1. Multi-tier
The cache should basically be multi-tier, whereby I would not overdo it (creating X adapters etc.)
However, it must be possible to use an in-memory cache.
Local memory is just FAST and today's servers really have enough of it.
If the cache should be the basis, then you should also be able to use it for development or for small projects, where maybe there is no Redis (yet).
In-memory cache with size limit and hit tracking for optimal garbadge collect
2. Invalidation - instead of TTL
3. Versioning - short round trip instead of TTL
4. Pre-warm in memory cache
In combination with a message brokers (or even Redis pubsub) it is also possible to cache data in-memory, before it gets accessed
This logic is application side, but would a good interface would help.
Refresh ahead is nice, but I want control over my data and not just statistical optimizations**
Right now we have many backends with some kind of "session stickyness", just to have some little information already there to improve latency. That sucks and with the possibilities described it would be easy to solve.
Maybe you have similar ideas? I would appreciate feedback and if you have a roadmap in which direction the project should go, I would be very interested!
Thanks a lot!
Nic
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.