Freely communicating microservices

Microservices in nyssr.net are mostly non-passive and not focused on responding to simple requests. They are mainly parts of the server, i.e. active components, which in turn have a status and make their own requests.

Factories

To create stateful microservices, we need a factory. The factory itself is a microservice. When a request is made, an instance of the service is created, usually in the form of a target. The target is given the owner's target address when it is created. The owner is given the target address of the service in the same way. Now the owner and microservice can communicate with each other.

If the microservice is no longer needed, it is terminated by the owner with a message. If the microservice's communication with the owner is interrupted, there are several options, to terminate the instance automatically.

Working Targets

Often microservices need to send messages themselves to accomplish their tasks. Since they are targets themselves, this is not a problem.

Often, requests from the owner cannot be answered immediately, because even asynchronous communication must be taken care of beforehand. There are various tactics here. One is to defer the automatic response and pass it to a new target to complete a request.

Targets are lightweight, any number of targets can be created to handle complex communications. Example: The job engine easily creates tens of thousands of targets to perform specific activities, such as hashing files in subdirectories.

When its own queries are done, the working target sends the deferred message back as a response and exits. This pattern ( outsourcing communication to another target) is simple to understand and easy to implement.

Performance

Messages in nyssr.net are very fast. It is no problem for microservices to become active themselves, in other words, to send messages. Often, it is simply necessary.

Thus, many actions will require a session token to verify that a user has the rights to perform the intended action. A request is then made to the session manager to verify the token and rights. The session manager is a separate microservice, which in turn consults the user database.

Another example are dialogs in RemoteSkin applications. Dialogs are often implemented as microservices. They communicate independently and directly with the renderer on the client side. Similarly, they obtain data from a supplier service, which obtains the data from a database. This service is also a microservice that physically resides on a node near the database. Separating UI code from data preparation is highly recommended by us. Despite communication across multiple nodes, the UI system's response to user input is immediate and without delay.

nyssr.net - Innovative Distributed System