Summary
JavaScript is the Rodney Dangerfield of programming languages — it doesn’t get no respect.
The truth is, Node.js broke the mold and made JavaScript a top programming language. New tools built on top of Node.js have taken some pain out of developing modern web applications, and if you are not on the JS hype train, it’s time to hop on.
Why? The thing about enterprise software is that it’s pretty much built for anything except for, well, being enterprise-sized. The truth about Node.js is that it has an edge over the old favorites: ASP.NET, ASP.NET Core or Spring. Firstly, it uses available resources available much better than the old favorites: ASP.NET, ASP.NET Core, or Spring apps. The thought behind Node was to make it handle multiple connections at the same time. These two strengths make it well suited to the world of the Cloud.
Of course, as some will point out, your old apps will work fine as long as you keep throwing more money at them; no matter how they are built. If you like to be efficient, though, we have a solution for you. Recently, the serverless approach is all the rage, and for several good reasons.
Firstly, our apps become more reliable, as there are fewer parts they all share. If everything stops working for you, then either there was a mass catastrophe, or you are a token of bad luck. Secondly, by using cloud providers, you only pay for the time your services are actually working, which is never 100% of the time. Lastly, you don’t have to maintain, or pay for, your company’s servers; let’s call it “Marie Kondo programming”. Throw out what does not spark joy.
The number of services available for you on AWS, Azure, or GCP can quickly make you lose your head. Luckily, we have asked our Cloud Competency Leader, Maciej Gos, to boil everything down to reusable patterns that you can pick up.
After deciding what your needs are, building everything is not much more complicated than piecing complicated jigsaw puzzles together. If you require any clarification after this section, feel free to call us or email us – we will be happy to explain everything in detail.
If you prioritize quick iterations, and don’t want to bother with anything more than you have to, this is the choice you want.
The setup is simple and straightforward, so your teams can focus primarily on the agile development. As your users navigate over to your web app, they will go through the API Gateway, which acts as the front door, to your Lambdas. From there, they will be communicating with a database directly. The name of the game in this case is simplicity, and a short time to set up
Of course, you might soon find your set-up to not be enough, may want to improve it, or you already have a product which already has a high number of users. There are some aspects that we have sacrificed here for the sake of keeping it simple. Let’s lay out how a more complete solution would look like in the next section.
What you see above is a more comprehensive blueprint, than the previous one. This is something that you eventually will shift towards. All the additional money spent goes towards making everything more reliable.
Here, in this blueprint, Amazon Simple Queue Service (SQS) before the app code. We want to make sure, that the stream of data to your web app does not overload it. This small change made the setup more reliable than it was.
The last thing that benefits you is setting a limit on the number of connections to your DB at the same time. They are just like humans: there is a limit to how many things we can do at the same time. If we wanted to do too many things at once, we would have failed miserably.
In this case, any delays, even those as small as 10 milliseconds (ms), are your enemy. Even if they are something seemingly unnoticeable, decreasing them improves your clients’ overall perceptions – that’s money for nothing!
To achieve that, we can run our code on the Edge; that’s just Cloud Architect’s fancy way of saying closer to your users. Lambda@Edge does wonders when it comes to the response time. If you can reduce the time your visitors have to wait for your page to load by 10 milliseconds only, then your revenue will go up significantly - up to a yearly salary of Bing’s engineer. For comparison, an average blink of an eye is 30 times longer than 10 milliseconds.
Cloud provides us with an easy way to create an architecture for your service without worrying about much of what you traditionally had to keep an eye on. Modernizing your servers, employing dedicated staff, and electricity costs were only some of the aspects that no longer will cause you a headache.
Furthermore, what we showed you today on the blueprints will mostly be enough. Should you feel as if you need a personalized cloud design, feel free to contact Maciej Gos, ITMAGINATION’s Cloud Competence Leader.
The thing about Cloud providers is that they offer almost the same services under different names. Azure, therefore, offers similar solutions to the ones offered by AWS. If Microsoft’s Cloud is your cup of tea, then we have prepared an additional scheme for you. The services do somewhat of the same job, so there is not much to say about them here. If you understood all the previous blueprints, you understand this one as well.
This post is part of a series exploring full-stack JavaScript development, check out our other posts here:
The Complete Guide To JavaScript, Node.js, And TypeScript In Enterprises & Startups
The Complete History of JavaScript, TypeScript, and Node.js
5 Reasons Why Startups Love Node.js
How Node.js Changed the World of Corporate Software Engineering
Battle-Tested JavaScript Frameworks - Part 1