PHP at Scale #16
Welcome to the sixteenth edition of PHP at Scale. I am diving deep into the principles, best practices and practical lessons learned from scaling PHP projects — not only performance-wise but also code quality and maintainability.
🎄Christmas is here, and as usual, it’s quite busy for most of us. So, with this edition, I would like to wish you all a Merry Christmas and a Happy New Year.
—
In the last edition, I already mentioned the Cloudflare downtime on 18th November, but they had yet another one on the 5th of December. This article describes their idea of how to improve and prevent future downtimes. There is no better way to learn than learning from the mistakes someone else made. And in the case of such big and well-developed companies as Cloudflare, the knowledge you get for free is invaluable.
Watch Out Elasticsearch! Tiger Data’s PostgreSQL BM25 Search Extension Goes Open Source
Quite a specific topic, not everyone will be interested in. In my case, I honestly regret adding Elasticsearch to one of our previous projects. The project did not gain much traction, and although it generates revenue, the scale is not large enough to justify the use of Elasticsearch. It works great, but is also very heavy on resources. Such an extension is quite handy in many projects, but it also comes with some limitations - for this particular project, it would provide no easy support for the Polish language. Of course, this extension is limited in features compared to ES, but I think most of the projects don’t need those missing features. In the meantime, we are now testing https://manticoresearch.com/ to see if it would be a good solution in this project.
Lines tool
Small, limited use, but still fun to use and interesting to work with to check the results. Within minutes, I was able to check our projects to see if the developers really use the features of newer versions. You can also monitor how the feature adoption changes in time after doing an upgrade (but you need to store the numbers yourself, or just checkout to a past commit).
A “new” (recently released v1) tool on the market. It allows to lint, format, and perform static analysis of PHP code. The tool itself is written in Rust with parallel pipelines, allowing it to achieve exceptional performance. So far, I have run it locally on some of the projects, and indeed, it’s fast! 300k lines of code project was linted in less than 1s. Analysing a 100k-line project was done within 10s.
Not yet the time for me to add it to our CI/CD pipelines, but I will definitely play a bit more with it.
Simulating Сoncurrent Requests: How We Achieved High-Performance HTTP in PHP Without Threads
Quite an interesting read on how Manychat scaled their architecture. They mixed a couple of interesting solutions that might come in handy in some projects. Yes, the Lua approach that does push tasks directly to a queue is very specific and raises the complexity, but it seems like a great performance tweak. Definitely a great source of optimisation ideas!
MCP joins the Linux Foundation
I’ve already mentioned before, and I believe this is something truly worth investing in nowadays. We have actually already been making use of our own MCP servers for a couple of months now. It is great to see that Anthropic has donated MCP to the Linux Foundation (Agentic AI Foundation to be thorough). I look forward to more MCP adoption both as servers in the tools I use, but also in other LLM models.
—
Closing, a small tip for all of us:
Why is this newsletter for me?
If you are passionate about well-crafted software products and despise poor software design, this newsletter is for you! With a focus on mature PHP usage, best practices, and effective tools, you'll gain valuable insights and techniques to enhance your PHP projects and keep your skills up to date.
I hope this edition of PHP at Scale is informative and inspiring. I aim to provide the tools and knowledge you need to excel in your PHP development journey. As always, I welcome your feedback and suggestions for future topics. Stay tuned for more insights, tips, and best practices in our upcoming issues.
May thy software be mature!





