15 ms·
Can you run Redis in browser? You can’t. Is an in-process, in-memory database faster than making a query over network? Yes it is.
by hem777 3y ago
Can you run Redis in browser? You can’t.
Is an in-process, in-memory database faster than making a query over network? Yes it is.
- nbittich 3y agono need an extra layer of abstraction to get an "in memory" database in javascript. no need, babel, webpack, ChatGpt, npm and 10000 libraries for this really. Let me show (works even on the browser): const KV = {}; KV["credentials"] = {access_key: "XXXX", secret: "YYYY"}; console.log(KV["credentials"].secret);
- hem777 3y agoMaybe? Depends on the rest of the software you’d be developing and what features and abstractions you’d need. The point was that “just use redis” is a poor and incorrect advice.
- hombre_fatal 3y agoNow show me the rest of the functionality of the OP library like TTL.
- nbittich 3y agoSomeone already replied to this in another comment.
- thegeomaster 3y agoRun Redis on the same machine. No network latency. You only have a few memcpys and context switches versus an in-process solution, and if those make a difference you shouldn't be using JS anyways
- gregors 3y agoI'm not saying anyone should actually use this btw https://narma.github.io/2015/redis-in-browser/ https://narma.github.io/2015/redis-in-browser/ https://medium.com/fluence-network/porting-redis-to-webassembly-with-clang-wasi-af99b264ca8 https://medium.com/fluence-network/porting-redis-to-webassem...