MintyPHP now on packagist!

I have created MintyPHP (formerly known as MindaPHP) to quickly build web applications on the LAMP stack. After using MintyPHP in production for 5 years (this site is created with it) this web framework is (finally) available on packagist! This means that updates will now go automatic with composer. The project is now divided in 4 packages with “MintyPHP” as the main package and 3 dependencies: “core”, “tools” and “debugger”. WARNING! MintyPHP claims to be “refreshingly different”, but for some people this is “a bit quirky” or even “completely wrong”. It is a web framework with a different approach than other frameworks (such as Laravel, Symfony or Slim). In this post I will try to explain what it does different and why you may like that it does. ...

October 26, 2018 · Maurits van der Schee

Deploy with Git: push to production

When you are building applications or websites in PHP, Ruby, Python or any other scripting language then you may still be using FTP to deploy to production. Please don’t! When you have SSH access to your production server (for instance when running on a VPS), then you may use Git to automatically deploy your software. We will setup your production server as a Git remote so that you can type “git push production” to deploy the latest version of your code to production. This post will show you the steps to take to achieve this. ...

October 22, 2018 · Maurits van der Schee

Microservice vs. dataservice architecture

All product companies have monoliths. They have many advantages, but they fail when scaling up and out. Most companies are moving to microservices. But microservices fail to protect data quality. The solution is the dataservice architecture as described in this article. Monolith architecture fails to formalize responsibilities and limit dependencies between software teams. Microservice architecture fails to ensure data quality as transactions and consistency checks are absent. Dataservice architecture will solve both issues. ...

October 17, 2018 · Maurits van der Schee

PHP-CRUD-API version 2 released

Yesterday I released version 2 of PHP-CRUD-API, the TreeQL reference implementation in a single PHP file. About 6 months ago I wrote about my progress on version 2. I was expecting it would take me about 2 months until I could release a final version 2. It took 6 months and I created 8 beta releases in the process. I’m very thankful to the people that were trying these beta versions out and for the issue reports that I have received. ...

October 14, 2018 · Maurits van der Schee

TreeQL vs. GraphQL

Many people compare GraphQL to REST and come to the conclusion that both have their strengths. In this post I argue that you can have the best of both worlds by using TreeQL, an improved REST protocol. Downsides of GraphQL According to Stubailo and Doerrfeld the downsides of GraphQL (compared to REST) are: It’s results can’t be cached using HTTP caching. It has limited endpoint security enforcement. It doesn’t have as many tools yet. That last point is fortunately changing fast, as GraphQL adoption is rising. ...

October 4, 2018 · Maurits van der Schee

GopherCon 2018: videos online

GopherCon is the original Go conference. It debuted in 2014 and is now celebrating it’s five-year anniversary. Like every year it was held in the Colorado Convention Center in Denver and it had about 1500 attendees. The videos are posted on the Gopher Academy Youtube channel and are also linked here: Tuesday August 28 9:00 Welcome Gophers Kavya Joshi - The Scheduler Saga [30:48] Tess Rinearson - An Over Engineering Disaster with Macaroons [23:48] 10:05 Morning Break ...

September 14, 2018 · Maurits van der Schee

Java's synchronized block in PHP

In Java the “synchronized” block may help to make implementations “thread safe”. PHP does not have this language construct, but with the help from “flock” (file lock) and it’s “LOCK_EX” (exclusive lock), we can implement this behavior ourselves. This is useful because web servers run multiple threads/processes to execute PHP and these may read/write from the same files. In yesterday’s post we presented a lock-less solution, today we further explore the possible uses of “flock”. ...

September 10, 2018 · Maurits van der Schee

A locking file cache in PHP

The functions “file_get_contents” and “file_put_contents” can be used to implement a file based cache in PHP. Unfortunately the read function is missing a critical feature: support for file locking. Without file locking the function reading the contents may return an empty string (or partial cache content) while the content is being written. Shared and exclusive locks explained If you run the following writer script: <?php // write.php $filename = sys_get_temp_dir().'/test.txt'; $string = 'test'; $file = fopen($filename, 'w'); $lock = flock($file, LOCK_EX); sleep(10); file_put_contents($filename, $string); flock($file, LOCK_UN); fclose($file); And in another tab (at the same time) this reader script: ...

September 9, 2018 · Maurits van der Schee

GopherCon Singapore 2018: videos online

GopherCon Singapore is the largest Go programming language conference in Southeast Asia. In 2018 the conference day was on May 4th at the Marina Bay Sands Expo & Convention Centre in Singapore. You can find the videos on the YouTube playlist and also linked here: 09:00 Welcome address Russ Cox - Opening keynote: Go with Versions [40:50] Elissa Lim - Project-driven journey to learning Go [17:33] 10:20 Tea break Rajeev N Bharshetty - Resiliency in Distributed Systems [23:32] Hana Kim - Understanding Running Go Programs [23:24] Stephen Kruger - Go for Grab [30:37] 12:30 Lunch ...

September 8, 2018 · Maurits van der Schee

Go Northwest 2018: videos online

Go Northwest is single day, community driven conference devoted to the Go programming language. It was the first time this event was organized. It was held in Seattle on July 30, 2018 at McCaw Hall in the Seattle Center. It had an attendance from 280 software developers who write in Go and there were 14 speakers and 3 sponsors. You can find the videos on the YouTube channel and also linked here: ...

September 7, 2018 · Maurits van der Schee