L
L
LamerFromSpace2021-10-12 23:19:59
NoSQL
LamerFromSpace, 2021-10-12 23:19:59

How to store complex structures for graceful reboot?

There is a certain map of operations (goroutines that perform some work on a timer). Tired of the fact that when you reboot the service, you have to re-add them to the list and run them.
I want to duplicate these operations in some NoSQL database and, at the start of the service, go into the database to load the previous active ones.

The problem is that the operations themselves contain complex structures:
1. http.Client
2. rate.Limitercommon to all operations, all operations contain a pointer to one such object
3. Connections to wallets
4. etc

Well, actually, the question is - how best to save these operations in the database, load them back into RAM and run their goroutines? So far, only a wrapper over NoSQL is in my head, which will contain these complex structures and, when loading operations, assign them to each rate.Limiter, etc.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Cheremisin, 2021-10-13
@leahch

From distributed, and not so, zokeeper or consul.io. Both can work in standalone mode, but you will get, in which case, the opportunity to spread it into a cluster. I am for the consul, stupidly more convenient. Both are very lightweight and support atomic operations, which is good when you're modifying the same key from different places.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question