DEV Community

Grégoire Paris for ManoMano Tech Team

Posted on

Feedback on sfCon 2022

This year, the SymfonyCon was even more magical than it usually is, as it took place in Disneyland Paris, thus contributing sparkles on top of the nice features announced during the keynote.

Did you know that Symfony currently has no less than roughly 200 components? At the SymfonyCon, 2 new components were announced, that should make it into Symfony 6.3:

  • Webhook: can be used to host a webhook, or call a webhook, typically with payment providers. Handles validity, security and signature checks.
  • RemoteEvent: used to represent events produced outside Symfony

Here is the diff if you want to deep-dive head first!

This is a big event, so there were no less than 4 tracks, which means I had to choose.

First, I went to see a conference about Sylius and learnings the main maintainer has gathered over the past few years.
He mentioned ADRs, which we do use at ManoMano, and which would certainly be useful to also use in an open source setup (Doctrine maybe?).

Next, I went to see Nicolas Grekas' talk about proxies: he presented different ways to implement a proxy system, and examples of each one that can be found in Symfony or Doctrine.
Doctrine has an old implementation in doctrine/common that we are trying to get rid off, and Nicolas has proposed to replace those with Lazy Ghost proxies.
I know, I know, funny name. 👻
Lazy ghost proxies cannot be used with final classes, or internal classes, but do allow to use a fluent API, which makes them a good fit for doctrine/orm entities.

If you know me, you know I literally cannot shut up about Git, so for my next choice, I picked "advanced git magic" by Pauline Vos.
The highlight was definitely this explanation about git bisect:
a slide with an egg-and-building-based metaphor

After lunch, I heard there was a talk by one of my Doctrine fellows, Claudio Zizza a.k.a SenseException, which I first met in person at that conference, so of course, I had to pick that one.
Main takeways:

  • Always clear your entity manager at the end of a business class to avoid nasty side effects with $entityManager->clear();
  • (Postgre)SQL is very powerful, for instance you don't necessarily need to resort to the nested set model to build a menu, you can use WITH RECURSIVE

Claudio and big Doctrine logo

That was followed by a frightening talk form Sebastian Bergmann (himself!), who gave us a presentation of PHP's supply chain, and how each part of that chain has been exploited in the past, in PHP or for other ecosystems.
Some of these vulnerabilities are so bad they have got their own website:

All the links above are safe to visit, I swear! That last one might require a bit more processing power though.

Sebastian told us about the concept of Software bill of materials a.k.a. SBOM, as a way for you to know your dependencies and if they are vulnerable. You can try ./phpunit.phar --sbom to see it in action (only available when using the PHAR though).

I had already seen Kevin Dunglas' talk about FrankenPHP at the "Forum PHP", which also took place at Disneyland the previous month (yes, really), but I decided to watch it again because of how packed with information it was.
FrankenPHP provides a new PHP SAPI, that comes with a worker mode, that behaves much like Swoole or Roadrunner.
Unlike php-fpm, it does not require a separate nginx container to run: it's built on top of the Caddy webserver, which is written in Go, and is also written in Go.
Thanks to Kévin, Caddy is capable of forwarding 1xx HTTP responses it receives from its upstream, which unlocks using 103 Early Hints in PHP, a status code that aims at providing the browser with the urls of CSS files, JS files and other resources it might need before even sending the final response.

Next, I went on a conference about the impostor syndrome, and one of the main takeaway was that it's so common and equally spread that we should rather call it impostor phenomenon. It's estimated to be have been experienced by 70% of people (and yes, that includes me). If you're unfamiliar with it, you can tell yourself that it is close to atychiphobia or kakorraphiophobia. Hope this helps.

That concluded the first day of conference. The 2 days were separated by a very nice evening with exclusive access to the Walt Disney Studios Park, which I must say is amazing, but I'll stop here because I don't want to make you jealous. But it was cool.

On the second day, I started with a conference about climate change and IT. As a staff engineer, I'm currently working on upgrading many of our microservices from PHP 7 to PHP 8, and I was glad to learn that PHP 8.1 is estimated to be 30% faster/less electricity-consuming than PHP 7.4.
There wasn't a similar figure to share about Symfony because it's harder to determine, but upgrading it is highly recommended as well.
I learnt that the carbon footprint can be evaluated in several scope, and that for an IT company like ManoMano, most of it is in Scope 3, which is all about the cloud, Scope 1 and 2 being about office heating and electricity. To lower
our impact, we should:

  • Upgrade our software
  • Optimize our apps (with a profiler)
  • Deploy to greener AWS regions: France, the Scandinavian peninsula (or Fennoscandia for geography nerds), the Netherlands.

This was very interesting, so I continued with a talk on the same theme: it was about computing carbon emissions in the cloud.
I learnt that "net zero" means the emissions of green house gases is equal to the removals, and that we are of course, very far from it, although it's a goal for 2050, that gets harder and harder to reach as time passes.
There is a formula to compute the carbon footprint of a VM. For each capacity, such as the CPU, storage, network, you have a matching emission factor expressed in watts, and a Power Usage Effectiveness that depends on the cloud provider you are using, which is a constant > 1 that is better the closest it is to 1. You then multiply that by the carbon intensity, that depends on the region where you are deploying, and is a factor that allows you to transform watts in CO2 emissions.

As the conference was getting closer to its end, I attended a talk about TDD.
The speaker dove into detail about TDD and gave us pointers about methods to do it properly, such as "fake it till you make it", which means you should write dummy code until you have written enough tests that force you to ditch your
initial, dummy implementation, or "triangulation", which consists in proving via tests that all parameters of a function are important, one by one.

Next we had a talk about automated upgrades by Tomáš Votruba, the author of Rector. He told us about tooling you can have in your projects to make it easier to upgrade. For instance, you can use so-called PHPStan collectors to measure type coverage, and ensure it only ever increases. Having type information is very important for static analysis, which Rector relies upon to understand your code and migrate it. Likewise, using PHP configuration instead of YAML configuration can help avoiding mistakes thanks to Static Analysis (which exists for PHP but not for YAML). He showed us a demo of using Rector in the CI to continuously upgrade the code.

The next talk I attended was by another fellow Doctrine maintainer: Alexander Turek. Alexander showed us strategies to modernize a legacy application with Symfony. It's possible for instance to introduce a global variable with the Symfony Kernel inside it to make Symfony services available inside the legacy application. That's called a micro rewrite because instead of migrating a full route to Symfony, you can migrate a service, deploy, rinse and repeat.
Something we might want to apply to our legacy ManoMano application?

The last talk I attended was by Mathieu Santostefano, a core team member. He presented the new AccessTokenAuthenticator shipped with Symfony 6.2, explaining how it had been waiting for other lower-level Symfony components to be ready over the years. Part of the talk was about the contribution process, and I remember a hilarious slide showing 2 contributors opening 2 pull requests about the very same thing (implementing that authenticator).

For the closing keynote, we had a light-hearted talk by Mickey Mouse himself presenting the evolution of Symfony over the past few months!

If this feedback piqued your interest, you can find many of the talks here:

SymfonyCon - Paris 2022 talks

  • All talks are in english.
  • You can send feedback and love to speakers on their twitter account
  • See all tweets during the event

Keynote

Slides
Video

By Fabien Potencier
github @fabpot
twitter @fabpot


From monolith to decoupled…wait, why is that one getting bigger?!?

Description
Monolithic apps are getting broken down left and right into dedicated services and teams, all under the banners of separating concerns, higher efficiency, and more. The strategy that is implemented will be crucial to ensure decoupling is a beacon of efficiency and not a migration nightmare

In this talk, we’ll discuss how decoupling following the strangler fig approach will seem counter-intuitive, as your monolith continues to grow alongside your new decoupled architecture. But this approach, when done right, makes dismantling a monolith a process that is structured and safe, slow but agile, and without major service interruptions or massive interface changes that…

Top comments (0)