Our solution to microservices

After researching and reading on Microservices I reached the conclusion that everyone does it differently. There’s still no standard for this. There are some best practices but not enough that we can just implement everything without spending time researching. And like I was saying, after loads of research this is what we came up with.

Our first step was to decide where to start. We chose 3 very simple endpoints of our API to split into a microservice. This service needs to be able to self deploy to our kubernetes cluster into the UAT and production environments.

Setting this up is simple. We make the service work and then create a Deployment and a Service objects in Kubernetes, like:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
app: microservice-1
name: microservice-1
spec:
template:
metadata:
labels:
app: microservice-1
spec:
containers:
- image: attentive/microservice-1
name: microservice-1
ports:
- containerPort: 8001
1
2
3
4
5
6
7
8
9
10
11
12
13
apiVersion: v1
kind: Service
metadata:
labels:
app: microservice-1
name: microservice-1
spec:
externalTrafficPolicy: Cluster
selector:
app: microservice-1
ports:
- name: http
port: 8001

Read More

Flinthook

I started playing Flinthook on the switch a weeks days ago. The game has been sitting on my Steam wishlist for ages but as soon as it landed on the Switch I figured: “It’s time!”.

Flinthook is a roguelite game. When you die you start over but you get to keep some minor items to buy stuff with. I really like this kind of games. Roguelikes that make you loose absolutely everything and the only progression is the satisfaction of “getting better” are not for me. I like to do a run and get to keep something that makes me feel that I’m growing. I’m putting in the hard work and getting something out of it.

Story

You are a space pirate with a ghost mask (called Flinthook) and you have to save your friends from an evil wizard. At least that’s what I’ve gathered from the cutscenes.

The Mermaidon Galaxy has a surprising amount of lore ready for you to unlock by collecting relics or book pages throughout the game.

Read More

Microservices@Attentive

At Attentive we have all our core code in a single repository. That code is responsible for: Database models, async tasks, API, Serialization,…. Our frontend (in Angular5 is in a different one).

I think building the code as a single repo wasn’t the wrong decision at the time. But now we have growing pains. We started noticing that we can’t just push code on top of each other. If someone has a feature in UAT the others can’t have it until the previous is tested. Everyone’s just always stepping on each others toes.

If we expect to grow the team and the company we need to split our codebase into microservices.

This will allow us to have teams taking care of each service and become autonomous. Microservices will allow us to deploy code with more confidence because one push to production can’t break the entire system.

The road waiting for us won’t be easy.

Read More