IaC Django Serverless Basic for AWS

An extended version of the IaC Django Serverless Starter. This solution enables developers to deploy Django applications using a fully serverless architecture on AWS, with services such as AWS Lambda, Amazon S3, CloudFront, and SQLite stored on Amazon EFS.

Who is this product for?

This product is tailored for developers who want to build and deploy Django applications in serverless environment on AWS. Whether you're creating a side project or deploying an app for production, this solution simplifies infrastructure management and scaling using AWS services.

It can also be used by developers or learners who want to understand how Python/Django applications can be deployed on AWS, leveraging an Infrastructure as Code (IaC) approach with tools like CloudFormation and AWS SAM.

Use Cases

This product is suited for developers who need to:

  • Build web applications without managing EC2 or RDS instances.
  • Leverage serverless infrastructure to reduce costs, especially for small to medium projects.
  • Run their Django applications in a highly available multi-AZ environment.
  • Deploy apps that can scale down to zero, ensuring cost efficiency during low-traffic periods.

Demo

A simple Django polls application:

Architecture

This solution uses the following AWS services:
  1. AWS Lambda
  2. Amazon VPC
  3. Amazon EFS
  4. Amazon DynamoDB
  5. AWS Secrets Manager
  6. Amazon S3
  7. Amazon Route 53
  8. Amazon API Gateway
  9. Amazon CloudFront
  10. AWS Certificate Manager
  11. Amazon CloudWatch
  12. AWS CloudFormation
  13. AWS SAM

Overview

Features

  • IPv6-ready for modern networking.
  • HTTPS-only by default, with the latest secure ciphers.
  • Supports HTTP/3 and Brotli for faster web performance.
  • Async-ready to handle asynchronous Django applications.
  • Security headers are pre-configured to ensure your app is secure from the start.
  • Automatic cache busting to keep your static assets updated without manual intervention.
  • Configurable automatic database backup and manual restore via CLI for data recovery.
  • Optionally activated keep-warm task to reduce Lambda cold-start latency for better responsiveness.

Environment Options

  • LOCAL: Designed for local development using Docker and Dev Containers in VS Code.
  • DEV: For remote testing and staging in the cloud, ensuring your app runs as expected before going live.
  • PROD: For production, ensuring high availability and security in a live environment.

Benefits

  • Multi-AZ deployment ensures high availability and reliability.
  • 99.99% SLA for Amazon EFS, significantly higher than single-AZ RDS, which provides only 99.5% SLA.
  • No need to manage complex networking or database servers.
  • The entire infrastructure is described in an Infrastructure as Code (IaC) template, allowing for quick and easy deployment with minimal manual configuration.
  • Serverless infrastructure can scale automatically, improving efficiency and reducing costs.
  • Applications can remain mostly within AWS Free Tier limits for smaller projects, further minimizing operational costs.
  • The setup includes a complete local development environment for VS Code and Docker, allowing for a quick start with minimal effort.

Limitations

Despite its readiness for production use, there are some limitations to consider:

  • Write-heavy applications: Due to the use of SQLite as the database, this solution isn't suitable for write-intensive applications. During any write operation, the database is locked, blocking all reads and writes until the operation completes.
  • High Latency: The use of SQLite and network-attached storage (EFS) can result in higher latencies, making it less suitable for latency-sensitive applications.
    • Read Latency: Even for read-only requests, the latency for a typical Lambda execution with a Django app interacting with the database is over 100-150 ms.
    • Write Latency: Write operations have a latency of 300 ms or more during a typical Lambda execution.
  • External API calls: The Lambda function is deployed in a VPC and cannot access external IPv4 resources, so any resources that your application needs to connect to must be available via IPv6.

This solution is designed for environments where write operations are infrequent.

Supported Versions

  • Python: 3.12
  • Django: 5.1

Technical Support

This product includes 30 minutes of email support. You may optionally purchase a separate support or customization package. Please contact us for details.

License

This software is released under a commercial license.

Pricing

Get the complete solution to deploy your Django application on AWS with a serverless architecture, ensuring security, and ease of use at a competitive price.

Price: $190

Order Now

Cookie Notice: We use essential cookies only for core website functions, such as authentication and security. We do not sell your personal information or use it for cross-site tracking or targeted advertising.

We are not affiliated with, endorsed by, or sponsored by Amazon Web Services (AWS) or Amazon.com, Inc. The use of the term "AWS" is solely for descriptive purposes to indicate that the software is compatible with AWS services. Amazon Web Services and AWS are trademarks of Amazon.com, Inc. or its affiliates.

Website content is licensed under CC BY-NC-SA 4.0. In case of questions, please contact us at contact@efficient.solutions.

Copyright © 2024 Efficient Solutions LLC