Hoy continuamos con el segundo, y último, día de charlas.
Mathias Noback nos explica su modelo de «capas» sobre arquitectura hexagonal. Lorna nos enseñará a trabajar de forma segura con Webhooks, Enrico hablará sobre como monitorizar microservicios de forma eficiente y Théo Fidry nos expicará como realizar test mutantes para tener todas los frentes cubiertos.
Advanced Web Application Architecture
In this talk I’ll explain how to make a clean separation between your own business logic and the code that makes your application’s use cases available to the world outside. We’ll discuss architectural concepts like «layers» and «ports & adapters», and how applying them will make your application flexible enough to deal with a constantly changing environment.https://php.barcelona/talk/126710f0-796a-46af-a2f8-2e56e0503042/questions
- Single responsibiliy principle for achitecture.
- Not too many groups (Domain vs Infrastructure)
- Note: Application inside domain
- Introduce layers
- Web framework
- Domain logic
- Database integration
- Define ports and adapters (Hexagonal architecture)
- Determine actors
- Distinction between the intention and the implementation.
- Advantages: Migrations, replacement, postpone vendor choices…
Working with Webhooks
Lorna Mitchell – Nexmo
This session covers the basic theory of webhooks and shows some examples of how to handle them in your own applications. We’ll also talk about when webhooks are a helpful design choice, and some pitfalls to look out for when you’re working with them!https://php.barcelona/talk/c947707e-1b07-4675-88c7-882024b185f9/questions
Webhook use cases:
- Notify of events
- Deliver data when available
- Broadcast to multiple receivers as-it-happens.
- Do: accept, store and acknowledge quickly.
- Don’t: Process before acknowledging.
- Use queues. They protect you against bursty traffic and allow separate work from webservers.
Supercharge your apps with ReactPHP & PHP-PM
Albert Casademont – Noustique
Prepare yourself to dive into the lifecycle of a PHP request (compilation, opcode generation, memory allocation, execution, IO…) and to understand why there’s not much more room for performance improvements using the current stacks. We will also discuss the pros and cons of the ReactPHP + PHP-PM approach using a Symfony 4 app as an example, including developer experience and deployment options with containers.https://php.barcelona/talk/d0b096c3-6368-4aac-9e96-f3f17730fb3e/questions
- No globals variables.
- Async I/O.
- Careful with state (Doctrine!).
- No more var_dumps(), because the output will be in console, not in the Response.
- Code changes need a reload. Because the loop still be running (Long-time process).
- Dx is worse
It’s all about the goto
In this presentation, I am showing you some of the inner workings of PHP. We are going to look at how different language keywords and constructs are handled internally. Basically, everything is converted to goto, but the how and why, is not as simple as it seems! We’ll also have a look at what sort of optimisations opcache does to make your code run faster.https://php.barcelona/talk/fb93240c-399a-4550-b533-99fc330aee5d/questions
Develop microservices in PHP
Enrico Zimuel – Elastic
In this talk I’ll present how to develop microservices in PHP using Expressive framework + Swoole extension, to run PHP as HTTP server from the command line.https://php.barcelona/talk/b5cf72d5-7e19-4839-aced-40ddb70cdc98/questions
- Separation of concerns
- Horizontally scaling
- Workload partitioning
- Service latency (Docker, Kubernetes, etc…)
- New architecture challenges
- Everything needs to be automated
To handle errores between services can use a standard «application/problem+json» -> https://symfonycasts.com/screencast/rest/application-problem
- Loggin: aggregation.
- Monitoring: telemetry, metrics.
- debugging: APM, distributed tracing.
Workshop exercise: https://github.com/ezimuel/php-microservices-workshop
Mutation Testing – Better code by making bugs
How do you know you added enough tests to capture the behaviour of an untested application in order to refactor it safely?https://php.barcelona/talk/f9cec7f1-90be-4e70-9a85-0109ec9bd9ba/questions
Discover Mutation Testing, a fun tool to make your code better by introducing bugs.
- How do i safely refactor my test?
- How do i know i can trust a test suite?
- How do i ensure y team is writing test?
Nuclear powered software security
In this talk I’m going to show you how this level of safety is achieved, what happens when it goes wrong and then see what lessons we, as PHP developers, can learn from it to help us secure our applications from meltdownhttps://php.barcelona/talk/f1c388ab-83b6-405b-8599-1dba0e7ae39a/questions
Coming back to the monolith
This talk will explain architecture problems suffered at Ulabox, taking into account factors like team size or enterprise objectives, and which is our proposal to evolve our architecture.https://php.barcelona/talk/7605c1c1-3de5-4ed3-8bb7-d71332b2add4/questions