Deployment Architecture
Learn how monolayer deploys your applications to AWS
This section describes the deployment architecture monolayer uses to run your applications on Amazon Web Services (AWS). monolayer abstracts infrastructure complexity while still leveraging native AWS services.
Architecture Overview
monolayer deploys your applications directly into your own AWS account using a fully managed architecture. By deploying resources directly to your cloud, you maintain complete ownership of your data and infrastructure while enjoying a serverless operations experience.
The Build Phase
During the build phase, monolayer packages your application code using AWS CodeBuild. This process prepares your application for deployment without requiring local configuration.
The build phase performs the following tasks:
- Install dependencies. It retrieves and installs all package dependencies defined in your project.
- Run framework build steps. It compiles your code and executes framework-specific build and optimization steps.
- Produce deployable artifacts. It packages the output into highly optimized deployment artifacts ready for execution.
The Runtime Layer
Your web applications run on AWS Lambda, a serverless compute service that runs code in response to events.
AWS Lambda provides the following advantages for your application:
- Serverless execution. You do not need to provision, manage, or patch virtual servers.
- Automatic scaling. Your application scales up or down instantly to match incoming traffic volume.
- Pay-per-use pricing. You only pay for the exact compute time your application consumes, with no idle server costs.
Background and Lifecycle Processing
Long-running tasks and lifecycle operations execute on Amazon Elastic Container Service (Amazon ECS). This layer handles workloads that are not suitable for serverless execution.
These workloads include:
- Deployment hooks. It runs custom scripts or migrations before or after your application deploys.
- Background processing. It executes persistent or long-running worker processes.
- Resource-intensive jobs. It runs operations that exceed AWS Lambda execution time or memory limits.
Networking and Delivery
monolayer routes all incoming traffic to your application through Amazon CloudFront.
Amazon CloudFront is a global Content Delivery Network (CDN) that secures and accelerates content delivery. It provides the following features:
- Global CDN. It caches static assets at edge locations close to your users.
- TLS termination. It secures connections with Transport Layer Security (TLS) certificates at the edge.
- Edge caching. It reduces request latency by serving content from edge caches.
- Low-latency delivery. It optimizes the network path between your users and AWS services.
The Architecture Summary
The following table summarizes the AWS services utilized in each layer:
| Layer | AWS Service |
|---|---|
| Build | AWS CodeBuild |
| Application Runtime | AWS Lambda |
| Background Processing | Amazon Elastic Container Service (Amazon ECS) |
| CDN and Edge | Amazon CloudFront |
Architecture Benefits
By utilizing this deployment model, your application gains the following benefits:
- Fully serverless architecture. All resources are serverless or fully managed by AWS.
- Zero infrastructure management. You do not need to configure VPCs, firewalls, or load balancers.
- Direct account deployment. Everything runs entirely within your AWS account for maximum security and compliance.
- Automatic scaling. The platform automatically handles traffic spikes and scales down to zero when idle.
The Developer Mental Model
When you deploy with monolayer, you only need to focus on writing your application code. monolayer manages the rest of the operational lifecycle:
- Build. It automatically builds your application artifacts.
- Deploy. It deploys those artifacts securely to AWS.
- Configure. It wires and configures all underlying cloud infrastructure.
- Scale. It scales your services automatically with demand.
You can manage all of these stages without writing or maintaining complex Infrastructure as Code (IaC) configuration.