{"id":1066,"date":"2022-07-19T12:41:30","date_gmt":"2022-07-19T12:41:30","guid":{"rendered":"https:\/\/www.workfall.com\/learning\/blog\/?p=1066"},"modified":"2025-09-30T05:43:49","modified_gmt":"2025-09-30T05:43:49","slug":"how-to-architect-nestjs-microservices-with-aws-elastic-beanstalk","status":"publish","type":"post","link":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-architect-nestjs-microservices-with-aws-elastic-beanstalk\/","title":{"rendered":"Architect NestJS Microservices with AWS Elastic Beanstalk"},"content":{"rendered":"<span class=\"rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\">8<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span>\n<p><img src=\"https:\/\/lh3.googleusercontent.com\/0BHug5Oei6r4ytzqjI7ZXjbaS-nfoaI9fz45b_yZvd-LVMa8y5iL7RehXtGGEjj4LM9dVD12mCuFuSWwRu47-yTnAuXAMuWjktE0FK2nUlu3TBmOwpmqkMS--7LTLm_07r7P0BJT6aBG\" style=\"width: 1600px;\"><\/p>\n\n\n\n<p class=\"has-text-align-justify\">In the AWS Cloud journey, we come across Elastic Beanstalk to be better than other services in managing the infrastructure environments effectively. On the other hand, NestJS is popular in creating efficient and scalable server-side applications, and is relatively a new option for the backend framework &#8211; it is lightweight, simple, and open-source.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">In this blog, we shall create a NestJS application, containerize it and make microservices communicate with each other. In Part 2 of this blog, we shall deploy the microservices on AWS Elastic Beanstalk.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">In this blog, we will cover:<\/p>\n\n\n\n<ul><li>Why Microservices?<\/li><li>Why NestJS Architecture?<\/li><li>NestJS Providers<\/li><li>What is Dependency Injection?<\/li><li>What is Containerization?<\/li><li>API gateway with Proven Performance<\/li><li>Hands-on<\/li><li>Conclusion<br><\/li><\/ul>\n\n\n\n<p class=\"has-text-align-justify\">Defining an exemplary architecture for your application is one of the most important things to consider before starting the development journey. Your application&#8217;s architecture can affect many factors such as reliability, fault tolerance, scalability, and portability.<\/p>\n\n\n\n<ul><li><strong>Reliability:<\/strong> refers to the degree to which your application can work without crashing or producing runtime errors hence not hindering the efficiency of the intended use.<\/li><\/ul>\n\n\n\n<ul><li><strong>Fault tolerance:<\/strong> refers to the ability of your application to degrade gracefully in case of a runtime error while providing satisfactory feedback to the end user.<\/li><\/ul>\n\n\n\n<ul><li><strong>Scalability:<\/strong> is a broad concept and often at times, it refers to the ability of the application to accommodate more features, users, or traffic without compromising the optimal working of the application as a whole.<\/li><\/ul>\n\n\n\n<ul><li><strong>Portability:<\/strong> refers to how well the application can be used on different platforms without requiring a lot of extra configurations that are platform-specific which may depend on factors such as Operating System and hardware specifications like GPU and CPU architecture.<\/li><\/ul>\n\n\n\n<h2>Why Microservices?<\/h2>\n\n\n\n<p class=\"has-text-align-justify\">The microservice architecture defines an application as loosely coupled and independently deployable services that work together to perform a common intended task. The most important thing to note is that these services need to communicate; therefore, a good integration technique needs to be used.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">It is also important to note that it may be complicated to maintain your code base if you do not define a good architecture at the application level. You may end up with a repository for each service, which may be chaotic in the long run.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">In this setup, we will look at how to maintain one codebase for all your microservices. This is much cleaner and it will reduce redundancy in that code reuse will be much easier instead of copying code from one repository to another.<\/p>\n\n\n\n<h2>Why NestJS Architecture?<\/h2>\n\n\n\n<p class=\"has-text-align-justify\">There are many libraries, helpers, and tools for Node (&amp; server-side JavaScript), however, none of them really solve the issue of architecture.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">NestJS is essentially a layer on top of Node that features methods and implementations that are supercharged to make it simple and swift to create server-side apps. Nest makes it easy to meet all of your demands. It is quite programmable and runs on Express by default but can be configured to use Fastify as well.<\/p>\n\n\n\n<ul><li>Nest offers an abstraction layer on top of Node, allowing it to use its capabilities as well as expose APIs with increased power for improved productivity.<\/li><li>Developers embrace features. Nest offers access to numerous 3rd party applications that helps expedite the development process.<\/li><li>A lot of Nest architecture is inspired by the angular framework. This allows easy testing and efficient maintenance of the codebase.<\/li><\/ul>\n\n\n\n<h2>Components of NestJS<\/h2>\n\n\n\n<p>NestJS has 3 main components &#8211; controllers, providers, and modules.&nbsp;<\/p>\n\n\n\n<ul><li><strong>Controllers<\/strong>: Every time an HTTP request is received, it is redirected toward the appropriate controller using a routing mechanism. The controller then accepts and manages the request to revert an appropriate response.<\/li><\/ul>\n\n\n\n<ul><li><strong>Providers:<\/strong> Providers are a key concept in Nest. Many of the basic Nest classes &#8211; services, repositories, factories, helpers, and so on &#8211; can be treated as providers. The primary concept of a provider is that it may be injected as a dependency. As a result, objects can develop different associations with one another, and the Nest runtime system can be heavily used to &#8220;wire together&#8221; instances of objects.<\/li><\/ul>\n\n\n\n<ul><li><strong>Modules:<\/strong> A module is designed to include a group of closely linked functions. Each application has a root module, which Nest uses as the first point to determine the relationships and structure in the application. It is strongly advised to use numerous modules to organize the components of your application.<\/li><\/ul>\n\n\n\n<h2>What is Dependency Injection?<\/h2>\n\n\n\n<p class=\"has-text-align-justify\">Dependency injection (DI) is the procedure of providing a resource that a specific section of code demands in the context of object-oriented programming (OOP) software design. Dependency refers to this required resource, which is frequently an element of the application itself.<\/p>\n\n\n\n<h2>What is Containerization?<\/h2>\n\n\n\n<p class=\"has-text-align-justify\">Containerization is the process of packaging software code with all of its required components, such as libraries, frameworks, and other dependencies, so that they can be isolated in their own &#8220;container.&#8221;<\/p>\n\n\n\n<p class=\"has-text-align-justify\">Containers are an alternative to coding on a single platform or operating system, which makes moving their application difficult because the code might not be compatible with the new environment. This could result in bugs, errors, and glitches that needed to be fixed (meaning more time, less productivity, and a lot of frustration).<\/p>\n\n\n\n<p class=\"has-text-align-justify\">To know more about Containerization, refer to our blog: <a href=\"https:\/\/www.workfall.com\/learning\/blog\/how-to-install-and-run-docker-container-on-amazon-ec2-instance-part-1\/\">https:\/\/www.workfall.com\/learning\/blog\/how-to-install-and-run-docker-container-on-amazon-ec2-instance-part-1\/<\/a><\/p>\n\n\n\n<h2>API Gateway with Proven Performance<\/h2>\n\n\n\n<p class=\"has-text-align-justify\">API gateways encrypt and mediate traffic between your backend services and API consumers.&nbsp;<\/p>\n\n\n\n<p class=\"has-text-align-justify\">The NGINX Plus API gateway authenticates API calls, routes requests to appropriate backends applies rate limits to prevent service overload and DDoS attacks, offloads SSL\/TLS traffic to improve performance, and handles errors and exceptions.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">Simply put, the NGINX Plus API gateway accepts all API requests from clients, determines which services are required, and delivers the result in a high-performance manner. NGINX provides lightning-fast APIs in under 30 milliseconds and can handle thousands of requests per second.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">The NGINX Plus API gateway can be configured to protect APIs with rate-limiting policies, enforce specific request methods, and provide fine-grained access control.<\/p>\n\n\n\n<h2>Hands-On<\/h2>\n\n\n\n<p>Source code of this hands-on for your reference: <a href=\"https:\/\/github.com\/workfall\/nest-microservices\">https:\/\/github.com\/workfall\/nest-microservices<\/a><\/p>\n\n\n\n<p class=\"has-text-align-justify\">In this example, we will create two microservices. They can be as many as you wish depending on the extent you want your services to be granular. We shall have <em><code>acl-service<\/code> <\/em>which will handle access control and <em><code>test-service<\/code> <\/em>which will depend on the <em><code>acl-service <\/code><\/em>for access control to ensure that the users are authenticated.<\/p>\n\n\n\n<p><strong>Folder structure:<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-justify\">Create a new application using Nest CLI. Inside the <em><code>src <\/code><\/em>directory, create a directory called microservices and in it generate your Nest modules using the Nest CLI. Also, do the same for the controllers and services in each module.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/6LI3QJk95hG7QmFnXqHdhsJjKqLcnLB7BMcapWl0jkloy4QeQJuut3Y0L0QKhe9r_sH05E5z1iSPIkQwtXUBEfDWTZtZNC83U4N4bIAXhzT7hJt9zBMHiV88k_b0vB0OaIx2umt60OGlzlJaRIu95g\" alt=\"Architect NestJS Microservices with AWS Elastic Beanstalk\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">You will notice that we have done away with the root module (<em><code>app.module.ts<\/code><\/em>) and its subsequent files. Do the same so that you have only the <em><code>main.ts <\/code><\/em>file at the root level of the <code><em>src <\/em><\/code>directory. After this change, we shall have to modify how the application is bootstrapped in main.ts since we do not have the root module anymore. You will also note that we have a <code><em>index.ts<\/em><\/code> file in each module so that we have uniformity in module resolution in <em><code>main.ts<\/code><\/em>. Let us demystify this by looking at the <em><code>main.ts<\/code><\/em> file.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/jDexaVFM4oQPLZge5BxHeY7_T82tuRxS4gCsu-gXoSIaggA9kQ_vOq6ep0pKf1h7hQlE_I-XwRj7N8FqyrcrcEbc2GRw8lMLqbm_66wZRaxzmhEq2cx6BJqAKjolhq0r93WcrJ8OfzTDa77CCdupXg\" alt=\"Architect NestJS Microservices with AWS Elastic Beanstalk\"\/><figcaption>main.ts file<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh5.googleusercontent.com\/HdSTG2TUlYupaY9SuSQueB5B-EdBvyR8rc39iGRLdF0YFWTMOpp53q5KSJRHcNTQ8p6KxJ1Azehz-qUBNWmnGtp1yVUZ072Hor4EzjVklN0WeTUoMSM0qeiwufPVsj_9L6WK1I2glvZuRIsQVDxn0Q\" alt=\"Architect NestJS Microservices with AWS Elastic Beanstalk\"\/><figcaption>index.ts<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>We can try running the app on dev runtime using <code>yarn start:dev<\/code> command:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/T2Ik7B8mag4NLmxX0TOqIdfgcWOu1YBS1mzpTM-PBPILiAm9D8INVh9YRQcbING12ZQCa9T__YrnIroSxdL0qLYu2rX8unnK4vwleIY2QXg4XM3X4NweleUtG1VWBnjn1hqv5c4TbDec9OrsQ4wgfg\" alt=\"Architect NestJS Microservices with AWS Elastic Beanstalk\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">The error in the terminal clearly indicates that the required environment variables have not been provided for the Node.js runtime. You are required to export these variables in the same shell you will run the start script.&nbsp;<\/p>\n\n\n\n<p class=\"has-text-align-justify\">The easiest and hassle free way to do this is to have a <em><code>.env <\/code><\/em>file that has the environment variables required by the application or microservices in this case. We will then have the variables exported to the shell before running the start scripts, we will have to modify the start scripts.<\/p>\n\n\n\n<p class=\"has-text-align-justify\"><strong><em>N\/B:<\/em><\/strong><em> All this will change when we are deploying to AWS but we will try and make our application as portable as possible. We will also containerize the application using docker-compose on local development for easy integration and management of ports and environment variables.<\/em><\/p>\n\n\n\n<p class=\"has-text-align-justify\">We shall go ahead and test if the services can run independently by going into the <code><em>.env <\/em><\/code>file and changing the values.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh4.googleusercontent.com\/Y62dCGpSde2urasXXUjUL87r3dNiecn6S72dfhiptOtzD2ob75fIb4oYHYFCtbLXvFkkj3VkLDdPSgmBtCFgsJmfI4R-Sb558CLrqiFpfeDBOVz1ikT4p14q_HzWU-w8FZwdgXxMvPr-hxYM-G4vaA\" alt=\"Architect NestJS Microservices with AWS Elastic Beanstalk\"\/><figcaption>.env<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh4.googleusercontent.com\/ak_CmrudAyk6fsbZKhU4P4hBzOw8E1GTSdM5srcxwaiZ_iSjx9Egq0DX3p68ejKl3Pb4veUQptwNTdHbv5AG7eRdtf7Y06sQwcQ8axWKBqrGwDWl8iNbX3-_WNNT2wPLrXM9ETAgOsTRyNrNEWLdOg\" alt=\"\"\/><figcaption>(scripts) package.json<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-text-align-justify\">Modify <code><em>start:dev<\/em><\/code> and <code><em>start:prod<\/em><\/code> as shown in the previous image by exporting the environment variables to the Node.js runtime.<\/p>\n\n\n\n<p>Run yarn <code>start:dev<\/code> command in the terminal<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh5.googleusercontent.com\/zooTUDPaL85ISWFJzMGVdV5bIXcOSTkgMRzhCHBVX5p2_lAZi48NNCMRlGh56UP86_seAroIy_bvZRMeyF77hInkedCr97oW1syYFBLmNE5CgcU7j4IFbF6pSTe3t0czRPnj_8dezQluihylzLGTMA\" alt=\"Architect NestJS Microservices with AWS Elastic Beanstalk\"\/><figcaption>acl-service<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-text-align-justify\">We shall have to first alter the <code><em>.env <\/em><\/code>file by replacing the MICROSERVICE_NAME with test-service. Use Ctrl + C in the terminal, then run yarn <code>start:dev<\/code> command again.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/j4D4aA_OwaqEsdpQ2eyvoHgBwbyt-cAIBvjE-YErmOB_d8Hg7zlVSOWL-jAOgemy_TBp7DaS7mQAIB1Dpd87H50DL3owQXcljNCQrx9OfVyV7p2Q6bnZKZ0uh-CEVTVaYp7QbMZi5b0T4dNxMvw55w\" alt=\"\"\/><figcaption>test-service<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-text-align-justify\">So that shows both the services are working. To test the prod runtime, run yarn build command followed by <code>yarn start:prod<\/code>. You can commit your changes at this point.<\/p>\n\n\n\n<h3>Containerizing the application using docker-compose<\/h3>\n\n\n\n<p class=\"has-text-align-justify\">The main requirement to containerize an application is a Dockerfile. A Dockerfile contains all the resources\/artifacts and commands required to create a docker image. A docker container is a runtime instance of a docker image. We shall also use Docker compose because our application will run multiple containers.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh4.googleusercontent.com\/D89sez3zl8drdpAmtPmkIiInEMgbItj84Bd2f-O0Q0dhGI0Kj4P83_rGshXOvBgjn-G896z5KJGgsyYuKTXDmtvTI9D9LOIuMzEfI12MgcJ1qnO9k-N8NK_oqatgly0vb59r4qKjdQGb7JDhq_bd1A\" alt=\"Architect NestJS Microservices with AWS Elastic Beanstalk\"\/><figcaption>Dockerfile-Local<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh5.googleusercontent.com\/ywZObqqdd1m9LxydUUryBKdPOODB9xMgud8eidisJGVUYYJX9jUot7qL2GGVtASPE3tDrI-Kp58DU3YFBCYf8CeKUpN7P367kJIVLhrUs2Ybn29H3T84SQGTz9ISrOB17V7SOOGqr8U-gCrlXBmrBg\" alt=\"\"\/><figcaption>docker-compose.yml<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Run the command <code>docker-compose <\/code>up in your terminal:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/WdevrFZ9w45paWfYUuOheJA4XZxemvH7c8qG9RvVJUoMWlgtV8W-xoPHflxyG-1Oc0Ms3D7LPGcqQlhGIJ8cElZiTeO3OQV4hA-fuQ5KtBRIvlig2CWVycfq7vzxuxhJbhWP6U0qOtgCwcajlFmFRg\" alt=\"\"\/><\/figure>\n\n\n\n<h3>Integration<\/h3>\n\n\n\n<p class=\"has-text-align-justify\">For the microservices to function as needed, we need to have the microservices communicating with each other and this is where integration comes in.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">There are several integration techniques ranging from RESTful endpoints, gRPC, and Message brokers such as Kafka. In this case, we will go with a simple RESTful endpoint approach.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">For this, we will use an API gateway and our choice will be NGINX. It will sit behind our services and allocate the ports for our services. So this is the updated<code> <\/code><em><code>docker-compose.yml<\/code> <\/em>file.<\/p>\n\n\n\n<p><img src=\"https:\/\/lh3.googleusercontent.com\/bvCoiiEU0b85y_ViERN887JsHGhBv9brCewnak1EMT3gUldiR23UQJ47-brcZdcg7a1SALGK7gVBjlAkSEwKDvUi5XD3xHdJgt9X9KdRzmmg_AG2E1F_lCs87hNLY-yXoPbuy71BqjU\" style=\"width: 1600px;\"><\/p>\n\n\n\n<p>We also have to add a default <em><code>nginx.conf <\/code><\/em>for the NGINX service to use. Which will also appear as follows:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/BejRiLd24wGHJHXGswoUGJlrV0vEraRk1HXz_DLQRieFkSkV0Rd-35MdeaQz3kFIsZBCROSTbZJIWyFl4CDZSNCqavJi3zOvZibnlWGMYdMwMNFF6an72xlsvQWuJ3P1pzj-CDmwgO4vRS25SWi0QQ\" alt=\"Architect NestJS Microservices with AWS Elastic Beanstalk\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/qEpG0iVv48rhNaMjFhJfrs7v5PNPFWoJyO50rfQWNYG8YFBM3njhqWrIYB4wmqHzymjm-JCwXx91QkLXi19XbcvtXnBOYcKoMm3g3aMsXgSgkSU42sHGaLA5KPBMawpqrn5kJdtHuyNW-GDHJcDpfg\" alt=\"\"\/><figcaption>acl-service controller<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh5.googleusercontent.com\/eLZylQZnZ_HXA-egJLOic8H_hqWv1NwXryzx4G61V24VEpxMZYUlpDqO3oLxsZfutcYvu7AR6NIfHK7t8c_GXi41OECJfZskqznT0FhktVMnNmVoXy5WRmiOm0bQPxaFi7CK9RRxk5RR82zMt0FwWg\" alt=\"\"\/><figcaption>acl-service service<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/wzEg5ZxAU6x9g5OzCr1fS96D6gcluVeXnCBGo5kMUn-CoidBRFzp-iM2PdpebYZryK_oYdpgPw41hTlxn52VMkEDTh886lLvMzg8mhc0BIGdR25CAl8BUMKbcq2WZrxnrteDZFjMwKMb0DudnG2SSA\" alt=\"Architect NestJS Microservices with AWS Elastic Beanstalk\"\/><figcaption>test-service controller<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>You will note that the services are communicating, happy hacking.<\/p>\n\n\n\n<h2>Conclusion<\/h2>\n\n\n\n<p class=\"has-text-align-justify\">In this blog, we first began with the creation of a Nest CLI application. Thereafter, we created <em><code>main.ts <\/code><\/em>the source directory, followed by placing an index.ts file in each module, so that we have uniformity in module resolution.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">We then created a .env file and tested if the services can run independently or not by changing values in it.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">We then exported the variables onto the Node.js runtime. We then successfully started the Nest application and checked if the services are working. Post this, we containerized the application using Dockerfile and docker-compose.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">Lastly, we used the RESTful endpoints integration technique via NGINX for the microservices to communicate with each other.&nbsp;<\/p>\n\n\n\n<p class=\"has-text-align-justify\">In Part 2 of this blog, we shall deploy the microservices on AWS Elastic Beanstalk. We will come up with more such use cases in our upcoming blogs.&nbsp;<\/p>\n\n\n\n<p><strong>Meanwhile \u2026<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-justify\">If you are an aspiring Node.js developer and want to explore more about the above topics, here are a few of our blogs for your reference:<\/p>\n\n\n\n<ul><li><a href=\"https:\/\/www.workfall.com\/learning\/blog\/how-to-send-customized-emails-by-integrating-sendgrid-with-a-node-js-application\/\">https:\/\/www.workfall.com\/learning\/blog\/how-to-send-customized-emails-by-integrating-sendgrid-with-a-node-js-application\/<\/a><\/li><li><a href=\"https:\/\/www.workfall.com\/learning\/blog\/how-to-send-webhooks-using-python-and-receive-via-node-js-applications\/\">https:\/\/www.workfall.com\/learning\/blog\/how-to-send-webhooks-using-python-and-receive-via-node-js-applications\/<\/a><\/li><li><a href=\"https:\/\/www.workfall.com\/learning\/blog\/how-to-connect-to-mysql-database-and-run-crud-operations-in-node-js\/\">https:\/\/www.workfall.com\/learning\/blog\/how-to-connect-to-mysql-database-and-run-crud-operations-in-node-js\/<\/a><\/li><\/ul>\n\n\n\n<p class=\"has-text-align-justify\">Stay tuned to get all the updates about our upcoming blogs on the cloud and the latest technologies.<\/p>\n\n\n\n<p><strong>Keep Exploring -&gt; Keep Learning -&gt; Keep Mastering&nbsp;<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-justify\">At <a href=\"https:\/\/www.workfall.com\/\">Workfall<\/a>, we strive to provide the best tech and pay opportunities to kickass coders around the world. If you\u2019re looking to work with global clients, build cutting-edge products and make big bucks doing so, give it a shot at <a href=\"https:\/\/www.workfall.com\/partner\/\">workfall.com\/partner<\/a> today!<\/p>\n\n\n\n<p><\/p>\n\n\n<style type=\"text\/css\"><\/style><section id='' \n                class='helpie-faq accordions faq-toggle open-first groupSettings-535__enabled' \n                data-collection='' \n                data-pagination='0' \n                data-search='0' \n                data-pagination-enabled='0'\n                role='region'\n                aria-label='FAQ Section'\n                aria-live='polite'><h3 class=\"collection-title\">Frequently Asked Questions:<\/h3><article class=\"accordion \"><div class='helpie-faq-row'><div class='helpie-faq-col helpie-faq-col-12' ><ul><li class=\"accordion__item \"><div class=\"accordion__header \" \r\n                id=\"accordion-header-post-3074\"\r\n                role=\"button\"\r\n                aria-expanded=\"false\"\r\n                aria-controls=\"accordion-content-post-3074\"\r\n                data-id=\"post-3074\" \r\n                data-item=\"hfaq-post-3074\" \r\n                style=\"background:transparent;\" \r\n                data-tags=\"\"\r\n                tabindex=\"0\"><div class=\"accordion__title\">Q. Why use AWS Elastic Beanstalk for NestJS microservices?<\/div><\/div><div id=\"accordion-content-post-3074\" \r\n                class=\"accordion__body\" \r\n                role=\"region\"\r\n                aria-labelledby=\"accordion-header-post-3074\"\r\n                style=\"background:transparent;\"><p><span class=\"rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\">8<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span><span style=\"font-weight: 400\">\u00a0Elastic Beanstalk automates deployment, scaling, and health monitoring, which simplifies managing distributed microservices.<\/span><\/p>\n<\/div><\/li><li class=\"accordion__item \"><div class=\"accordion__header \" \r\n                id=\"accordion-header-post-3075\"\r\n                role=\"button\"\r\n                aria-expanded=\"false\"\r\n                aria-controls=\"accordion-content-post-3075\"\r\n                data-id=\"post-3075\" \r\n                data-item=\"hfaq-post-3075\" \r\n                style=\"background:transparent;\" \r\n                data-tags=\"\"\r\n                tabindex=\"0\"><div class=\"accordion__title\">Q. How do you configure microservices on Elastic Beanstalk?<\/div><\/div><div id=\"accordion-content-post-3075\" \r\n                class=\"accordion__body\" \r\n                role=\"region\"\r\n                aria-labelledby=\"accordion-header-post-3075\"\r\n                style=\"background:transparent;\"><p><span class=\"rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\">8<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span><span style=\"font-weight: 400\">\u00a0Each microservice can be packaged as a Docker container and deployed as an independent environment in Elastic Beanstalk.<\/span><\/p>\n<\/div><\/li><li class=\"accordion__item \"><div class=\"accordion__header \" \r\n                id=\"accordion-header-post-3076\"\r\n                role=\"button\"\r\n                aria-expanded=\"false\"\r\n                aria-controls=\"accordion-content-post-3076\"\r\n                data-id=\"post-3076\" \r\n                data-item=\"hfaq-post-3076\" \r\n                style=\"background:transparent;\" \r\n                data-tags=\"\"\r\n                tabindex=\"0\"><div class=\"accordion__title\">Q. How does Elastic Beanstalk handle scaling?<\/div><\/div><div id=\"accordion-content-post-3076\" \r\n                class=\"accordion__body\" \r\n                role=\"region\"\r\n                aria-labelledby=\"accordion-header-post-3076\"\r\n                style=\"background:transparent;\"><p><span class=\"rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\">8<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span><span style=\"font-weight: 400\">\u00a0It auto-scales based on CPU, memory, or custom CloudWatch metrics to match demand.<\/span><\/p>\n<\/div><\/li><li class=\"accordion__item \"><div class=\"accordion__header \" \r\n                id=\"accordion-header-post-3077\"\r\n                role=\"button\"\r\n                aria-expanded=\"false\"\r\n                aria-controls=\"accordion-content-post-3077\"\r\n                data-id=\"post-3077\" \r\n                data-item=\"hfaq-post-3077\" \r\n                style=\"background:transparent;\" \r\n                data-tags=\"\"\r\n                tabindex=\"0\"><div class=\"accordion__title\">Q. How do you manage inter-service communication in this architecture?<\/div><\/div><div id=\"accordion-content-post-3077\" \r\n                class=\"accordion__body\" \r\n                role=\"region\"\r\n                aria-labelledby=\"accordion-header-post-3077\"\r\n                style=\"background:transparent;\"><p><span class=\"rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\">8<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span><span style=\"font-weight: 400\">Use AWS VPC networking, service discovery (via DNS or API Gateway), and message brokers like SQS or SNS.<\/span><\/p>\n<\/div><\/li><li class=\"accordion__item \"><div class=\"accordion__header \" \r\n                id=\"accordion-header-post-3078\"\r\n                role=\"button\"\r\n                aria-expanded=\"false\"\r\n                aria-controls=\"accordion-content-post-3078\"\r\n                data-id=\"post-3078\" \r\n                data-item=\"hfaq-post-3078\" \r\n                style=\"background:transparent;\" \r\n                data-tags=\"\"\r\n                tabindex=\"0\"><div class=\"accordion__title\">Q. What are best practices for NestJS microservices on Beanstalk?<\/div><\/div><div id=\"accordion-content-post-3078\" \r\n                class=\"accordion__body\" \r\n                role=\"region\"\r\n                aria-labelledby=\"accordion-header-post-3078\"\r\n                style=\"background:transparent;\"><p><span class=\"rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\">8<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400\">Use separate environments per microservice<\/span><span style=\"font-weight: 400\">\n<p><\/span><\/li>\n<li><span style=\"font-weight: 400\">Store secrets in AWS Parameter Store<\/span><span style=\"font-weight: 400\">\n<p><\/span><\/li>\n<li><span style=\"font-weight: 400\">Monitor with CloudWatch<\/span><span style=\"font-weight: 400\">\n<p><\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Automate deployments with CI\/CD pipelines<\/span><\/li>\n<\/ul>\n<\/div><\/li><\/ul><\/div><\/div><\/article><\/section>\n","protected":false},"excerpt":{"rendered":"<p><span class=\"rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\">8<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span> In the AWS Cloud journey, we come across Elastic Beanstalk to be better than other services in managing the infrastructure environments effectively. On the other hand, NestJS is popular in creating efficient and scalable server-side applications, and is relatively a new option for the backend framework &#8211; it is lightweight, simple, and open-source. In this [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1068,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[288],"tags":[321,323,325,324,319],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Architect NestJS Microservices with AWS Elastic Beanstalk - The Workfall Blog<\/title>\n<meta name=\"description\" content=\"In the AWS Cloud journey, we come across Elastic Beanstalk to be better than other services in managing the infrastructure environments.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-architect-nestjs-microservices-with-aws-elastic-beanstalk\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Architect NestJS Microservices with AWS Elastic Beanstalk - The Workfall Blog\" \/>\n<meta property=\"og:description\" content=\"In the AWS Cloud journey, we come across Elastic Beanstalk to be better than other services in managing the infrastructure environments.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-architect-nestjs-microservices-with-aws-elastic-beanstalk\/\" \/>\n<meta property=\"og:site_name\" content=\"The Workfall Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/workfall\" \/>\n<meta property=\"article:published_time\" content=\"2022-07-19T12:41:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-30T05:43:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/18.141.20.153\/learning\/blog\/wp-content\/uploads\/2022\/07\/NestJS-Microservices-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@workfall\" \/>\n<meta name=\"twitter:site\" content=\"@workfall\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Workfall\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/18.141.20.153\/learning\/blog\/#organization\",\"name\":\"Workfall - Hire #Kickass Coders On Demand\",\"url\":\"https:\/\/18.141.20.153\/learning\/blog\/\",\"sameAs\":[\"https:\/\/www.instagram.com\/workfall\/\",\"https:\/\/www.linkedin.com\/company\/workfall\/\",\"https:\/\/facebook.com\/workfall\",\"https:\/\/twitter.com\/workfall\"],\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/18.141.20.153\/learning\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/i1.wp.com\/18.141.20.153\/learning\/blog\/wp-content\/uploads\/2021\/10\/cropped-WF_logo.png?fit=400%2C400\",\"contentUrl\":\"https:\/\/i1.wp.com\/18.141.20.153\/learning\/blog\/wp-content\/uploads\/2021\/10\/cropped-WF_logo.png?fit=400%2C400\",\"width\":400,\"height\":400,\"caption\":\"Workfall - Hire #Kickass Coders On Demand\"},\"image\":{\"@id\":\"https:\/\/18.141.20.153\/learning\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/18.141.20.153\/learning\/blog\/#website\",\"url\":\"https:\/\/18.141.20.153\/learning\/blog\/\",\"name\":\"The Workfall Blog\",\"description\":\"#Tech #Remote #Jobs\",\"publisher\":{\"@id\":\"https:\/\/18.141.20.153\/learning\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/18.141.20.153\/learning\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-architect-nestjs-microservices-with-aws-elastic-beanstalk\/#primaryimage\",\"url\":\"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2022\/07\/NestJS-Microservices-1.png\",\"contentUrl\":\"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2022\/07\/NestJS-Microservices-1.png\",\"width\":1920,\"height\":1080,\"caption\":\"How to Architect NestJS Microservices with AWS Elastic Beanstalk?\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-architect-nestjs-microservices-with-aws-elastic-beanstalk\/#webpage\",\"url\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-architect-nestjs-microservices-with-aws-elastic-beanstalk\/\",\"name\":\"Architect NestJS Microservices with AWS Elastic Beanstalk - The Workfall Blog\",\"isPartOf\":{\"@id\":\"https:\/\/18.141.20.153\/learning\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-architect-nestjs-microservices-with-aws-elastic-beanstalk\/#primaryimage\"},\"datePublished\":\"2022-07-19T12:41:30+00:00\",\"dateModified\":\"2025-09-30T05:43:49+00:00\",\"description\":\"In the AWS Cloud journey, we come across Elastic Beanstalk to be better than other services in managing the infrastructure environments.\",\"breadcrumb\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-architect-nestjs-microservices-with-aws-elastic-beanstalk\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-architect-nestjs-microservices-with-aws-elastic-beanstalk\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-architect-nestjs-microservices-with-aws-elastic-beanstalk\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/18.141.20.153\/learning\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Architect NestJS Microservices with AWS Elastic Beanstalk\"}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-architect-nestjs-microservices-with-aws-elastic-beanstalk\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-architect-nestjs-microservices-with-aws-elastic-beanstalk\/#webpage\"},\"author\":{\"@id\":\"https:\/\/18.141.20.153\/learning\/blog\/#\/schema\/person\/cab8236044692bc5b27606b13167794a\"},\"headline\":\"Architect NestJS Microservices with AWS Elastic Beanstalk\",\"datePublished\":\"2022-07-19T12:41:30+00:00\",\"dateModified\":\"2025-09-30T05:43:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-architect-nestjs-microservices-with-aws-elastic-beanstalk\/#webpage\"},\"wordCount\":1892,\"publisher\":{\"@id\":\"https:\/\/18.141.20.153\/learning\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-architect-nestjs-microservices-with-aws-elastic-beanstalk\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2022\/07\/NestJS-Microservices-1.png\",\"keywords\":[\"#aws\",\"#cloud\",\"#nestjs\",\"#nodejs\",\"#workfall\"],\"articleSection\":[\"Backend Development\"],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/18.141.20.153\/learning\/blog\/#\/schema\/person\/cab8236044692bc5b27606b13167794a\",\"name\":\"Workfall\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/18.141.20.153\/learning\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/09\/avatar_user_1_1693914404-96x96.png\",\"contentUrl\":\"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/09\/avatar_user_1_1693914404-96x96.png\",\"caption\":\"Workfall\"},\"sameAs\":[\"https:\/\/www.workfall.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Architect NestJS Microservices with AWS Elastic Beanstalk - The Workfall Blog","description":"In the AWS Cloud journey, we come across Elastic Beanstalk to be better than other services in managing the infrastructure environments.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-architect-nestjs-microservices-with-aws-elastic-beanstalk\/","og_locale":"en_US","og_type":"article","og_title":"Architect NestJS Microservices with AWS Elastic Beanstalk - The Workfall Blog","og_description":"In the AWS Cloud journey, we come across Elastic Beanstalk to be better than other services in managing the infrastructure environments.","og_url":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-architect-nestjs-microservices-with-aws-elastic-beanstalk\/","og_site_name":"The Workfall Blog","article_publisher":"https:\/\/facebook.com\/workfall","article_published_time":"2022-07-19T12:41:30+00:00","article_modified_time":"2025-09-30T05:43:49+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/18.141.20.153\/learning\/blog\/wp-content\/uploads\/2022\/07\/NestJS-Microservices-1.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_creator":"@workfall","twitter_site":"@workfall","twitter_misc":{"Written by":"Workfall","Est. reading time":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Organization","@id":"https:\/\/18.141.20.153\/learning\/blog\/#organization","name":"Workfall - Hire #Kickass Coders On Demand","url":"https:\/\/18.141.20.153\/learning\/blog\/","sameAs":["https:\/\/www.instagram.com\/workfall\/","https:\/\/www.linkedin.com\/company\/workfall\/","https:\/\/facebook.com\/workfall","https:\/\/twitter.com\/workfall"],"logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/18.141.20.153\/learning\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/i1.wp.com\/18.141.20.153\/learning\/blog\/wp-content\/uploads\/2021\/10\/cropped-WF_logo.png?fit=400%2C400","contentUrl":"https:\/\/i1.wp.com\/18.141.20.153\/learning\/blog\/wp-content\/uploads\/2021\/10\/cropped-WF_logo.png?fit=400%2C400","width":400,"height":400,"caption":"Workfall - Hire #Kickass Coders On Demand"},"image":{"@id":"https:\/\/18.141.20.153\/learning\/blog\/#\/schema\/logo\/image\/"}},{"@type":"WebSite","@id":"https:\/\/18.141.20.153\/learning\/blog\/#website","url":"https:\/\/18.141.20.153\/learning\/blog\/","name":"The Workfall Blog","description":"#Tech #Remote #Jobs","publisher":{"@id":"https:\/\/18.141.20.153\/learning\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/18.141.20.153\/learning\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-architect-nestjs-microservices-with-aws-elastic-beanstalk\/#primaryimage","url":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2022\/07\/NestJS-Microservices-1.png","contentUrl":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2022\/07\/NestJS-Microservices-1.png","width":1920,"height":1080,"caption":"How to Architect NestJS Microservices with AWS Elastic Beanstalk?"},{"@type":"WebPage","@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-architect-nestjs-microservices-with-aws-elastic-beanstalk\/#webpage","url":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-architect-nestjs-microservices-with-aws-elastic-beanstalk\/","name":"Architect NestJS Microservices with AWS Elastic Beanstalk - The Workfall Blog","isPartOf":{"@id":"https:\/\/18.141.20.153\/learning\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-architect-nestjs-microservices-with-aws-elastic-beanstalk\/#primaryimage"},"datePublished":"2022-07-19T12:41:30+00:00","dateModified":"2025-09-30T05:43:49+00:00","description":"In the AWS Cloud journey, we come across Elastic Beanstalk to be better than other services in managing the infrastructure environments.","breadcrumb":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-architect-nestjs-microservices-with-aws-elastic-beanstalk\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/learning.workfall.com\/learning\/blog\/how-to-architect-nestjs-microservices-with-aws-elastic-beanstalk\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-architect-nestjs-microservices-with-aws-elastic-beanstalk\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/18.141.20.153\/learning\/blog\/"},{"@type":"ListItem","position":2,"name":"Architect NestJS Microservices with AWS Elastic Beanstalk"}]},{"@type":"Article","@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-architect-nestjs-microservices-with-aws-elastic-beanstalk\/#article","isPartOf":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-architect-nestjs-microservices-with-aws-elastic-beanstalk\/#webpage"},"author":{"@id":"https:\/\/18.141.20.153\/learning\/blog\/#\/schema\/person\/cab8236044692bc5b27606b13167794a"},"headline":"Architect NestJS Microservices with AWS Elastic Beanstalk","datePublished":"2022-07-19T12:41:30+00:00","dateModified":"2025-09-30T05:43:49+00:00","mainEntityOfPage":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-architect-nestjs-microservices-with-aws-elastic-beanstalk\/#webpage"},"wordCount":1892,"publisher":{"@id":"https:\/\/18.141.20.153\/learning\/blog\/#organization"},"image":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-architect-nestjs-microservices-with-aws-elastic-beanstalk\/#primaryimage"},"thumbnailUrl":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2022\/07\/NestJS-Microservices-1.png","keywords":["#aws","#cloud","#nestjs","#nodejs","#workfall"],"articleSection":["Backend Development"],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/18.141.20.153\/learning\/blog\/#\/schema\/person\/cab8236044692bc5b27606b13167794a","name":"Workfall","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/18.141.20.153\/learning\/blog\/#\/schema\/person\/image\/","url":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/09\/avatar_user_1_1693914404-96x96.png","contentUrl":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/09\/avatar_user_1_1693914404-96x96.png","caption":"Workfall"},"sameAs":["https:\/\/www.workfall.com"]}]}},"jetpack_featured_media_url":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2022\/07\/NestJS-Microservices-1.png","jetpack-related-posts":[{"id":1083,"url":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-deploy-nestjs-microservices\/","url_meta":{"origin":1066,"position":0},"title":"How to Deploy NestJS Microservices to AWS Elastic Beanstalk?","date":"July 26, 2022","format":false,"excerpt":"AWS Elastic Beanstalk is an AWS service on which you can deploy your application and it offers orchestration for various AWS services such as EC2, and S3 out of the box through auto-scaling, load-balancing, and capacity provisioning. All you have to do is upload your code and AWS Elastic Beanstalk\u2026","rel":"","context":"In &quot;AWS Cloud Computing&quot;","img":{"alt_text":"How to Deploy NestJS Microservices to AWS Elastic Beanstalk?","src":"https:\/\/i1.wp.com\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2022\/07\/NestJS.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1513,"url":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-upload-large-files-1gb-and-beyond-to-aws-s3-using-nestjs-backend-and-reactjs-frontend\/","url_meta":{"origin":1066,"position":1},"title":"How to upload large files (1GB and beyond) to AWS S3 using NestJS (backend) and ReactJS (frontend)?","date":"November 15, 2022","format":false,"excerpt":"When dealing with file uploads, you must be aware that files are uploaded in buffers stored in memory and if the file is larger than the allocated memory in your VM, it may run out of memory and the application might crash. For example, if your allocated memory is 2GB,\u2026","rel":"","context":"In &quot;AWS Cloud Computing&quot;","img":{"alt_text":"How to upload large files (1GB and beyond) to AWS S3 using NestJS (backend) and ReactJS (frontend)?","src":"https:\/\/i1.wp.com\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2022\/11\/Cover-Images_Part2-3.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1684,"url":"https:\/\/learning.workfall.com\/learning\/blog\/building-real-time-apps-with-nestjs-and-graphql-subscriptions\/","url_meta":{"origin":1066,"position":2},"title":"Building Real-Time Apps with NestJS and GraphQL Subscriptions","date":"April 6, 2023","format":false,"excerpt":"Real-time applications are important in several instances. Especially in a scenario whereby immediate feedback is important such as messaging apps and IoT apps. Let\u2019s imagine a case in IoT whereby a smoke detector needs to relay information to water sprinklers in a burning building. This information has to be in\u2026","rel":"","context":"In &quot;Backend Development&quot;","img":{"alt_text":"Building Real-Time Apps with NestJS and GraphQL Subscriptions","src":"https:\/\/i1.wp.com\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/04\/Cover-Images_Part2-1.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":2374,"url":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-use-kafka-for-event-streaming-in-a-microservices-architecture\/","url_meta":{"origin":1066,"position":3},"title":"How to Use Kafka for Event Streaming in a Microservices Architecture?","date":"June 27, 2023","format":false,"excerpt":"The world of creating real-time applications can get complex when we have to consider latency, fault tolerance, scalability, and possible data losses. Traditionally, web sockets were the go-to option when it came to real-time applications, but think of a situation whereby there\u2019s server downtime. It means that there is a\u2026","rel":"","context":"In &quot;Backend Development&quot;","img":{"alt_text":"Kafka for Event Streaming in a Microservices Architecture","src":"https:\/\/i0.wp.com\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/06\/Cover-Images_Part2-1-1.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":675,"url":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-set-up-a-continuous-deployment-pipeline-to-deploy-versions-of-an-application-on-aws-elastic-beanstalk-using-aws-codepipeline-part-1\/","url_meta":{"origin":1066,"position":4},"title":"How to set up a continuous deployment pipeline to deploy versions of an application on AWS Elastic Beanstalk using AWS CodePipeline (Part 1)?","date":"November 24, 2021","format":false,"excerpt":"Do you have concerns about managing and deploying web applications? With AWS Elastic Beanstalk, you can launch your full web application in just a few minutes by simply uploading the code. Starting with capacity provisioning, load balancing, auto-scaling, and application health monitoring, this service will take care of the whole\u2026","rel":"","context":"In &quot;AWS Cloud Computing&quot;","img":{"alt_text":"AWS Elastic Beanstalk - Workfall","src":"https:\/\/i2.wp.com\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/11\/CoverImages_1200x628px-6.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1038,"url":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-use-aws-ssm-parameter-store-in-aws-elastic-beanstalk-instances\/","url_meta":{"origin":1066,"position":5},"title":"How to use AWS SSM Parameter Store in AWS Elastic Beanstalk instances?","date":"July 12, 2022","format":false,"excerpt":"Almost every developer makes use of environment variables. They are excellent for establishing parameters that alter depending on the system's surroundings. Sadly, they struggle to scale. There are methods to accomplish it, but they aren't enjoyable. Here's why AWS can replace environment variables (or at least reduce your reliance on\u2026","rel":"","context":"In &quot;AWS Cloud Computing&quot;","img":{"alt_text":"AWS SSM Parameter Store in AWS Elastic Beanstalk instances","src":"https:\/\/i1.wp.com\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2022\/07\/Cover-Images_Part2-1-1.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/posts\/1066"}],"collection":[{"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/comments?post=1066"}],"version-history":[{"count":7,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/posts\/1066\/revisions"}],"predecessor-version":[{"id":3080,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/posts\/1066\/revisions\/3080"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/media\/1068"}],"wp:attachment":[{"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/media?parent=1066"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/categories?post=1066"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/tags?post=1066"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}