I recently wanted to do some source code analysis and found it difficult to find a good eclipse plugin.
Luckily, it's now very easy to get your own SonarCube server running.
Basically you only need a docker installation and a few simple steps.
To start a SonarQube instance you run the following command:
docker run -d --name sonarqube -p 9000:9000 -p 9092:9092 sonarqube
Continue reading →
If you have read my previous post about caching, The (non)sense of caching, and have not been discouraged by it, I invite you to build your own cache.
In this post we will build a simple cache implementation that refreshes its data automatically, using Java EE features.
Let's describe the situation.
We are building a service that uses an external resource with some reference data.
The data is not frequently updated and it's allright to use data that's up to 1 hour old.
The external resource is very slow, retrieving the data takes about 30 seconds.
Our service needs to respond within 2 seconds.
Obviously we can't call the resource each time we need it. To solve our problem we decide to introduce some caching.
We are going to retrieve the entire dataset, keep it in memory and allow retrieval of specific cached values by their corresponding keys.
Continue reading →
Last week I presented my talk 'MISSION TO MARS: EXPLORING NEW WORLDS WITH AWS IOT' at IoT Tech Day 2016 and it was great fun! In the presentation I showed how to build a small robot and control it over MQTT messaging via Amazons IoT platform.
The room was packed and the demo went well too.
I promised to share some info about it on my blog so here we are.
I've composed a shopping list and a collection of useful links: Mission to Mars - Shopping list Mission to Mars - Useful links The original presentation is available here: Mission_to_Mars-Jeroen_Resoort-IoT_Tech_Day.pdf So what's next? I should publish my Pi robot and Mission Control Center web client code on github.
Maybe I'll extend the python code for controlling the mBot over a serial connection and make a proper library for it.
Will keep you updated...
Continue reading →
I have seen several projects where the developers had implemented caching all over the place. Caches were causing a large increase of heap usage, and users were always complaining that they were not seeing the latest data. My opinion on this is that a decision to add caching should not be taken lightly. Adding a cache means adding a lot of additional (or so-called accidental) complexity and also has a functional impact on the users. Adding a cache raises a lot of questions that need to be answered:
- What if cached data is updated, should the cached record be updated or evicted too?
- What should we do in a distributed environment, use a distributed cache? Is this distributed cache scalable?
- Do we get the performance improvements we're expecting?
- What is an acceptable delay for users to see the updated data?
- How many elements should we store in the cache?
- What eviction policy do we need when not all data fits in the cache?
Continue reading →