December 27, 2015

Destructuring Assignment in ECMAScript 2015

This blog post is about an interesting new feature that ECMAScript 2015 brings along. In my opinion it is really great to use, because it makes code easier to read and simplifies a lot of tasks that are usually harder to achieve.

Destructuring assignment was introduced in ECMAScript 2015. This expression allows you to get data from an object or array by mirroring the creation of an object or array. It therefore gives you the possibility to work with parts of objects using simpler and clearer syntax. You can work with all kinds of objects, such as simple objects which consist of primitive values or more complex, nested objects.

In the following sections, I will provide you with examples to all the possibilites how to use the destructuring assignment, which will make understanding the feature much easier. The list of all the possibilites is taken from the ES2015 compatibility table [1].

December 09, 2015

Achieving Efficient Effort Estimation in Software Development

Effort estimation is an essential part of software development. It is important to the developers themselves, but mostly to the project owners who establish and maintain the project schedules in order to ensure cost efficiency. To tackle this challenge, several techniques have been established to arrive at the most accurate estimates for achieving specific tasks within a sprint.
To fully understand these methods, first consider the following points:

  1. Solid effort estimation entails fully understanding the task on hand - otherwise you won’t be able to come up with an accurate estimate.
  2. Once everything is clear, it is crucial to split the task into smaller pieces and create a model (i.e. a mental model or mock model). The size and scope of the project will usually determine how much you will go into detail with this model.


October 29, 2015

Taming asynchronous JavaScript with Promises

If you've ever written some non-trivial code in JavaScript, then you have already embraced the AJAX world. You also know that AJAX is the future of Web app development.


Javascript asynchronous

Thus, if you work with AJAX libraries, then you've already queried exposed API endpoints in an asynchronous way. Asynchronous means that function calls and operations don’t block the main thread while they execute.

Let's have a look at one example, where we want to query an API with the adverts of a user, and then render them. This could look like the following example:

October 20, 2015

Testing Apache Camel Applications with Spring Boot

In a previous blog post my colleague Rene Schakmann has shown that Apache Camel is a versatile tool that integrates different components using well-known enterprise integration patterns. At willhaben, we use Apache Camel together with Spring Boot for many different projects. However, writing unit tests for these Camel routes is not that trivial and requires some knowledge of both frameworks. In this blog post, I will walk you through a sample project (available on github) with special regard given to testability.

Setup and configuration

The project is a pretty standard Java Maven project. In order to be able to properly write unit test, we need to use some dependencies (see pom.xml). Apart from the usual Camel and Spring Boot dependencies, the most important ones are:

October 14, 2015

Resilient Software Design

Software design and architecture have to meet a lot of non-functional requirements: accessibility, certifications, testability and maintainability – just to name some of them. In this article, we will look at resilient software design: it addresses, of course, the requirement of resilience but also availability.

Availability is one of the most important aspects if your business depends on your website to be up and running. If the website is down for one hour you are not earning anything in this time.  Formally spoken, availability is defined as a relationship between MTTF (Mean time to failure) and MTR (Mean time to recovery):



In former days it was quite easy: there was one monolithic system. If you wanted to achieve 99% uptime, you just had to make sure that your system achieved exactly this availability rate. This meant that you would have about 87.6 hours a year downtime, e.g. for maintenance, which is quite easy to handle.

September 10, 2015

Running Austria's Most Visited Web Site on a Software Load Balancer? Impossible!

- Nah, it's totally doable. With HAProxy.


Background

When a website reaches a certain size, it's necessary to distribute load between multiple server instances. Incoming requests are spread via a load balancer which, in turn, represents the most critical part of the network infrastructure. Among the best known hardware products are probably the BIG-IP F5 series. Unfortunately, using a hardware solution does not provide the flexibility we need. We constantly want to change stuff like pool members, create new pools, manage IP quotas and kick unwanted or abusive traffic from our servers. Plus, if you plan to switch from HTTP to HTTPS entirely, performance also becomes an issue.

So we decided to go for it and implement our own solution. We chose HAProxy and did not regret it. The reasons are manifold but mostly we were looking for open source, speed, and scalability.

August 27, 2015

3D printed guys and Arduino boards at our office

Adding a hardware notification channel to your build server


Like most other software companies, we, at willhaben, use a build server to support our continuous integration development environment. A lot of developers check in their code in our git repository and sometimes the build is broken because of compilation errors or tests that do no longer pass. Build servers like QuickBuild or TeamCity have notification systems that are able to e.g. send information about a broken build to the developers via email or other channels.

As we love to play with technical stuff we have built a new channel for these notifications that show us the build status even if you don't have your mail client running or desktop notifications are not enabled. This channel looks like this:


August 19, 2015

Bring your app to your watch: Hello Pebble

At the time of writing this, more and more "wearable devices" make it to the market. Apple started its Apple Watch with mediocre success, but others performed much better: the pebble time smartwach was the most funded kickstarter project so far. Among the kickstarter funders were a few collegues at willhaben (including me), and when the watch finally arrived a few weeks ago, I was excited to try out the CloudPebble IDE for creating watchfaces and apps.

Right from the start pebble provides rich documentation for developers. Apps can be created in two flavours:
  • using the native SDK (C language)
  • using the javascript SDK
What's the difference? Apart from the language, the major difference is how (and where) the app runs: while the native app is runs directly on the watch, the javascript app always needs a bluetooth connected phone where the app resides.  The javascript app only exchanges messages with your pebble, which in turn draws the userinterface, handles user interaction and so on. With the native SDK, you have to do all this by hand.

July 29, 2015

Integration Frameworks: How Everything Works Together

Due to the diversity of this topic this will be the first post of a series. As soon as the other posts are available, they will be linked here.

These are the future topics to be covered:
  1. Integration Frameworks: general introduction and presentation of the basic concepts.
  2. Apache Camel: core concepts.
  3. Error Handling: production-ready error handling can be hard to master. We will provide solutions and concepts that are already live and have proven successful.
  4. Writing Custom Camel Components: sometimes there are use cases that are not covered by standard components. Custom Camel Components can be a solution that integrates seamlessly with the existing framework but still fits new requirements.
These topics, however, may still change and if you have any suggestions for topics that we should cover, feel free to contact us at: rene.schakmann@willhaben.at

July 22, 2015

Geo Clustering 3,000,000 Points On The Fly: A Brief HOW TO

Why Clustering?

Showing a lot of markers on a map looks very messy. Markers may start to overlap and the user experience is beginning to suffer. That problem is solved by using clustering: combining markers that are close to each other and displaying a single marker containing the number of markers it represents. 

Source: http://goo.gl/V9JdU5
This can be done on the client side or on the server side. Client-side clustering has three major problems:

July 21, 2015

Providing 20,000 Autocomplete Suggestions per Second: A Brief HOW TO

Implementing a feature like autocomplete may seem trivial at first glance. But as requirements are specified in more detail, it clearly becomes a bigger technical challenge. When you have to consider non-functional requirements (such as latency and scalability) for a website like willhaben.at that receives more than a billion page impression per month, things are a little bit trickier.

The term autocomplete is used to describe a range of different features and its actual requirements heavily depend on the overall context and the goal that should be achieved with this feature. Normally, what we mean by "autocomplete" is to complete a word the user is currently typing by providing him with a range of possible words that match the input string. But that's only one of the many ways in which this feature works.

So let's have a closer look at some particularly useful implementations of autocomplete solutions.