Golang is quite fast compared to other languages.
It became interesting, that it will be faster, to store a large amount of data in variables / maps on go or to contact the Redis server, as it is very fast, and it provides a bunch of ready-made functions that you would still need to write to go to sample.
Has anyone come across this?

  • 2
    I did not do such tests, but obviously working with radish over the network will be slower than with memory in Go. Here's another question: do you need a "local" cache, with which only one application works? If there is not and is supposed to work several copies of the application with one cache, then we should look towards the radish / memokes. - martsen

1 answer 1

Go is definitely faster, but each instance will have its own cache, there is no sharding, after the reboot or instance crash, the cached data disappears, there are also problems with the garbage collector in versions 1.4x with large maps ( Large map cause significant GC pauses ) ( version 1.5 is ok, 1.6 is even more ok, the collector works faster there, but in order to get rid of the cache collector check in general, you need to use something like BigCache ).

Redis is slower, but it is not so significant. Compared with queries to the main database, there is a sharding ability. After the instance crashes, the cache will recover from the disk, many features on top, also this widely known KVS, independent of PL, it will be easier to get help.

If you plan to grow and develop the product, it is worth confusing with Redis .