U
U
Urbansamurai2020-03-01 21:22:14
MongoDB
Urbansamurai, 2020-03-01 21:22:14

How to architecturally organize a search microservice in golang?

There was an idea to organize the search in the catalog of digital goods as a separate microservice based on Go and Redis. Go acts as an API that looks out through a reverse proxy and takes data from the mongo, or from the redis cache if it exists.

Does it make sense from an architectural point of view?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Tikhonov, 2020-03-01
@Urbansamurai

Redis as a cache is relevant for "single-core" languages ​​like node/python/php. There are big problems with multi-threaded memory access, so instead of memory they use key-value (you can still remember memcached). And if you have golang - so why radish? Use the cache in memory, it will still work an order of magnitude faster due to the lack of network interactions on cache hits.

R
Roman Mirilaczvili, 2020-03-01
@2ord

All right. The most common practice.
Only instead of Redis you can also use Memcached (faster). https://medium.com/@Alibaba_Cloud/redis-vs-memcach... It
is also possible to use in-memory k/v storage as Sergey Tikhonov advises , but in this case, when the service is restarted (errors, etc.) data in the cache will be lost and it will take time to warm up the cache.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question