Looking for a "cloud exiteer"?

You probably have heard about cloud engineers and what they do. In short they take your servers and put them in the (public) cloud using benefits that only the cloud can bring. These cloud providers belong to large corporations, such as Amazon, Google, Microsoft or even Oracle. What I expect to see become mainstream in the coming years is the role of “cloud exiteer” (a term cleverly coined by my friend Mark), which is exactly the opposite of a cloud engineer. Cloud exiteers are not working to bring a company “into the cloud”, but help them quickly move “away from the cloud”. The companies employing cloud exiteers strive for “cloud neutrality”, which means that they can effortless switch from one cloud provider to another. Note that “cloud neutrality” is a much stronger goal than “multi-cloud” which is not as clearly defined and brings less benefits. ...

February 22, 2023 · Maurits van der Schee

Zero downtime deployment in Apache

Whether you deploy using git push, rsync or even sftp you never want your site to be down or inconsistent during updates. If your site has high traffic you may not only do frequent updates, you may also have significant traffic during these updates. With “zero downtime” deployments you can assure that all traffic can keep flowing and that there is little chance that anyone notices your deployment. Naive approach: delete first A naive deployment of an Apache website may go like this: ...

February 1, 2023 · Maurits van der Schee

A Hugo static website is fast

A Hugo website can be extremely fast. As it loads no dynamic data most content can be served within milliseconds. Since Hugo can resize images on build you can ensure the image sizes are optimal. The static assets that make up a Hugo website can easily be distributed world-wide through a CDN allowing for low access time all around the world and scaling up to millions of concurrent visitors. Popular static site generators (SSGs): Hugo: A module-based static site generator with blazing fast performance. Jekyll: A blog-friendly static site generator that you can use with Github Pages. Gatsby: A whole suite of website-creation products along with static site generation Eleventy: This generator is perfect if you’re a fan of JavaScript and Node.js. Why use a static site generator (SSG)? Security: SSGs create content in versioned static assets that can be hosted without a database, reducing the attack vectors. Performance: There is no database to connect to and a the static assets can be served from a geographically local web server. Scale: By using a content delivery network (CDN) you can distribute the content world-wide allowing almost limitless scale. What we often don’t read: Design consistency: Clean separation between content and design. Ease of use: It has less options as it won’t let you modify the design. Hosting costs: A CDN will ensure low costs (even when your site is popular). When NOT to use a SGG: Member area: Visitors of the site need to login and manage profiles. Complex web shops: You want a web shop with logins and personalized discounts. Design changes: Your content editors want to change colors, fonts and layouts. Why choose Hugo? Popular: With 65k stars on Github it is the most popular SGG. Fast: A site build takes seconds, making it one of the fastest SGGs. Complete: Many features (such as image resizing) are included. Conclusion If your site is suitable to be a Hugo site you should definitely consider to use Hugo. It is popular and for a good reason: it has technical excellence. Your websites will be more secure and load faster. CDN deployments will make your site scale and make it fast anywhere in the world. If you need a good CMS to go with Hugo choose CloudCannon or (our own) UseCue CMS. ...

January 31, 2023 · Maurits van der Schee

The rock star programmer problem

Do you have a colleague that you look up to? That knows everything about the topic you would love to know more about? That always has an answer to any question you ask? Still you are not learning from this person, because this person is sitting on knowledge. Likes to do things alone. Never documents properly and is too busy to explain things, but complains about lack of help. Do you recognize this? It is the narcissistic programmer a.k.a. the rock-star programmer. ...

January 29, 2023 · Maurits van der Schee

Scaling 3 tier web development: 2 rules

Software development benefits from separating the presentation, business logic and data access. The concepts of “tiers” and “layers” in web development aid this separation. Within the application tier three layers can be identified. This blog proposes two rules to get a well-structured, more secure and more scalable application: (1) The data access layer and the presentation layer should be executed sequentially. (2) “Safe” requests should only read from the data access layer. This approach should be enforced by MVC web frameworks to guide developers towards better applications. ...

December 31, 2022 · Maurits van der Schee

Calling "ToList()" for LINQ performance

While I was doing AdventOfCode 2022 I ran into an issue that made my code run more than 30 times slower than I expected. I didn’t materialize the LINQ expression and I iterated over the sorted collection by position. To anyone understanding how LINQ does lazy evaluation this is an obvious error on my part, causing the sorting to be executed on every key access on the LINQ expression. Can you spot the bug? For anyone less familiar with LINQ the bug is hard to spot (especially in VB.net): ...

December 18, 2022 · Maurits van der Schee

A session locking test suite for PHP

Session locking is well explained by Mattias Geniar in his article “PHP Session Locking: How To Prevent Sessions Blocking in PHP requests” (please read that first). Now that you’ve done that you know what session locking is. My story is that I have once been bitten by this bug on a high traffic website while following best practices of a popular framework (CakePHP). I went on to do research and found that most major PHP frameworks (such as Symfony) do NOT lock sessions (while PHP natively does do this). ...

November 27, 2022 · Maurits van der Schee

PHPStan: Find bugs without writing tests

I’m not saying you shouldn’t write tests. But you may find bugs without writing tests using PHPStan. At least, that is what they claim on their website. I took a relatively big PHP project I run commercially to see whether or not PHPStan would help me to find and fix bugs. In this post I will explain how this works. Adding PHPStan config file You need to add a “phpstan.neon” configuration file to the root of your project. Mine looks like this: ...

November 15, 2022 · Maurits van der Schee

MintyPHP v3 is released

I use MintyPHP to quickly build web applications on the LAMP stack and I just released version 3 this month. Since v3 it relies solely on the composer generated autoloader, making the software faster and making it integrate even better with your IDE. Now the IDE can detect missing dependencies and can autocomplete the PHPunit tests. Also, since version 3 the config format has changed, allowing easier use of environment variables (via getenv) in the config files. ...

October 30, 2022 · Maurits van der Schee

Beelink "MINI S" N5095 under 200

I want my computers to be small, silent and repairable and use as little energy as needed, especially when idle. I recently bought a Beelink “MINI S” N5095/16GB/256GB computer with slots for both the DDR4 RAM and the M2 SATA drive. It has an external power supply and medium sized fan on a proper heat-sink. It can easily be used as a desktop replacement as it has a power efficient CPU, plenty of RAM and a fast SSD. The slot supports up to 16GB RAM and a 2TB M2 SATA SSD. Prices vary wildly (on AliExpress and Amazon) and if you search well you may find the 16GB/512GB model for less than 200 euro. ...

October 13, 2022 · Maurits van der Schee