Trifork Blog

Posts by Frans Flippo

A wrinkle in time

June 30th, 2015 by
(http://blog.trifork.com/2015/06/30/a-wrinkle-in-time/)

Leap second

I clearly remember the morning of Sunday July 1, 2012, almost three years ago. I was at church, actually, when I got a call from one of our clients: “The website doesn’t seem to be working.” All I could check at that point was that, indeed, the website was not responding. So I called our sysadmin, who found that even SSH-ing into the machine running the site was taking much longer than usual. Finally, restarting everything solved the problem, but we were still unsure about what had happened.

As we found out later, it was related to the leap second, a phenomenon I had not even heard of until then. Read the rest of this entry »

Dealing with NodeNotAvailableExceptions in Elasticsearch

April 8th, 2015 by
(http://blog.trifork.com/2015/04/08/dealing-with-nodenotavailableexceptions-in-elasticsearch/)

tl;dr

Elasticsearch provides distributed search with minimal setup and configuration. Now the nice thing about it is that, most of the time, you don’t need to be particularly concerned about how it does what it does. You give it some parameters – “I want 3 nodes”, “I want 3 shards”, “I want every shard to be replicated so it’s on at least two nodes”, and Elasticsearch figures out how to move stuff around so you get the situation you asked for. If a node becomes unreachable, Elasticsearch tries to keep things going, and when the lost node appears and rejoins, the administration is updated so everything is hunky-dory again.

The problem is when things don’t work the way you expect…

Computer says “no node available”

Read the rest of this entry »

Active cache eviction with Ehcache and Spring Framework

February 9th, 2015 by
(http://blog.trifork.com/2015/02/09/active-cache-eviction-with-ehcache-and-spring-framework/)

Caching is an essential to the majority of web applications. Let’s face it: most of the work done in an average web application (especially public ones) is repetitive, either the same user requesting the same information multiple times, or multiple users requesting the same information. The question is always: “How long do I cache”?

We just finished building the new website for a well-known Dutch newspaper. The old website had a 15 minute TTL cache and we knew that wasn’t going to cut it in the new website. Visitors want to see new articles and updates to articles the minute they’re published, not 15 minutes later. Therefore, we developed a scalable caching mechanism with active, fine-grained cache invalidation using just EhCache along with Java and Spring concepts you’re probably already familiar with. The solution we developed works in a distributed environment without the need for expensive distributed cache solutions.

In this blog post I’ll describe how we did it.

The setup

Our website shows lists of articles. Only the title and a summary are shown. Clicking on the article will retrieve and display the full article. Articles can contain pictures. The first picture is used as the headline picture, and is shown with the article summary in article lists. Read the rest of this entry »

My Goto Amsterdam 2014

July 17th, 2014 by
(http://blog.trifork.com/2014/07/17/my-goto-amsterdam-2014/)

Trifork Logo

People who have worked with me know I’m a bit of a technical conservative. I’m very wary of quickly adopting the latest fads and trends because I’ve seen the collective hype and the following disillusionment too many times, including software being built with the then-latest-hype framework or platform and a year later being stuck with now-obsolete technology that only the original developers and a handful of other people still have any real experience with.

For the same reason I’ve avoided software tech conferences in the past years. A few visits to conferences several years ago on each occasion left me with feeling that I’d heard a lot about a lot, but that it wasn’t really going to improve my daily software development work.

Luckily, Goto Amsterdam 2014 was different.

Many, if not all, of the talks were relevant to my actual, day to day, software development job. I learned about looking at Agile in a different way. I heard people speak on real life problems being solved with actual, current, widely adopted technology. I even listened to talks that weren’t really that much about software development at all.

So let me walk you through my Goto Friday.

Read the rest of this entry »

Supporting IE10 on a Rich Internet Application with Vaadin – the Vaadin 7 migration

November 12th, 2013 by
(http://blog.trifork.com/2013/11/12/supporting-ie10-on-a-rich-internet-application-with-vaadin-the-vaadin-7-migration/)

Amidst the popularity of JavaScript-CSS frameworks like Bootstrap and Angular.js, Java developers like myself are still most comfortable with what we know – Java code. Vaadin provides a framework for Java developers to write rich internet applications that are highly interactive while usually not having to write a line of Javascript code. It builds on top of GWT, taking care of synchronizing server state with client state, which means that most of the time all you have to deal with is Java code — not Java code that’s compiled to JavaScript; real, server-side Java code.

At Trifork we especially like Vaadin because it integrates very nicely into the Liferay portal. This means you can write highly interactive portlets using Vaadin and deploy them to Liferay. My colleague David described this in detail last year in a different blog post.

Read the rest of this entry »

Checking return values in Java

July 2nd, 2013 by
(http://blog.trifork.com/2013/07/02/checking-return-values-in-java/)

The other day I made a stupid coding error. It took me the better part of an hour to track it down. We all have those moments. Blame it on a bad night’s sleep, a brain fart, or perhaps the fact that your colleague at the next desk has been whistling that tune from Gotye’s “Somebody I used to know” (you know the one) all day, completely driving you crazy and taking your focus off your code.
Read the rest of this entry »