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.

Db8cae6201e0cf535406e6c78e603ede?s=128

Kati Frantz

November 16, 2019
Tweet

Transcript

  1. Building, testing and scaling Laravel APIs effectively. Kati Frantz

  2. @bahdcoder Udemy Instructor ‍ Software Engineer Mentor / Career strategist

    Ex Andelan Creator nesabox.com Kati Frantz
  3. LARAVEL OR LUMEN ?

  4. 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
  5. Use Laravel

  6. REST OR GRAPHQL ?

  7. Graphql vs Rest Network performance Complex systems / Microservices Learning

    curve Web caching / File uploads Laravel features
  8. Use REST

  9. Cleanup Laravel for APIs Remove all cookies / session related

    middleware Remove unused providers and aliases Cleanup unused routes Cleanup dead code / files
  10. Authentication Default token guard JWT Authentication Laravel Passport

  11. 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)
  12. Deployment Don’t use shared hosting Use Laravel forge / Cloudways

    / Runcloud Use Amazon RDS / Aurora / Google Cloud SQL Use a CI / CD pipeline.
  13. Performance and Monitoring Benchmark with Apache’s AB Analyse with blackfire.io

    Use papertrail Use Laravel’s inbuilt reporter
  14. Scaling Use a load balancers with multiple servers Go serverless

    with Laravel Vapor Dockerise all the things
  15. Thank you.