Client side rendering is a lie

We currently see that MVVM frameworks like Angular and React are booming in popularity. Not taking anything for granted, I was wondering last week: does “Client side rendering for scalability” even make sense? Is it a beneficial to send JSON over the wire and render it on the client? Does that lower the load on the server, compared to rendering the HTML? How expensive is the HTML templating? Is it more expensive to generate HTML than to generate the JSON it is based on? My feeling says it does, but is it true and how much does it matter? ...

June 27, 2017 · Maurits van der Schee

Xubuntu with Gedit, Nautilus and Plank

I’m using Xubuntu (Ubuntu with XFCE) as my primary operating system, because it is ridiculously fast on my NVMe SSD powered Intel NUC i7. By default Xubuntu comes with “Thunar” installed as it’s file manager and “Mousepad” as the default text editor. Mousepad is very limited in features and Thunar has some stability issues. Reasons to replace them with the older (Gnome 2 era) tools “Gedit” and “Nautilus”. Unfortunately in Xubuntu 16.04 these application have been changed beyond recognition with added buttons to the title bars and a removed main menu. Luckily some people forked the old Gedit and Nautilus and made them available under the new names “Nemo” and “Pluma”. ...

June 7, 2017 · Maurits van der Schee

Optimistic and pessimistic locking

One of the most misunderstood topics in software development is most likely concurrency. There are three kinds of operations on data rows: reads, blind (full) writes and dependent (or partial) writes. In a high concurrency web application you typically do not need to lock for the first kind. Only need to lock the write operation itself in the second case and you need to lock the row for the entire duration between read and write in the third case. ...

May 29, 2017 · Maurits van der Schee

Dash to Panel for Ubuntu Gnome

We have heard months ago that Ubuntu is stopping with Unity and switching to Gnome 3. I’m happy about this as I could never get used to Unity. For a long time I used Xubuntu, which offered a Gnome 2 like experience with the light-weight XFCE window manager. In order to get used what life will be with Gnome 3 I downloaded Ubuntu Gnome. It has a 16.04 and a 17.04 release and I conservatively chose the 16.04 release. ...

May 28, 2017 · Maurits van der Schee

ASP.net FormsAuthentication in Go

If you are currently developing a monolithic ASP.net legacy system you are probably dreaming about migrating all functionality step-by-step to a modern micro-service design with cheap Linux servers running Go. If you aren’t, then you should! But in order to do this super-stealth (without your boss finding out) you need to do this one API call at a time. Sounds easy.. if only… you were able to read ASP.net’s proprietary encrypted (secure) cookies. Well, I’ve got good news for you: Now you can! ...

April 27, 2017 · Maurits van der Schee

Implementing cache invalidation is wrong

There, I’ve said it! Again! It is my firm belief that it is. Instead of arguing why this is true I will try to negate the argument I hear most often from people arguing otherwise. In this post I am talking about a primary (data) store and a cache. It may help to think about a cache as a Redis or Memcache instance used by a web server and about the primary data store as a relational database server (MariaDB for instance). ...

April 18, 2017 · Maurits van der Schee

A lesspass implementation in Python

Lesspass is a password manager without a database. Although I’m not 100% sure that it is secure, I am 100% sure that passwords are a problem that needs to be solved. Lesspass allows you to generate a password from a site name and a master password with certain characteristics. To do so it applies a 100000 iteration pbkdf2 algorithm using a SHA256 hash. It sounds good to me and I like the way that that is supposed to work. ...

March 30, 2017 · Maurits van der Schee

A lesspass implementation in PHP

I like the idea of lesspass, a password manager without a database. I’m not 100% sure that it is secure, but I am 100% sure that passwords are a problem and that we need to solve it. This system allows you to generate a password from a site name and a master password with certain characteristics. To do so it applies a 100000 iteration pbkdf2 algorithm using a SHA256 hash. It sounds good to me and I like the way that that is supposed to work. ...

March 28, 2017 · Maurits van der Schee

Converting JSON to XML in JavaScript and PHP

In order to support databases that are better at XML than JSON (Yes, I am talking about you SQL Server) I created some code that allows you to convert (lossless) from JSON to XML (and back). Example JSON data: { "depth": false, "model": "TRX-120", "width": 100, "test": [ { "me": null }, 2.5 ], "height": null } XML data: <root type="object"> <depth type="boolean">false</depth> <model type="string">TRX-120</model> <width type="number">100</width> <test type="array"> <item type="object"> <me type="null"/> </item> <item type="number">2.5</item> </test> <height type="null"/> </root> The functions ’json2xml’ and ‘xml2json’ convert from JSON to XML and back. ...

February 22, 2017 · Maurits van der Schee

RESTful incrementing using PATCH

How should a RESTful JSON-based API handle counters (atomic increments)? In this post I’ll try to describe the considerations and do an implementation suggestion using the “PATCH” HTTP method. Atomic increments When counting events, such as people visiting a web page, it may be cheaper to increment a counter than to insert a log record. But when dealing with many increments per second you cannot simply read a value in one call and then write the incremented value back in the next call. The concurrent updates would cause issues and increments would get lost. This is the problem I am trying to solve. ...

February 3, 2017 · Maurits van der Schee