Technight: MijnOverheid

Bas Kooij

  • 26/04/2017
  • 2 minuten leestijd
Bas Kooij

Technight: MijnOverheid

It’s that Wednesday of the month again, april 19th to be exact, another Technight meetup by Developers.nl. Speaker this night is Leon van der Ree, an architect and PHP programmer for the MijnOverheid website, mijn.overheid.nl. MijnOverheid is a one-stop website for Dutch citizens for all matters concerning the government.

Chinese food

After some wrong turns, an open bridge and searching for a parking space I arrive at the Puntegaalstraat, the Developers.nl office. As always, I am one of the last people (the last?) to walk into the room, I’ll never learn. I am greeted by about 30 people and the smell of Chinese food. It’s nice to see that quite a lot of people who do not work for Developers.nl have come to attend the meetup. Some old and current colleagues, people interested in the website and other techies who found us through the Google Meetup site. After a few bites of my plate full of Chinese food the meeting starts, I’ll have to finish it during the start of the meeting.

Architecture

No English speakers tonight, so Leon starts the meeting in Dutch. He opens by explaining about the general architecture of the website. During the meeting we’ll get back to this picture a couple of times to go into some more details. The main difficulties for this website are the number of visitors during peak hours, and the fact that very little content can be cached. Leon says they manage to keep the server response under 200ms, which is a very nice figure for this amount of dynamic content. We quickly dive into the main technologies and programming practices for the site to explain how this is accomplished.

Technologies

The site is built on top the PHP Symfony framework. As most current (PHP) applications it makes heavy use of dependency injection. Nothing new there. The interesting part comes when Leon talks about their application of command queuing. They use a command bus to fire the requests, including the ones from the controllers. The commands can pass through different kinds of middleware which are responsible (among other things) for cache, logging, queues and finally, handling the request. The use of a command bus allows them to process the request in a manner which is decoupled from the usual request-response cycle. If a command takes too long to complete they can even inform the user about this and ask him to return whenever the command is finished executing. At this point, we return to the architecture picture and code examples a couple of times to explain in detail how this is achieved in hardware and code. Gearman is used to offload the processing to different machines. React for PHP is a framework for promises which is used to work with asynchronous request-response cycles in the PHP code. Most data is retrieved from external web services. The commands, and their results are stored in a [Redis}(https://redis.io/ ) database.

Discussion and beer

After the explanation about the command bus and the workings of promises, there were quite a few questions raised. It was great to see people taking an interest and asking some good questions. More discussions were held about the team, release cycles, code analysis using New Relic, log files, audit trails and testing. If Jasper hadn’t stopped us we might still be there now. Lots of people stuck around after the presentation for a beer and some snacks. Leon was there to answer some more questions, colleagues talked about their new assignments and we met some new people. All in all, another nice meetup. Thanks again to Leon for the talk, and all the people attending and actively participating. See you all next time!