Technology / System Admin

How to Build an App Without a Server

How to Build an App Without a Server
Follow us
Published on September 12, 2022

Do you have the next big app idea? Creating a new web app can cost a lot of money. At least, that’s what the IT industry wants you to think. The truth is that today individuals and small teams are making a great living creating mobile apps and web apps with very low operating costs. It’s rumored that the website ‘Have I Been Pwned’ operates on a lowly $25 a month budget. 

How is this even possible?

Today, we will talk about the wonders of serverless computing, how AWS Lambda can be used to make an app, and how to get online AWS Lambda training to make your app a possibility. So, let’s get into it!

What is Serverless Computing?

Traditionally, if you build a web app or a mobile app, you also need to host a server.  That server is responsible for things like handling transactions with the database or processing specific types of logic that client-side devices may not be able to handle. 

Hosting your own server can be expensive and complicated, however. Servers require redundancy. A proper server needs two of everything — from power supplies and network connections to ECC memory and storage devices. Servers require regular maintenance and upkeep, too. This puts a server at risk for downtime while increasing operational costs. 

So, what is serverless computing? Technically, serverless computing is a resource that is triggered, typically by an API call, to perform some action. That resource runs on shared hardware that requires no upkeep from an IT department. 

However, serverless computing is more of an MSP-like product when you start digging into the weeds. For example, let’s say that you are running Node.JS scripts in a serverless architecture. Those Node scripts don’t just magically run. They still need the Node runtime to process those scripts. The Node runtime still needs hardware and an OS to run. That hardware and OS still need to be maintained. 

The most significant difference, in this case, is that the maintenance and architecture of that Node instance are abstracted away from customers. An organization's API calls the API for that serverless computing resource. The API controlling the serverless computing resource then triggers the Node instance to do something. That Node resource is redundant and shared between many different people, however. That gives the serverless computing resource a shroud of seemingly being controlled by magic. However, there’s still an IT jockey running around a data center somewhere, keeping that serverless computing resource operational. 

What are Examples of Serverless Computing?

Various cloud vendors offer different types of serverless computing resources. One of the most popular is AWS Lambda. GCP also provides serverless computing products. Microsoft’s Azure platform does, too. Those are the big three, but tons of little guys are out there that offer feature parallel serverless computing products. 

If your organization must keep IT resources on-site or prefers to, the IT department can host its own serverless computing resources through products like Kubernetes. 

How is Serverless Computing Different From Using Traditional Servers?

We discussed how serverless computing is different from using a traditional server above. Let’s expand on our explanation a bit. We mentioned above that serverless computing is basically like an MSP service.  We also stated that organizations could also host their own serverless computing resources. So, which is it?

At its core, serverless computing is both. Serverless computing is a bit of a misnomer because serverless computing products, like AWS Lambda, still depend on servers. In this case, it’s the architecture of the server that makes a difference. 

Let’s stick with our Node.JS example that we used above. On a traditional server, that Node.JS instance runs at the OS level.  A single instance runs all of the Node.JS scripts on the server.  A single server typically handles all processing for a single application (Eg. A website, etc…). Calls to Node are made directly to that server.

On the other hand, a serverless computing resource has an API sitting between the server and the serverless computing resources. The serverless computing resource also has redundancy and high availability built-in. For instance, the server hosting the serverless computing resources may have a bunch of instances running Node and nothing else. Many different customers and applications will hammer that server to process nothing but Node scripts. Those resources are shared, and customers, applications, and software engineers don’t see any of the mechanics running behind the scenes. 

That’s an insane amount of oversimplification, but you get the idea. 

One more note. Serverless computing, like AWS Lambda, is far more scalable than a traditional computer, too. That’s due to how serverless computing works.

When a server is built, it’s designed to handle a specific capacity. On the other hand, a serverless computing resource has one specific intention. For our Node.JS example, serverless resources run nothing but Node scripts.  It can also run tons of different Node scripts at the same time. However, products like AWS Lambda and Kubernetes are designed from the ground up with expandability. If your application uses a serverless computing resource, there shouldn’t be any talks of scaling in the future. It should simply happen.

Is AWS Lamda Cheaper Than Running Your Own Server?

Products like AWS Lambda are typically cheaper to use than a dedicated server. Serverless computing products are far easier to calculate the TCO over time. 

We’re using TCO loosely here, but let’s look at it this way. We’ll exclude the physical hardware costs of putting together a server (because who does that nowadays!). Most people use services like EC2. So let’s look at that. 

EC2 has a pretty fixed cost. If you get a nano server, it’ll cost roughly $5 a month, depending on the region it’s hosted in. But there are additional costs. Depending on how much storage you need for your EC2 instance, you might need extra block storage space. EC2 includes a certain amount of ingress and egress traffic. If you accumulate overages, that’s an additional cost. EC2 instances may not have associated hardware costs, but they still require an IT tech to update and maintain them.  That is an additional cost, too. The list goes on.

On the other hand, an AWS Lambda resource is charged per processing time. If your Node.JS Lambda script takes 40 milliseconds to process, that only costs you 1/10th of a cent (costs vary by region and Lambda configuration). Your software maintenance costs remain the same as running a traditional server, etc.., but there aren’t any surprise costs here. Everything is easy to figure out. AWS even offers tools to help calculate your expected monthly expenses. 

How to Make a Serverless App with a Serverless API

While reading this article, you might have noticed that an API is used to make a call to a serverless computing resource. Don’t APIs need a server to run, however? Did I lie to you this entire time!? Do we need servers after all!?!

Nope, you’re good. 

AWS also has a service called API gateway.  We won’t delve into API Gateway too heavily in this article. Nonetheless, it’s something you need to know about.  AWS API Gateway is like AWS Lambda, but API Gateway processes API calls instead of processing logic. 

Wrapping Up

We’ve covered a lot in this article! We’ve introduced you to serverless computing resources. We’ve pulled back the curtain revealing the operator behind serverless computing products like AWS Lambda. And we also introduced AWS API Gateway briefly.

This article should serve as nothing more than a primer introducing the fact that these products exist. Using serverless computing still requires as much work as going the traditional server route for hosting and running applications.  The biggest difference, and dare I say advantage, that serverless computing offers is scalability, reduced downtime, easier maintenance, and lower, more predictable costs.  

Before you dive headfirst into building a serverless computing application or migrating an application to a serverless environment, I highly recommend you spend some more time studying serverless computing resources. Utilizing serverless computing resources, like AWS Lambda, requires some background knowledge.  Your application may need to be architected in a specific way - though the same is true for traditional server-hosted products, too. 

AWS offers tons of products that can be used to build web applications, mobile applications, and even internal business IT resources.  Products like Aurora DB, Lambda, and API gateway offer a path for businesses to create IT infrastructures without the traditional TCO or hassle and cost of upkeep. If you want to learn more, CBT Nuggets has a variety of online AWS training courses that will teach you how to pull all of these serverless computing resources together. Hurry and check out all of our online Lambda courses and other AWS training modules

Don't miss out!Get great content
delivered to your inbox.

By submitting this form you agree to receive marketing emails from CBT Nuggets and that you have read, understood and are able to consent to our privacy policy.

Recommended Articles

Get CBT Nuggets IT training news and resources

I have read and understood the privacy policy and am able to consent to it.

© 2024 CBT Nuggets. All rights reserved.Terms | Privacy Policy | Accessibility | Sitemap | 2850 Crescent Avenue, Eugene, OR 97408 | 541-284-5522