Microservices with Ktor and Nomad

Overview

Microserviços com Ktor e Nomad

Esse projeto é um teste prático de microserviços usando o framework Ktor, o banco de dados Postgres, o orquestrador de conteiners Nomad, o Service Mash Consul e o Load Balancer para Consul Fabio.

ATENÇÃO: Esse projeto não busca ser o padrão para a criação de microserviços usando as tecnologias listadas, é apenas um experimento meu enquanto buscava aprender mais sobre as tecnologias acima.

Arquitetura

Microserviços

São dois microserviços Ktor, sendo:

  • user-microservice: Microserviço referente á criação, leitura (de todos e de um único registro), edição e remoção de usuários. Rota sendo /user;
  • post-microservice: Microserviço referente á criação, leitura (de todos e de um único registro), edição e remoção de postagens. Rota sendo /post;

Cada um com quatro instâncias.

Banco de dados

O banco de dados é um Postgres na sua última versão disponível no DockerHub. Com uma única instância.

Fabio

Fabio é o Load Balancer da aplicação, que irá receber as requisições. Nesse caso, A rota do Load Balancer é 9999, e a rota da UI do Fabio é 9998.

Executando

Primeiro, vá á pasta nomad e inicie o Consul, que será usado para fazer o Networking da aplicação:

sudo consul agent -dev

Após isso, inicie o Nomad, também na pasta nomad:

sudo nomad agent -dev-connect -config=nomad.hcl

Agora, inicie os jobs:

nomad job run postgres.nomad
nomad job run fabio.nomad
nomad job run user-microservice.nomad
nomad job run post-microservice.nomad
You might also like...
SSU u-saint parser with Kotlin-Multiplatform and Ktor.

kusaint Soongsil University(SSU) u-Saint Parser with Kotlin Multiplatform. Prerequisites JVM !!IMPORTANT!! To run kusaint as a library in JVM environm

A Modern Kotlin-Ktor RESTful API example. Connects to a PostgreSQL database and uses Exposed framework for database operations.
A Modern Kotlin-Ktor RESTful API example. Connects to a PostgreSQL database and uses Exposed framework for database operations.

kotlin-ktor-rest-api A Modern Kotlin-Ktor RESTful API example. Connects to a PostgreSQL database and uses Exposed framework for database operations. F

Backend coding challenge using Kotlin and Ktor

Backend Coding Challenge We appreciate you taking the time to participate and su

Shoppe - Kotlin and Ktor app, which can easily be deployed to Heroku

[ 🚧 Work in progress 👷‍♀️ ⛏ 👷 🔧️ 👷 🔧 🚧 ] Shoppe Kotlin Multiplatform App

🐨 koa - Kotlin and Ktor OpenAPI

Koa intends to be a fully functional DSL for OpenAPI in Kotlin, including a Ktor plugin to add OpenAPI to your server Kotlin applications.

🪟 Pluggable Ktor plugin to implement Sentry for error handling and request contexts

🪟 Ktor Plugin for Sentry Pluggable Ktor plugin to implement Sentry for error handling and request contexts. What is this library? This basically impl

 Architecture With Kotlin-Ktor and SvelteJS
Architecture With Kotlin-Ktor and SvelteJS

Architecture With Kotlin-Ktor and SvelteJS Features Showing data frrom open API on US Population Showing Auto Generated QR code Why Ktor - Create asyn

Various Ktor extensions and plugins.

Ktor Plugins Collection of useful Ktor plugins. All plugins are hosted on Maven central and have same version that should be similar to the latest ver

🍓CookHelper - food social network. The Api and Websocket are based on Ktor framework. Dependency injection with Koin library.

CookHelper [ 🚧 Work in Progress 🚧 ] CookHelper is a cross-platform application that will allow you to cook a delicious dish from an existing recipe

Owner
Ederson Ferreira
14 Years old, developer with Kotlin, Javascript, NodeJS and Golang. Live coder at Twitch
Ederson Ferreira
Ktor is an asynchronous framework for creating microservices, web applications and more.

ktor-sample Ktor is an asynchronous framework for creating microservices, web applications and more. Written in Kotlin from the ground up. Application

mohamed tamer 5 Jan 22, 2022
Integration Testing Kotlin Multiplatform Kata for Kotlin Developers. The main goal is to practice integration testing using Ktor and Ktor Client Mock

This kata is a Kotlin multiplatform version of the kata KataTODOApiClientKotlin of Karumi. We are here to practice integration testing using HTTP stub

Jorge Sánchez Fernández 29 Oct 3, 2022
KTor-Client---Android - The essence of KTor Client for network calls

KTor Client - Android This project encompasses the essence of KTor Client for ne

Mansoor Nisar 2 Jan 18, 2022
Kotlin microservices with REST, and gRPC using BFF pattern. This repository contains backend services. Everything is dockerized and ready to "Go" actually "Kotlin" :-)

Microservices Kotlin gRPC Deployed in EC2, Check it out! This repo contains microservices written in Kotlin with BFF pattern for performing CRUD opera

Oguzhan 18 Apr 21, 2022
In this Repo i create public apis to serve apps, like muslim apps using Spring, kotlin, and microservices

spring-freelance-apis-kotlin In this Repo i create public apis to serve apps, like muslim apps using Spring, kotlin, and microservices This repo for l

null 6 Feb 13, 2022
Team management service is a production ready and fully tested service that can be used as a template for a microservices development.

team-mgmt-service Description Team management service is a production ready and fully tested service that can be used as a template for a microservice

Albert Llousas Ortiz 18 Oct 10, 2022
A project to learn about Reactive Microservices experimenting with architectures and patterns

reactive-microservices-workshop Copyright © 2021 Aleix Morgadas - Licenced under CC BY-SA 4.0 A project to learn about Reactive Microservices experime

Aleix Morgadas 7 Feb 21, 2022
Proof-of-Concept messaging and "voice over IP" server that uses microservices

bullets THIS IS A WIP PROJECT. Proof-of-Concept messaging and "voice over IP" server that uses microservices. The project uses many technologies. Such

Paulo Elienay II 0 Jan 2, 2022
Curso microservices kotlin micronaut

Arquitetura de Microserviços Instruções Criando rede no docker: docker network create micronaut-net Criando imagem Postgresql no Docker: docker run -

null 0 Oct 20, 2021
A simple (and naive) RESTful API made with Ktor, jasync-sql and JWT.

A simple (and naive) RESTful API made with Ktor, jasync-sql and JWT. Route Method Description /account POST Create a new account /account DELETE Delet

null 2 Nov 4, 2021