Archive for microservices

The Big Microservices Project with Java Play and React

In order to motivate myself in adding some new blog posts to this site, I have come up with a fun project. That is very relevant, yet tricky for newbs–building out a microservices application.

Additionally, I want to learn a new Java framework, so for the most part we will write each service using Java Play, which is built on top of Netty.

Each post will tackle a specific and targeted need of this application. And hopefully be easy enough to follow for those new to web development and infrastructure operations.

What this series will not do: teach programming. I will not spend too much time explaining basic programming concepts. So make sure you follow a beginner’s tutorial, in Java or any OOP language, before jumping into this set of how-to’s.

However, we will discuss advanced programming concepts–those that directly impact our application design. Powerful concepts like concurrency, non-blocking I/O, RESTful API’s, tracing, message queues, and many more goodies!

Although we will mostly use Java Play, we will use React for the front-end JavaScript piece, and possibly Go for a small proxy service. This is going to be a big project, probably take me a couple months to complete; I imagine the result will change from some of these initial thoughts. This is called Agile Architecture: commit to decisions until the last responsible moment.

What is our application going to do? As of now, I am thinking the best way to teach the importance around concurrent connections, message queues, and microservices is to build out a social media data aggregation service.

Why? It is not necessarily going to be that useful. However, social media API’s provide us lots of data to play with right from the start. Additionally, you’ll find that 3rd party API’s can never be trusted. We need to build services that won’t fail just because Facebook is slow or down.

Let’s build 3 adapters for data aggregation– Facebook, Twitter, and Pinterest. Hopefully we can do something interesting to look at with this.

Below is the initial diagram for our microservice stack. Don’t let this intimidate you– there are quite a few components. However, when you’re done with each post in this series, you should walk away with a solid understanding of each piece and its importance to the big picture.

Oh, the last point I should make is that we will be securing our single-page application with OAuth 2.0. We’re going to build out our own OAuth 2.0 implementation, most likely incorporating it into the gateway component.

Lastly, we should ensure our application is easy to scale, maintain & change, and debug. I’ll make sure to hit on this criteria several times over the course of this project.

Let’s get started!

Infra layout map