JavaZone 2018 – my summary

JavaZone, one of the biggest European Java conferences, is now over. I was able to take part in it using my conference allowance at Kahoot!. Although the ticket is fairly expensive (around 8 500 NOK for a late-bird ticket), in my opinion, it was a very good conference.

Let’s start with a couple of things that I really liked about this conference or which differed from my previous experiences:

Overflow zone

The conference took place in Oslo Spektrum, a big venue right next to Oslo central railway station that hosts mostly concerts. Some of the seats on the balcony were converted into a zone where one could watch streams from all 7 rooms and listen to the sound on a headset. You could choose which talk to listen to by changing the channel on an IR device. That meant that it was possible to peek at other talks and if the one that you were listening to at the beginning felt not really suited for you, you could quickly change without causing any commotion in the rooms. It was a very popular zone, and, to be honest, I watched all the talks from there. It still differed a bit from watching the conference online – you still could catch the speaker to ask some questions after all. I’d love to see it at more conferences.

The food

There were (I think) 7 restaurants from all over Oslo that set up makeshift kitchens in the main hall. Each of them was sponsored by one of the companies that had booths next to the restaurant and a huge banner behind.

The food was amazing and included in the conference ticket.

This, for instance, is a lamb wrap in a lefse – Norwegian potato bread.

To add to it, there were coffee stands all over the hall and on the hallways. You could also get some soft drinks, ice cream from two different providers (one with an optional bacon topping) and the Norwegian police booth was living up to the stereotype, serving donuts.

A different community

It felt like the JVM community that assembled at JavaZone, compared to Confitura that I visited a few months ago, was a bit more experienced and definitely more diverse. That’s not that surprising given that it’s in Norway. The speakers were also coming from all over the world, though of course, the most were from Western Europe. While there were talks in Norwegian, the majority of the talks were conducted in English.

A different approach of the companies

Of course, they were recruiting there as well. Compared to Confitura though, the stands were not filled with multiple jobs postings and the swag was less visible too. Instead, many companies organized something for the developers to play with. There was a toy railway, a pretty huge RC car track, pinball machine, several retro consoles, quite a lot of lotteries and one company was hosting kahoots, giving out money (1000 NOK for the winner on each break, 10 000 NOK for the final kahoot of the day). There was also a so-called IT-championship in table tennis.

So was it worth it?

I would have a hard time paying for the conference by myself, but if you have a conference budget that can cover for this one or enough money to fly to Oslo, pay for the conference and spend 2 days in Norway – sure!

My notes from the talks

Below you can find my quite chaotic notes from the talks I watched. If you want to watch them, some of the videos have already appeared on JavaZone’s program site and more are bound to come. Because of the Overflow space, at some slots there could be up to 3 talks that I have been following simultaneously.

Wednesday

Transactions and Concurrency Control Patterns – Vlad Mihalcea

  • There are more than 4 transaction levels – skew write, dirty write…
  • Description of concepts such as 2PL, MVCC

JDK 9, 10, 11 and Beyond: Delivering New Features in the JDK – Simon Ritter

  • JDK11 goes out in 2 weeks
  • LTS release every 3 years
  • Oracle JDK starting from JDK11 can be used on production only with a commercial support contract!
  • If you want it for free, use OpenJDK, but OpenJDK has a new version every 6 months and after 6 months they’ll stop updating it
  • Versions can introduce breaking changes
  • JDK12 is supposed to contain some changes in switch statements

The state of Jakarta EE – David Delabassee

  • What was known as Java EE -> Jakarta EE and goes into hands of Eclipse
  • A bit more focus on microservices is planned
  • Still sounds like it’s in the initial formation phase

Good Service: Detect and avoid errors in the world of microservices – Martin Lehmann

  • How Finn.no (the Norwegian equivalent of Poland’s OLX) is monitoring their microservices
  • They don’t have an operations team, someone is on call instead
  • Extensive use of dashboards, metrics
  • Each team defines core metrics that are important for their service to work
  • On-call person monitors the metrics during their shift
  • If metrics are red, documentation contains explanation what fails and whom to contact if that’s something that cannot be fixed by the on-call person

Common API security pitfalls – Philippe de Ryck

  • Some things that are covered by OWASP Top 10 too
  • Sessions are okay for the smaller / mid-size applications, we don’t always need not to use them
  • Same with cookies – but add CORS if you use them
  • Domain whitelisting also in client – we don’t want to send our auth headers to random backends

Lost in transaction? Strategies to deal with (in-)consistency in distributed systems – Bernd Rücker

  • ACID 2.0
  • All operations should be idempotent – a transaction id might be helpful for that
  • With 2-4 microservices in the loop, they can send pass messages onwards
  • That means that if we want to change the order, we need to redeploy them all at the same time
  • Another option is to use orchestrators which is a popular approach recently
  • They send messages to each of the services separately
  • BPMN for the win

How to break into your application: A live hack – Simon Maple

  • Sample apps with vulnerabilities
  • Break out of zip file and insert a file somewhere into the system
  • Famous Struts vulnerability (remember Equifax?) shown live
  • Spring Break – vulnerability in Spring Data REST
  • Update your dependencies!
  • Snyk – a tool to analyze dependencies and fix outdated ones

Thursday

Databases are Like Onions: Commit Logs in an Age of Microservices – Tim Berglund

  • Every database is basically a commit log
  • Introducing Apache Kafka as a way to create a commit log that can be read by multiple consumers and scales nicely
  • Do we really need a database at this point?

All you need to know and check before accepting a job offer from «The Next Unicorn» – Svetlana Bozhko

  • Going through what’s in the package for developers that start working for smaller startups
  • You’ll likely get some general knowledge about everything, but nothing specialist
  • If being one or very few or only dev in the team (often as CTO), you might not develop that much as an engineer, but more towards entrepreneurship
  • Choose places that do something interesting, appealing to you, not copycats

Springing into Kotlin: How to Make the Magic even more Magical – Mark Heckler

  • Spring Boot starters already can work with Kotlin classes
  • Kotlin = less boilerplate for a spring boot microservice

Tracking the Swedish Election, or how to make your hobby project successful – Hampus Nilsson

  • Author of val.digital
  • It’s your pet project, nobody’s going to read your code
  • Use dirty hacks, it doesn’t have to be perfect
  • Use technologies that you’re familiar with if you want to achieve results
  • Learn technologies at work if you can, not at home…
  • Unless your project’s purpose is to learn a new technology. Then pick one and do the rest in familiar stuff or assume it won’t get finished and it’s likely not to go far enough for you to learn anything
  • 9 out of 10 startups with fresh ideas fail. 5 out of 10 startups that copy others don’t

It’s about time – Christin Gorman

  • Hilarious introduction into all the potential problems related to the absurd, legacy system that we all deal with (which is our global date/time system)
  • Which classes should be used in Java to store date/time and how to deal with storing date/time in DBs (namely PostgreSQL and MS SQL Server)
  • Storing in UTC is almost always a good idea
  • What might be hard – comparing results (i.e. stores sale volumes) by day between various timezones

Java Modularity: the Year After – Sander Mak

  • Over 80% of developers are still using Java <= 8 on production
  • Only 20% of the developers that use JDK 9+ are using modules at all
  • Adoption of JDK9 is much smaller than JDK8 was at this point after its release
  • Mostly because it contains changes that aren’t so useful to developers’ daily work
  • From new packages pushed to Maven Central during 3 weeks in August ‘18, only 1% was using modules and 9% had at least Automatic-Module-Name to reserve their module name. That means 10% packages were module-aware at all
  • The author suggests that JDK11 is more likely to gain traction because of the LTS

GraphQL – The Next API Language – Niek Palm

  • Introduction to GraphQL and how to use it with Spring Boot
  • Mostly describing how features like filter work and how to mutate objects

Native Agile Psychology of Teams and Individuals – Valerie Andrianova

  • I mostly switched on and off this talk for some time, so I might have the full notion here
  • It sounded mostly like a description how JetBrains are doing their development and keep their devs happy

Matchlogger: a slow start

As the Polish-speaking followers (quite likely 100% of all my followers) already know, I am taking part in a software development contest called „Daj się poznać” where the aim is to develop an open-source application for three months and blog about it. The contest starts today, so this is the moment when many participants write about their aims. So, my project is…

Matchlogger

A web-based app that can be used by players, referees, and supporters to mark matches they either took part in or watched. The aim is to enable the users to log their matches in various disciplines and add data they deem important, for example, minutes they played, goals they scored, match result, attendance… The idea is based a bit on a now-defunct website called footballfans.eu where the functionality was fairly limited and the service closed down a few months ago, but extends it not to include only supporters and only of teams that play in higher leagues.

As for the technology stack – Spring Boot is my backend choice for this project. I still consider several options for the frontend, but one that is now on my spotlight is Vue.js. I’ll likely decide on the approach here in several days. The database will be using MySQL.

First steps are already done. Today I set up the project using Spring Initializr. While most chosen dependencies were fairly standard, the one that required some extra configuration was Liquibase – the library for database versioning which I’m going to use from the very beginning. As often with Spring Boot, also this time it was a one-liner in the configuration file. The empty changelog file also was needed to be created at the referenced location.

After today, the application can be run using mvn spring-boot:run and starts up correctly with Basic auth as default security setting. Not much can be seen, though:

The code is available at Github. I’ll be using Github issues to take care of the backlog and Toggl for time logging. For the first deployment, I want to have a functioning login (likely Google- or another provider- based).

Religion Map – Django, LeafletJS & OpenStreetMap

[pl] Posty technologiczne będą po angielsku. W razie potrzeby mogę tłumaczyć niektóre na polski, tu jednak mam wrażenie, że nie jest to potrzebne.

I spent Saturday on learning Django by creating a simple app that would display a map and color tiles based on the religion that has the most temples in the area. It took me 6.5h to implement a solution that would get the parameters (latitude, longitude, zoom level) from URL and show colored map. The opacity of each tile depends on share of dominant religion in the area.

screenshot-from-2016-12-17-22-44-25

For displaying and coloring map I used LeafletJS with OpenStreetMap tiles for map background. To get the data, I wrote the following Overpass Query Language query:
(
way["amenity"="place_of_worship"](54.2749, 18.4296,54.4465,18.9527);
>;
node["amenity"="place_of_worship"](54.2749, 18.4296,54.4465,18.9527);
);

In the query, bounding box was replaced with coordinates for chosen area. Then the data were counted and grouped by „denomination” tag from OpenStreetMap. It works fairly slow as I focused on making it work, so in each request there are 100 sequential calls to Overpass API, but you can see the code on Github.

I noticed some things on the way.

First, it looks like Django tutorial suggests a setup in which we have two separate projects – one that is a localhost runner of our app, and another as a separate, packaged app that we build, uninstall and install with pip every time we’re making a change. After that it seems that we need to restart the server for the changes to take effect. While it is still faster than deploying a Java application, this is a four-step process that is probably automatised in most projects. Or maybe I misread something?

Second, running multiple Overpass API queries takes a long time – the best way would be to obtain all data in a single query and then split them based on the coordinates. That would be the best improvement for the real app, although also running queries in parallel might help.

Third, OpenStreetMap data in some places varies. Of course there are areas where no temples are mapped and that’s simply a result of no local mappers, but even in locations where they are mapped there are some differences. In the areas depicted in the picture of Bosnia at the top of this post, one can see 5 different dominant colors when in fact there were three or four dominant religions. It turned out that some catholic churches were marked

denomination=roman_catholic

and others

denomination=catholic.

Same issue was with Orthodox churches – there were both denomination=orthodox and denomination=serbian_orthodox. In the second case Serbian Orthodox church is a subset of Orthodox church which makes the case more complex.

I noticed also that while denomination tag helps in dealing with different christian faiths, in some areas this tag isn’t used extensively. It can be seen in Brussels where apparently mosques don’t use this tag too much and same issue is with synagogues. This suggests that for better data, one might consider hand-picking combinations of religion and optional denomination tag into clusters.

Fourth, Django seems to be focused on database-centric applications. Tutorial suggests creating entity classes that immediately get mapped into database tables and can be edited with built-in admin app. It helps pretty much with DB-based apps, but also causes some confusion where to put the code in case of apps that don’t persist any data and use external APIs to get their data.

What I really liked about Django is their straightforward template engine and language (it reminds me a bit of Thymeleaf). It also seems that this is a fairly good framework for quickly writing a DB-centric Web application. I will surely consider it with my future projects.

Github project is here, MIT licensed. Feel free to check out and use it as you wish.