hydra-router | service aware router for Hydra Services | Microservice library
kandi X-RAY | hydra-router Summary
kandi X-RAY | hydra-router Summary
Hydra Router hosts a dashboard showing running microservices.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of hydra-router
hydra-router Key Features
hydra-router Examples and Code Snippets
Community Discussions
Trending Discussions on hydra-router
QUESTION
I started a project and I started to have a lot of web traffic, and at some point I felt insecure of how to scale the project to production in two issues:
- How to perform updates without leaving my users without service?
- How to correctly configure Node.js so that it consumes less memory?
I have microservices working with Hydra-express, and I have not been able to implement Hydra-router and I do it with Express.js; I also have NGINX as a proxy gateway.
I am programming in ES6, transpiling with BABEL and maintaining active microservices with PM2, some with fork and the most important in cluster mode.
I was thinking about using docker, but I have not found any tutorial on how to use it with CDN, upload files and serve them to the user.
...ANSWER
Answered 2018-Mar-14 at 02:12It's impossible to give a definite answer to 2 since that is completely up to what the application does, there's no silver bullet configuration that you can apply.
This leaves the first point, which is around something called zero downtime.
So, in the context of having multiple servers returning content to users, e.g. http servers I guess it's fair to say that most production environments have something at the front that's not related to the business logic. This could be a load balancer (comes in many shapes and forms) or a reverse proxy. This is usually the spot where you point your DNS A record. This server should basically never be down.
Now, lets assume you have changed some business logic and want to deploy a new backend. What you normally do is to swap out the already running processes behind the load balancer (or reverse proxy), one by one. So if you have five node processes, you stop one, start up a new with the updated code, and repeat until all running have been swapped out.
You can also utilize this to swap out just one, run tests on that one, then proceed to swap out the rest.
To really make sure you don't disrupt any users, you should stop accepting new http requests on the old processes, so new http requests are routed to the updated processes. This will allow for http requests that are taking place to finish up. Then you stop the old processes.
Hopes this helps.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install hydra-router
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page