How To Build Your First Microservice — Part 1

Build the Infrastructure for your Crypto Watcher

Ziga Petek
8 min readJan 22, 2024
Photo by Heye Jensen on Unsplash

This is the first part of the third article in my series about microservices. In this segment, we will develop a simple application with one singular purpose. After all, that is the fundamental nature of microservices.

As described in the previous article, a microservice represents an autonomous service dedicated to performing a specific function. It addresses one task and solves it. Through this action, it contributes to a larger solution provided by the entire system.

To ensure portability and efficiency, we will encapsulate the application within a Docker container and execute it.

Introduction

So, here we are. This is the first article that doesn’t just focus on the theory of microservices but creates a practical example. We will build a small Node.js application that loads cryptocurrency data every 15 minutes and saves it into a database. That’s all it is going to do.

The application will run continuously, loading data from the CoinGecko API, and saving it in the database. It will also delete old data from the database. We have to remember that, just like with other things in life, we must not overdo it.

--

--

Ziga Petek

Developer, writer and a pure genious ... I may have exagerated a little ... Author of https://divine-coding.com