I'm setting up a modern SaaS-style Django application for production and I'm trying to figure out the best deployment strategy. Should I containerize the entire stack (Django app, Postgres database, and Redis cache) using Docker on an AWS server, or is it more efficient to only containerize the app while leveraging managed services like Amazon RDS for the database and ElastiCache for Redis?
5 Answers
Using Lambda with managed Redis and RDS is a solid option for deploying Django apps, reducing the hassle of server management.
This issue leans more towards software architecture than Docker specifics. The 'best' approach varies by your needs—managed services generally mean less management effort, while running everything in containers might save costs. If compliance is a concern, managed services probably make more sense for you.
Consider your team's expertise and the expected load before deciding. If you're leaning toward ECS, Fargate can simplify things by managing the infrastructure for you, though you'd need to learn task placement for scaling more on EC2. For the database, you could use Postgres on EC2 with EBS or opt for Aurora for a serverless option which handles scaling automatically.
Using ECS with Fargate for your app can really cut down on management overhead. Pairing it with RDS and ElastiCache would balance usability and performance, especially if your team is still getting familiar with AWS.
I strongly recommend against containerizing your database. Always go with a managed service to ensure reliability. If you're looking for good starting points, check out django-cookiecutter.

Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically