toggle
Ss

Serverless architecture

Table of Contents

What is serverless architecture?

Serverless architecture is a cloud resources management concept where the user only focuses on running applications, while the cloud provider manages the dynamic infrastructure needs. The concept of serverless is that developers could run programs and write codes while the required servers and compute will be available at their disposal whenever they need. Hence, serverless architecture is more effective and flexible than monolithic architecture.

Two major components of serverless architecture are Function as a service (FaaS) and Backend as a service (BaaS).

FaaS is Function as a Service that allows developers to trigger functions automatically based on real-time changes in events like file uploads, database changes, etc. FaaS is mainly used in file processing, handling HTTP requests, etc. Example for FaaS tools: AWS Lambda, Google cloud functions, etc.

BaaS is Backend as a Service is when developers use third-party services to manage backend functions, without having to manage or build the back-end cloud infrastructure. 

Examples: BaaS providers like AWS Amplify offer backend packages for database handling, authentication, storage, etc.

Serverless architecture use cases

Data processing, web applications, and event-driven functions are some applications that use serverless architecture.

1. Data processing: Serverless helps with real-time or batch processing of data and ETL workloads to happen on-demand, facilitating smooth data movement from databases to warehouses.

2. Chatbots: Serverless architecture plays a role in running chatbots, integrating NLP queries with backend processes to deliver fast responses in real-time.

3. Real-time notifications like push messages, alerts, etc: FaaS applications like AWS Lambda send messages based on predefined triggers and events. Like sending alert messages when a bank account transaction happens.

4. IoT devices: Serverless architecture is also the backbone for real-time data processing to analyze data from sensors, wearable devices, etc, ruling out the constant requirement of dedicated servers for notification.

5. RESTful APIs: RESTful APIs for mobile and web applications also require serverless architecture to process HTTP requests. Serverless makes scaling easier here, adjusting process capacity to suit varying demands without provisioning issues.

6. Microservices: Microservices architecture is when a complex monolithic application is split into tiny parts, each part acting independently as a microservice. Each microservice can be serverless, reducing infrastructure complexity and allowing individual scaling. 

7. Real-time dashboards: Ever wondered how live dashboards update business metrics in real-time? Serverless can help real-time dashboards fetch and process updates in data and reflect the changes in dashboards without dedicated resources.

There are many other serverless applications too, like automatic disaster backups, rapid prototyping, event-driven workflows, etc.

When to use serverless

Your company can use serverless architecture under the following scenarios.

  • When you have event-driven workflows, finishing an event will trigger a notification. 

  • When you want to reduce cloud bills, optimize cloud resources usage, especially for applications with low or intermittent activities.

  • When your applications have unpredictable traffic, demanding over-provisioning and under-provisioning of servers.

  • When you have to build and test products quickly without investments. 

  • When your development team could only focus on coding and application development. 

  • When there is real-time data processing involved, collecting and analyzing IoT device data to make decisions, etc.

That being said, traditional architecture will be more suited if your company has continuously running processes, has monolithic architecture, requires more control over server configurations, or has microservices interdependent on each other.

Commonly used tools to set up serverless infrastructure:

1. AWS Lambda: A FaaS tool from AWS to set up serverless architecture and could be integrated with other AWS tools.

2. Azure Functions is the serverless platform from Microsoft for event-based triggers.

3. Google Cloud Functions is FaaS from Google for event-driven scenarios.

4. AWS Amplify and Firebase are BaaS applications to build web and mobile apps without managing infrastructure.

Benefits & limitations of Serverless

Cost effective: You only need to pay for compute that you’ve used during executing a function. 

Scaling when required: When there is an increase in traffic, could easily scale compute without manually allocating resources.

No provisioning tasks: Developers don’t have to allocate or deallocate servers based on needs.

More focus on development: As infrastructure management and backend services are off their platform, developers can work fast and deploy earlier than planned.

But there are certain limitations with serverless, too.

Cold start latency: There can be time delays in running serverless functions that are not active in those moments. However, there are warming strategies to improve the response time. For instance, choosing the programming language can decide cold start times. Languages like Node.js, Go, Python, etc. have better response time while invoking a function than C, C++.

Vendor lock-in: Since you rely on the cloud provider’s ecosystem for serverless, vendor lock-in can occur, causing migration challenges.

Serverless becoming the future?

Serverless architecture is becoming a more common preference in the world of cloud computing, as companies preferences and development cycles have changed. Another good thing about serverless is that it can also co-exist with traditional and container architectures, helping you to get the best of all models suitable for your workload requirements. 

With the evolution of serverless, you could find more advanced platforms that seamlessly integrate with your current architecture from AI to edge computing.

OUR SERVICES

Catalyzing your data journey

Data engineering

Data engineering

Designing systems to collect, store, transport and transform your data

Data consulting

Data consulting

Understanding the purpose, value, and scale of your organization's data

Data visualization

Data visualization

Representing relationships and revealing hidden insights in your data

Data science

Data science

Leveraging AI and ML to unlock unprecedented business value

Let's build your data culture together

Talk to Datakulture consultant today.