How to manage alive connection between nodejs and web services?
I am creating a micro services architecture and nodejs
is the first layer that will get the user requests and then pass the request or call different backend micro services based on the type of request.
so If i am not wrong, I see that systems at backend kill the connection after serving the content because it cant keep connection alive because there are millions of people accessing the system.
But In my case nodejs
knows exactly what micro services it will use so I though it should keep a connection alive with that service all time and pass the request on top of that connection without closing it so making it faster and away of the overhead of creating and termination a connection.
my question is
1) that way of passing all requests over one connection between the nodejs
layer and the micro service layer without terminating it wrong or no ?
2) how to create that connection and keep it alive between nodejs
and a service ?
I am part of a team responsible for this part so any help or suggestion would be helpfull, thanks in advance.
node.js api http microservices keep-alive
add a comment |
I am creating a micro services architecture and nodejs
is the first layer that will get the user requests and then pass the request or call different backend micro services based on the type of request.
so If i am not wrong, I see that systems at backend kill the connection after serving the content because it cant keep connection alive because there are millions of people accessing the system.
But In my case nodejs
knows exactly what micro services it will use so I though it should keep a connection alive with that service all time and pass the request on top of that connection without closing it so making it faster and away of the overhead of creating and termination a connection.
my question is
1) that way of passing all requests over one connection between the nodejs
layer and the micro service layer without terminating it wrong or no ?
2) how to create that connection and keep it alive between nodejs
and a service ?
I am part of a team responsible for this part so any help or suggestion would be helpfull, thanks in advance.
node.js api http microservices keep-alive
add a comment |
I am creating a micro services architecture and nodejs
is the first layer that will get the user requests and then pass the request or call different backend micro services based on the type of request.
so If i am not wrong, I see that systems at backend kill the connection after serving the content because it cant keep connection alive because there are millions of people accessing the system.
But In my case nodejs
knows exactly what micro services it will use so I though it should keep a connection alive with that service all time and pass the request on top of that connection without closing it so making it faster and away of the overhead of creating and termination a connection.
my question is
1) that way of passing all requests over one connection between the nodejs
layer and the micro service layer without terminating it wrong or no ?
2) how to create that connection and keep it alive between nodejs
and a service ?
I am part of a team responsible for this part so any help or suggestion would be helpfull, thanks in advance.
node.js api http microservices keep-alive
I am creating a micro services architecture and nodejs
is the first layer that will get the user requests and then pass the request or call different backend micro services based on the type of request.
so If i am not wrong, I see that systems at backend kill the connection after serving the content because it cant keep connection alive because there are millions of people accessing the system.
But In my case nodejs
knows exactly what micro services it will use so I though it should keep a connection alive with that service all time and pass the request on top of that connection without closing it so making it faster and away of the overhead of creating and termination a connection.
my question is
1) that way of passing all requests over one connection between the nodejs
layer and the micro service layer without terminating it wrong or no ?
2) how to create that connection and keep it alive between nodejs
and a service ?
I am part of a team responsible for this part so any help or suggestion would be helpfull, thanks in advance.
node.js api http microservices keep-alive
node.js api http microservices keep-alive
edited Nov 29 '18 at 15:38
ahmed nader
asked Nov 24 '18 at 20:03
ahmed naderahmed nader
477
477
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53461915%2fhow-to-manage-alive-connection-between-nodejs-and-web-services%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53461915%2fhow-to-manage-alive-connection-between-nodejs-and-web-services%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown