A Powerful Symphony

Software Architecture and Docker Orchestration

Muhammad Naufal Irbahhana
HappyFresh Fleet Tracker
3 min readNov 7, 2019

--

So what’s with this symphony? why am i greeted with a whale? To answer all of this questions, let me give you some definitions. Today I will talk about both software architecture and Docker Orchestration!

In simple words, software architecture is the process of converting software characteristics such as flexibility, scalability, feasibility, reusability, and security into a structured solution that meets the technical and the business expectations

What is this blue whale about? Yes, it’s the infamous Docker logo. What is a docker anyway? Docker is a tool designed to make it easier to create, deploy, and run applications by using containers. Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and ship it all out as one package.

Software Architecture

So in SS, the diagram architecture as follow:

Credits: Danny August Ramaputra

Basically our app divided into two. That is the Front End (FE) and the Back End (BE). As this is going, both FE and BE is placed in a container and hosted in EC2. Also for the environment, there are 3 namely Development, Staging, and Production.

So the BE side’s Docker container filled with the executable of the BE app. For the FE, it contains the asset that is already compiled and served with Nginx with the given url that is hf-tracker.com. To redirect between 3 of the environment and the two apps we Nginx Reverse Proxy. Initially we want to be able to proxy the request from one entry point. This is where Reverse Proxy comes in handy. To illustrate better, the diagram should look like this

Credits: Danny August Ramaputra

BE also connect to HF’s Message Queue (MQ) and it’s HyperTrack API to give the detail route. BE also use Redis, is a memory database to keep data persistence. So that when the app shuts down, the data won’t disappear. We also use MySQL as the database.

For FE, we use Websocket to receive data sent from BE. Also FE uses Google Maps API.

To deploy all 6 containers, we use the docker with the EC2 mentioned above. To easily manage the deployment, we use docker-compose.

Docker Compose

The docker-compose.yml is to specify how each container want to be arranged before it boots (the setup of each container). The configuration as follows:

Credits: Danny August Ramaputra

Above is SS’s docker compose file. This will help specify each container setup will be.

Well that’s about it folks! Thank you for reading

The Night is still young and im not even sleepy

Ciao!

--

--