NoLang Microservices
Microservices is an architectural design for building a distributed application using containers. They get their name because each function of the application operates as an independent service. This architecture allows for each service to scale or update without disrupting other services in the application. A microservices framework creates a massively scalable and distributed system, which avoids the bottlenecks of a central database and improves business capabilities, such as enabling continuous delivery/deployment applications and modernizing the technology stack.
NoLang's microservice architecture allows multiple apps to interact with each other and send scripts to each other to receive replies. For example, App1 must have a microservice definition in its configuration to connect to App2's endpoint.
In the App1's
{
"name": "App1",
"microservices": [
{
"name": "MSforApp2",
"type": "http",
"url": "http://100.200.10.1:1000"
},
{
"name": "MSforApp3",
"type": "socket",
"host": "100.200.10.2",
"port": 2000
}
]
}
How to use microservices?
Suppose App2 has an entity and App1 needs its data. If we have defined a microservice like the above configuration, We can run the following script in App1 and get data from that entity in App2 very easily.
Clearly, there is a new keyword
Clearly, there is a new keyword
microservice
under $$header
, which indicates the name of microservice that this script runs in.{
"$$schema": "schemaInApp2",
"$$header": {
"microservice": "MSforApp2",
"action": "R"
}
}