Re:How much faster is Redis at storing a blob of JSON compar...
by krenoten on Wednesday October 02, 2019 @12:16PM
(#21138099)
Just use a hashmap. Hashmaps in some cases can be like 8 orders of magnitude faster than Redis.
Re:How much faster is Redis at storing a blob of JSON compar...
by phamilton on Wednesday October 02, 2019 @09:03PM
(#21142552)
Hashmaps are faster, except when you need the data to be available to multiple machines.
A good description of redis is a "shared heap". HashSets, HashMaps, Heaps, Priority Queues, etc. are all great and fast in an application, but once you need to start sharing that data things get complicated quickly. So you designate a single server to implement those data structures and expose them to your application. And what you end up with is basically redis.
Re:How much faster is Redis at storing a blob of JSON compar...
by l33tman on Wednesday October 02, 2019 @11:05AM
(#21137223)
In Django it's literally a matter of adding 5 lines of code to enable the redis cache. The complexity is in actually setting up the Redis server, but this can also be trivial in many cases.
Re:How much faster is Redis at storing a blob of JSON compar...
by dsr_ on Wednesday October 02, 2019 @11:24AM
(#21137446)
Sorry, no. The complexity is that you are now relying on another server which can break in new ways, requires startup and shutdown and configuration and possibly load-balancing; management of all the above... updates, security reviews, and documentation. Will you need new server types with an emphasis on RAM? How many and when? How are you monitoring it for errors and performance?
That's the difference between thinking about it as a solution to a problem and thinking about it as part of your infrastructure.
Re:How much faster is Redis at storing a blob of JSON compar...
by volkk on Wednesday October 02, 2019 @11:58AM
(#21137862)
True, but a lot of that can be solved with PaaS/DBaaS products like compose or something
Re:How much faster is Redis at storing a blob of JSON compar...
by threeseed on Wednesday October 02, 2019 @04:36PM
(#21140495)
Shame you got downvoted because it's a valid point.
These days most databases are available as a managed service and Redis in particular is a standard feature on AWS, Azure and Google Cloud.
For a small project you might not want the added complexity of another database and decide to store JSON blobs in PostgreSQL. In this case it's important to understand the performance trade-off you're making.