Microservice Architecture – Step by Step Tutorial

Part 1.

  • Before we start
  • Inspirations and Goals
  • Scenario – application scope
  • Tool suite (Spring cloud, Netflix OSS)
  • Another links

 

Before we start

It would be a good starting point to know something about who I am:

Inspirations and Goals

The term “MicroService Architecture” is neither new nor secret to anyone that develops software. As stated by Martin Fowler:

The term “Microservice Architecture” has sprung up over the last few years to describe a particular way of designing software applications as suites of independently deployable services. While there is no precise definition of this architectural style, there are certain common characteristics around organization around business capability, automated deployment, intelligence in the endpoints, and decentralized control of languages and data.

However, although we have a lot of theory involved in this architecture, I really believe that we don’t have so many tutorials (step by step) explaining how to start a project with this structure from scratch.

Some weeks ago I’ve come across with this excellent Blog Series – Building Microservices written by Magnus Larsson. As he described very well about all the concepts and also provided the code, I decided to do the example by own my own, adapting it as my needed for a real project and now I can take this code as my blog post, where the purpose of this small article / tutorial is to clarify and help people who never have created an application based on microservice architecture to start from scratch and understanding a little bit more about this trend.

If you arrived here looking for an ultra expert in Spring / Microservice Architecture / Netflix OSS or something like this, probably this page will not fit what you are looking for 🙂

Scenario – application scope

Our fictitious scenario is a financial application from credit cards. The core of our application (where the real business logics live) is composed by 3 microservices that communicates among them.

Essentially:

  1. Card-Service
  2. Statements-Service
  3. Card-Statements-Composite
When the blog posts move on, we’ll get there. Be patient 😛

But beside that, we need a set of support services that are designed each one for a bounded purpose – for instance – edge server, dynamic routing, discovery service, among others. We’ll discuss each one as soon as they arrive in our system, however, for the anxious, Magnus have already gave us a portrait of them right here [item 4].

Tool suite (Spring cloud, Netflix OSS)

For this tutorial, I’ll assume that you have an environment with this requirements:

  • Java 8
  • Maven
  • Git
  • Your preferred IDE (I’d suggest Spring Tools Studio, but feel free to use another you want).

The main components that we will create are based on Spring and Netflix OSS projects.

 

Another Links

Here you can follow the whole serie:

Part 2: Config-Server and Service Discovery

Part 3: Edge Server

Part 4.1: Core Business Development – Card Service

Part 4.2 and 4.3 Core Business – Statement Service and CardStatementComposite

Part 5 – Hystrix / Monitor Dashboard and Turbine

More for coming …

As soon as I have new contents, I’ll include here the links.