Bounded Contexts and data duplication in action: adding a shop system to the movie database

It seems that ‘Bounded Context’ (from Eric Evans’ Domain Driven Design) has become one of the terms that have to be included in every microservices talk (along ‘Conway’s Law’, of course). And in fact, it’s an important concept, and although not really hard to understand, there are different approaches to implement relations and communication between bounded contexts. In this blog post I describe how I extended my movie-database system with another bounded context for the concept of movies. I added a non-ROCA self-contained system for shop functionality using AngularJS, grunt, bower on the client side and Spring Boot REST with JPA on the server side, and I am using server side includes (SSI) for integrating the navigation bar into the frontend.
This blog post is a follow-up to ‘Self-Contained Systems and ROCA: A complete example using Spring Boot, Thymeleaf and Bootstrap’, so reading that blog post would probably help to understand this one. It explains the theory behind my movie-database system made up of several self-contained systems using technologies like Spring Boot, Spring MVC, Spring Security, Thymeleaf, Bootstrap, jQuery, nginx and Redis. You can find the sources along with installation directions here on Github. As a small reminder, here is the architecture of the original systems:
(read more…)

Tobias Flohre

Self-Contained Systems and ROCA: A complete example using Spring Boot, Thymeleaf and Bootstrap

This post is about architectural concepts for web applications – self-contained systems (SCS) and resource-oriented client architecture (ROCA) – and their implementation with Spring Boot, Spring MVC, Spring Security, Thymeleaf, Bootstrap, jQuery, nginx and Redis. Self-contained systems aim at building software systems without ending up in a big monolith and provide an answer to the question ‘How micro should a micro service be?’. The resource-oriented client architecture (ROCA) provides some rules for implementing web applications that comply with how the web works – not working against the web.

Two years ago I built a ROCA prototype using Spring MVC, Spring Hateoas, Thymeleaf, Bootstrap and jQuery, and since Spring Boot appeared since then I decided to update the code. But then I did a lot more than just updating it to Spring Boot.

Let’s start with the concepts. By the way, if you read it and think ‘hey, there’s nothing brand new in here’, that’s okay. People built systems and web applications like this probably since the beginning of the web. Giving it names may be the new thing.
(read more…)

Tobias Flohre

Enterprise Java Batch: Challenges and solutions

In the previous blog post we looked at a best practice architecture for Java Batch applications that is running successfully a lot.

Still, we see challenges that affect productivity and costs, three of them are the following:

  1. Monoliths
  2. Application server
  3. Meta framework

Let’s a look at them now.

Monoliths

Conway’s law states that

organizations which design systems … are constrained to produce designs which are copies of the communication structures of these organizations

We noticed that often organization units start out with one batch application, and then it grows and grows and more and more batch jobs are deployed to it. You end up with one big application per organization unit. It’s somehow natural, because it’s far easier to just add another job to an existing application that create a new one. The pain comes later, and it comes with a vengeance. When updating code or a library, all jobs have to be tested, even if the changes are only for one job. And in general are batch jobs hard to test and don’t change a lot, so unnecessary testing is really painful.

So what do you do about it? One application per job – and you make it really easy to create a batch application. You may call this a Micro-Batch-Service if you want.
(read more…)

Tobias Flohre