DigitalOcean App Platform Overview¶
Introduction¶
DigitalOcean App Platform is a Platform-as-a-Service (PaaS) offering that enables developers to build, deploy, and scale applications quickly without managing infrastructure. It supports multiple programming languages, frameworks, and provides automatic deployments from Git repositories.
Key Features¶
- Zero Infrastructure Management: No servers to configure or maintain
- Automatic Deployments: Deploy from GitHub, GitLab, or container registries
- Auto-Scaling: Automatically scale based on traffic
- Built-in CI/CD: Integrated continuous deployment
- Multiple Languages: Node.js, Python, Go, PHP, Ruby, Java, .NET, Rust
- Static Sites: Deploy static websites and SPAs
- Databases: Managed PostgreSQL, MySQL, Redis, MongoDB
- Custom Domains: Free SSL certificates with Let's Encrypt
- Global CDN: Built-in content delivery network
- Environment Variables: Secure configuration management
App Platform Architecture¶
┌─────────────────────────────────────────────────────────────┐
│ Internet / Users │
└────────────────────────────┬────────────────────────────────┘
│
┌────────▼────────┐
│ Global CDN │
│ (Edge Caching) │
└────────┬────────┘
│
┌────────▼────────┐
│ Load Balancer │
│ (Auto SSL) │
└────────┬────────┘
│
┌────────────────────┼────────────────────┐
│ │ │
┌────▼────┐ ┌────▼────┐ ┌────▼────┐
│ App │ │ App │ │ App │
│Instance │ │Instance │ │Instance │
│ #1 │ │ #2 │ │ #3 │
└────┬────┘ └────┬────┘ └────┬────┘
│ │ │
└────────────────────┼────────────────────┘
│
┌────────▼────────┐
│ Managed DB │
│ (PostgreSQL) │
└─────────────────┘
Auto-scaling: Instances scale based on CPU/Memory usage
Supported Components¶
1. Web Services¶
Languages:
├─> Node.js (Express, Next.js, Nest.js)
├─> Python (Django, Flask, FastAPI)
├─> Go (Gin, Echo, Fiber)
├─> PHP (Laravel, Symfony)
├─> Ruby (Rails, Sinatra)
├─> Java (Spring Boot)
├─> .NET (ASP.NET Core)
└─> Rust (Actix, Rocket)
Features:
├─> HTTP/HTTPS endpoints
├─> Auto-scaling
├─> Health checks
├─> Custom domains
└─> Environment variables
2. Static Sites¶
Frameworks:
├─> React (Create React App, Vite)
├─> Vue.js (Nuxt.js)
├─> Angular
├─> Svelte (SvelteKit)
├─> Hugo
├─> Jekyll
├─> Gatsby
└─> Plain HTML/CSS/JS
Features:
├─> Global CDN
├─> Automatic builds
├─> Custom domains
├─> Free SSL
└─> SPA routing support
3. Worker Services¶
Background Jobs:
├─> Queue processors
├─> Scheduled tasks
├─> Data processing
├─> Email workers
└─> Batch jobs
Features:
├─> No HTTP endpoint
├─> Auto-restart on failure
├─> Resource limits
└─> Logging
4. Jobs¶
One-time or Scheduled:
├─> Database migrations
├─> Data imports
├─> Cleanup tasks
├─> Cron jobs
└─> Batch processing
Features:
├─> Pre-deploy jobs
├─> Post-deploy jobs
├─> Scheduled execution
└─> Manual triggers
5. Databases¶
Managed Databases:
├─> PostgreSQL
├─> MySQL
├─> Redis
└─> MongoDB
Features:
├─> Automatic backups
├─> High availability
├─> Connection pooling
├─> Monitoring
└─> Automatic updates
Pricing Tiers¶
Basic Plan¶
$5/month per component
├─> 512 MB RAM
├─> 1 vCPU (shared)
├─> 40 GB bandwidth
└─> Best for: Development, small apps
Professional Plan¶
$12/month per component
├─> 1 GB RAM
├─> 1 vCPU (dedicated)
├─> 100 GB bandwidth
└─> Best for: Production apps
Starter Plan (Static Sites)¶
Pro Plan (Static Sites)¶
Deployment Workflow¶
┌─────────────────────────────────────────────────────────────┐
│ Deployment Pipeline │
└─────────────────────────────────────────────────────────────┘
1. Code Push
└─> Push to GitHub/GitLab
2. Trigger Build
└─> Webhook triggers App Platform
3. Build Phase
├─> Clone repository
├─> Install dependencies
├─> Run build commands
└─> Create container image
4. Pre-Deploy Jobs
└─> Run migrations, setup tasks
5. Deploy
├─> Rolling deployment
├─> Zero-downtime
└─> Health checks
6. Post-Deploy Jobs
└─> Cache warming, notifications
7. Live
└─> Application accessible
Use Cases¶
1. Web Applications¶
Example: E-commerce Platform
├─> Frontend: React (Static Site)
├─> Backend: Node.js API (Web Service)
├─> Database: PostgreSQL (Managed DB)
├─> Workers: Order processing (Worker)
└─> Jobs: Daily reports (Scheduled Job)
2. API Services¶
Example: REST API
├─> API: Python FastAPI (Web Service)
├─> Cache: Redis (Managed DB)
├─> Database: PostgreSQL (Managed DB)
└─> Workers: Background tasks (Worker)
3. Static Websites¶
Example: Portfolio Site
├─> Frontend: Next.js (Static Site)
├─> CMS: Headless CMS (External)
└─> CDN: Built-in global CDN
4. Microservices¶
Example: Microservices Architecture
├─> Auth Service: Go (Web Service)
├─> User Service: Node.js (Web Service)
├─> Payment Service: Python (Web Service)
├─> Database: PostgreSQL (Managed DB)
└─> Cache: Redis (Managed DB)
Key Benefits¶
1. Developer Experience¶
- Simple configuration (app.yaml)
- Git-based deployments
- Automatic HTTPS
- Built-in monitoring
- Easy rollbacks
2. Scalability¶
- Automatic horizontal scaling
- Load balancing included
- Global CDN
- Database connection pooling
- Resource limits
3. Cost-Effective¶
- Pay per component
- No idle costs for static sites
- Predictable pricing
- Free SSL certificates
- Included bandwidth
4. Security¶
- Automatic SSL/TLS
- DDoS protection
- Private networking
- Secrets management
- Regular security updates
Comparison with Other Services¶
| Feature | App Platform | Heroku | AWS Elastic Beanstalk | Vercel |
|---|---|---|---|---|
| Ease of Use | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ |
| Pricing | $5-12/mo | $7-25/mo | Variable | Free-$20/mo |
| Auto-Scaling | ✓ | ✓ | ✓ | ✓ |
| Static Sites | ✓ | ✗ | ✗ | ✓ |
| Databases | Managed | Add-ons | Separate | External |
| Global CDN | ✓ | ✗ | CloudFront | ✓ |
Getting Started¶
Quick Start (5 Minutes)¶
# 1. Install doctl
brew install doctl
# 2. Authenticate
doctl auth init
# 3. Create app from GitHub
doctl apps create --spec - << EOF
name: my-app
services:
- name: web
github:
repo: username/repo
branch: main
run_command: npm start
environment_slug: node-js
instance_count: 1
instance_size_slug: basic-xxs
EOF
# 4. Monitor deployment
doctl apps list
Best Practices¶
1. Configuration¶
- Use app.yaml for reproducibility
- Store secrets in environment variables
- Use health checks
- Configure resource limits
- Enable auto-scaling
2. Development¶
- Use feature branches
- Test locally with Docker
- Use staging environments
- Implement health endpoints
- Monitor logs
3. Performance¶
- Enable CDN for static assets
- Use connection pooling
- Implement caching
- Optimize build times
- Monitor metrics
4. Security¶
- Use managed databases
- Rotate secrets regularly
- Implement rate limiting
- Use private networking
- Keep dependencies updated
Documentation Structure¶
- App Platform Overview - This page
- Creating Apps - Deployment methods
- App Configuration - app.yaml reference
- Managing Apps - Operations and maintenance