Advertisement
Advertisement

More Related Content

Similar to ZgPHP 97 - Microservice architecture in Laravel(20)

Advertisement

ZgPHP 97 - Microservice architecture in Laravel

  1. ZgPHP #97 Luka Vavetić and Frano Šašvari: Microservice architecture in Laravel www.typeqast.com
  2. ZgPHP #97 Luka Vavetić and Frano Šašvari: Microservice architecture in Laravel
  3. ABOUT US • Luka, PHP developer • Frano, PHP developer
  4. ABOUT PROJECTS • Backend: PHP (Laravel framework, Doctrine ORM) • Database: MySQL • Other: SOAP, RabbitMQ, Docker, Postman… • Testing: Unit, Integration
  5. TOPICS RPC STYLE API RABBITMQ VALIDATION HISTORY TESTS
  6. RPC STYLE API • RPC - Remote Procedure Call • JSON body • Why RPC? • Not for everything (CRUDs?) • Depends on business logic
  7. RPC STYLE API REST RPC • users (GET) • users/1 (GET) • users (POST) • users/1 (PUT/PATCH) • users/1 (DELETE) • users.list (GET) • users.info (GET) • users.create (POST) • users.update (POST) • users.delete (POST)
  8. RPC STYLE API REST RPC • users/registration (POST) OR • users (POST) OR • registration (POST) • users.registration (POST) • users/1/teams/2 (POST) • users/1/channels/2 (DELETE) • teams.addUser (POST) • channels.leave (POST)
  9. RABBITMQ • Message broker • Glue in microservice arhitecture • Publisher/Subscriber
  10. RABBITMQ
  11. RABBITMQ SENDER
  12. RABBITMQ CONSUMER
  13. VALIDATION • Laravel’s Validation was not enough • Why not use Laravel’s FormRequest? • Custom Validation with error codes needed • How to handle Validation exceptions? • Better and more strict communication between other APIs and frontend APPs
  14. HISTORY • Watch changes on important Entities • Package? Doctrine Loggable • Rollback option with versioning
  15. TESTS • Unit Tests • Integration Tests
  16. THANK YOU Drop us a line: • frano.sasvari@typeqast.com • luka.vavetic@typeqast.com Questions?
Advertisement