How to manage alive connection between nodejs and web services?












0















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.










share|improve this question





























    0















    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.










    share|improve this question



























      0












      0








      0


      1






      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.










      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 29 '18 at 15:38







      ahmed nader

















      asked Nov 24 '18 at 20:03









      ahmed naderahmed nader

      477




      477
























          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
          });


          }
          });














          draft saved

          draft discarded


















          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
















          draft saved

          draft discarded




















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          404 Error Contact Form 7 ajax form submitting

          How to know if a Active Directory user can login interactively

          TypeError: fit_transform() missing 1 required positional argument: 'X'