Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building, testing and scaling Laravel APIs effectively.

Building, testing and scaling Laravel APIs effectively.

The building, testing, and scaling of APIs in Laravel is not as simple as it seems. Should you use Laravel or Lumen? How should you authenticate the API? How should you test, deploy and scale your API? CI or not? Performance testing? This talk aims at answering all these questions. How and why to use Laravel and not Lumen, how to modify pieces of Laravel effectively for APIs, how to improve API performance and scale with increased traffic.

Kati Frantz

November 16, 2019
Tweet

More Decks by Kati Frantz

Other Decks in Programming

Transcript

  1. Lumen tradeoffs Developer experience - Lack of many artisan commands

    Auth features - No password resets / registration / login App features - Notifications / Broadcasts / Scheduling Community support - Packages / Resources / Tutorials
  2. Graphql vs Rest Network performance Complex systems / Microservices Learning

    curve Web caching / File uploads Laravel features
  3. Cleanup Laravel for APIs Remove all cookies / session related

    middleware Remove unused providers and aliases Cleanup unused routes Cleanup dead code / files
  4. Testing TDD all the things More and more integration tests

    Unit tests for models and helpers Leverage laravel testing helpers (assertCreated, assertJson, assertJsonStructure, assertJsonFragment, postJson etc etc)
  5. Deployment Don’t use shared hosting Use Laravel forge / Cloudways

    / Runcloud Use Amazon RDS / Aurora / Google Cloud SQL Use a CI / CD pipeline.
  6. Scaling Use a load balancers with multiple servers Go serverless

    with Laravel Vapor Dockerise all the things