V
V
Vitaly Stolyarov2017-11-27 16:55:53
Books
Vitaly Stolyarov, 2017-11-27 16:55:53

What to read about creating microservices, in particular on Node.js?

It seems to have defined the areas of responsibility of services, it's time to implement it. I chose Node.js as the environment, because I'm already used to JS, and the platform itself is convenient.
The question is, is it correct in my understanding (based on the material already studied, but not specifically to Nodejs) the following: at first everything can be hosted on one host, and preferably in different Docker containers. Communicate between them via REST, although everything will be on the same host, but under different ports, so that in the future it can be transferred to other machines. Since REST requests are more expensive than regular calls within the runtime, what about authentication? How to minimize the load, given the possible large number of requests to check if the user / bot / service can access some service?
A monolith will definitely not work, since there are several tasks that simply Node.js is not enough for, and you have to use C ++ modules. For example, one service must store and process 3D models, and for this, in addition to Node.js and the database, CGAL, Draco, etc. are needed (and this is all assembled in C ++), and thus several other services, and if this to collect everything in one environment, then I'm afraid
problems may arise due to some kind of version conflicts, or it will simply be difficult to find out where the cause of the problem is.
As for libraries for creating microservices, I found the so-called Hydra. He is not very popular, judging by the stars, although there are many articles about him. I tried it, and have not yet understood what it does so special (except for writing data to Redis), despite the fact that hello world uses the same express, only a bunch of "unnecessary" code on top.
Seneca still exists, but it is not designed for REST, although there are third-party implementations (and judging by the long-open issues, they have been abandoned). And some examples of its use are not intuitively clear.
Probably, a more reliable option would be your own implementation of working with services?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
lxfr, 2017-12-04
@lxfr

Docker can run anything in interaction with anything - python with puff, C++ with ruby, mysql with anything.
You make the main project in your own language, and connect all additional services through docker in the same ecosystem, what's the problem?

A
Alexander Litvinenko, 2017-12-12
@edli007

For communication between microservices within the same server, radish channels are used, it's almost like web sockets, only without access to the network.
To reduce the load, you can bring most of the logic to the front and use web sockets instead of adjax.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question