Skip to main content
Full Stack Radio

120: Taylor Otwell - Serverless Laravel with Vapor

61 min episode · 2 min read
·

Episode

61 min

Read time

2 min

AI-Generated Summary

Key Takeaways

  • Serverless Database Setup: Start with a $15/month RDS MySQL instance that can host multiple databases for different projects. Use DynamoDB as a free cache option instead of ElastiCache to avoid additional monthly costs. This setup provides managed backups and automatic updates without manual server maintenance.
  • Cold Boot Mitigation: Vapor uses concurrent warming by sending 10 simultaneous HTTP requests every five minutes to keep Lambda instances hot. AWS reduced VPC cold boots from 10 seconds to under 1 second recently, with plans to eliminate the penalty entirely in 2019, making private database connections faster.
  • Queue Concurrency Management: Set maximum queue concurrency below your database connection limit to prevent overload. A small RDS instance supports 100 connections, while larger instances handle 600+. Consider using DynamoDB for high-traffic endpoints to avoid MySQL connection limits, then process records asynchronously through queues.
  • Performance Optimization: Custom PHP runtimes with FPM and opcache reduced Lambda response times from 40ms to 5-6ms for basic Laravel requests. Configure web layer at 1GB RAM and queue layer at 512MB RAM. Since billing occurs in 100ms increments, lower memory settings save money without crossing billing thresholds.
  • Direct S3 Uploads: Stream files directly from frontend to S3 using pre-signed URLs instead of uploading through web servers. Vapor provides a hidden route that generates secure upload URLs and an NPM package with vapor.store method. This approach prevents security vulnerabilities and reduces web server RAM usage.

What It Covers

Taylor Otwell introduces Laravel Vapor, a serverless deployment platform for Laravel applications on AWS Lambda. The discussion covers serverless architecture, cold boot optimization, database configuration, queue management, file uploads, and cost comparisons with traditional VPS hosting.

Key Questions Answered

  • Serverless Database Setup: Start with a $15/month RDS MySQL instance that can host multiple databases for different projects. Use DynamoDB as a free cache option instead of ElastiCache to avoid additional monthly costs. This setup provides managed backups and automatic updates without manual server maintenance.
  • Cold Boot Mitigation: Vapor uses concurrent warming by sending 10 simultaneous HTTP requests every five minutes to keep Lambda instances hot. AWS reduced VPC cold boots from 10 seconds to under 1 second recently, with plans to eliminate the penalty entirely in 2019, making private database connections faster.
  • Queue Concurrency Management: Set maximum queue concurrency below your database connection limit to prevent overload. A small RDS instance supports 100 connections, while larger instances handle 600+. Consider using DynamoDB for high-traffic endpoints to avoid MySQL connection limits, then process records asynchronously through queues.
  • Performance Optimization: Custom PHP runtimes with FPM and opcache reduced Lambda response times from 40ms to 5-6ms for basic Laravel requests. Configure web layer at 1GB RAM and queue layer at 512MB RAM. Since billing occurs in 100ms increments, lower memory settings save money without crossing billing thresholds.
  • Direct S3 Uploads: Stream files directly from frontend to S3 using pre-signed URLs instead of uploading through web servers. Vapor provides a hidden route that generates secure upload URLs and an NPM package with vapor.store method. This approach prevents security vulnerabilities and reduces web server RAM usage.

Notable Moment

Otwell reveals that Laravel Forge runs on a single 4GB DigitalOcean server with CPU utilization typically under 10 percent, despite generating seven figures annually. This demonstrates how most Laravel applications are drastically overprovisioned, wasting resources on infrastructure capacity they never actually use in production environments.

Know someone who'd find this useful?

You just read a 3-minute summary of a 58-minute episode.

Get Full Stack Radio summarized like this every Monday — plus up to 2 more podcasts, free.

Pick Your Podcasts — Free

Keep Reading

More from Full Stack Radio

We summarize every new episode. Want them in your inbox?

Similar Episodes

Related episodes from other podcasts

This podcast is featured in Best Cybersecurity Podcasts (2026) — ranked and reviewed with AI summaries.

You're clearly into Full Stack Radio.

Every Monday, we deliver AI summaries of the latest episodes from Full Stack Radio and 192+ other podcasts. Free for up to 3 shows.

Start My Monday Digest

No credit card · Unsubscribe anytime