Team management service is a production ready and fully tested service that can be used as a template for a microservices development.

Overview

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 development.

Keywords: microservice, kotlin, Hexagonal-Architecture, SOLID, Domain-Driven Design, functional-programming, Testing, Event-Driven Architecture, Domain-Events, Kafka, spring-boot, PostgreSQL, Transactional-outbox

Overview

Use-cases

  • Create a team
  • Add person as a team member
  • Remove person as a team member

Use-case diagram

Example of how a use-case looks like:

Architectural Patterns

This project has been built using hexagonal architecture (aka ports & adapters), a domain-centric architectural pattern that use dependency inversion as main principle behind. It also uses tactical DDD patterns in the domain layer.

Package structure

  • Application: Application Services (the use cases)
  • Domain: Domain model and ports.
  • Infrastructure: Adapters, configuration and infrastructure code.

Architectural shortcuts

Even though the project follows hexagonal architecture, it also takes some shortcuts, breaking consciously some architectural constraints:

  • Skipping incoming ports: Incoming adapters are accessing application services directly.

Messaging patterns

In order to avoid dual writes the project uses a couple of patterns:

Events

Domain events

A Domain-event is something that happened in the domain that is important to the business.

This service advocates for asynchronous communication instead of exposing endpoints to be consumed by clients. To do so , since the service uses also domain-driven design tactical patterns, all use-cases are producing domain-events:

Integration events

An integration event is a committed event that ocurred in the past within a bounded context which may be interesting to other domains, applications or third party services, so it is the sibling of a domain event but for the external world.

Why not to publish our domain events directly? We can not publish our domain events directly for several reasons:

  • Back-ward compatibility: We should provide a way to maintain backward compatibility, if we were publishing our domain events we would couple them to the external contracts.
  • Different schema for messages: In almost all the companies using event-driven these messages are defined in a different schema such as avro, protobuf or json schema.
  • We don't want to publish all domain-events: Sometimes we don't want to publish to our consumers all our internal domain events.

Here the contracts

Error handling

  • recoverable: Domain (Eithers)
  • Not recoverable: Let it crash (Exceptions, capture and deal with them at the boundary of the app)

boundary errors (shit happens) kafka retries

where are the metrics! boundary monitoring

Diagram testing

testing strategy

diagram usecases etc ...

Flyway

What about reading entrypoint???????? events, compacted topic!!!

tech-stack

spring boot undertow (nio) kafka postgresql kotlin arrow BBDD: postgresql, flyway, jdbctemplate

DDD patterns

aggregate

-tactical ddd

eventual consistency

eda:

  • dual writes
  • DLQ
  • tombstones
  • Error handling Kafka : backoff, retries and error handling (revover)
  • Replication, fallback when lag more than 5 min ?
  • dual writes
You might also like...
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

Native-Blur: a C++/Kotlin library for blur bitmaps and activity, mobile-ready, android compatible
Native-Blur: a C++/Kotlin library for blur bitmaps and activity, mobile-ready, android compatible

Native-Blur The Native-Blur is a C++/Kotlin libraray for blur bitmaps and activity, mobile-ready, android compatible, powered by Java Native Interface

Curso microservices kotlin micronaut
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 -

Tweaks - A customizable debug screen to view and edit flags that can be used for development
Tweaks - A customizable debug screen to view and edit flags that can be used for development

A customizable debug screen to view and edit flags that can be used for developm

Backend-aio - A ktor based ready to use backend

BackendAIO A ktor based ready to use backend BackendAIO is a project made to hel

LinkHub is a simple and effective link management application that can help you to easily manage your app with no ads!
LinkHub is a simple and effective link management application that can help you to easily manage your app with no ads!

LinkHub LinkHub is a simple and effective link management application that can help you to easily manage your own links with no ads! Download Screensh

Used to generate the template code of GetX framework
Used to generate the template code of GetX framework

Language: English | 中文简体 statement some fast code snippet prompt come from getx-snippets-intelliJ Description install Plugin effect Take a look at the

Template for a modern spring web service.

Spring Service Scaffold A scaffold for a web service operating with a Spring Framework backend, reactjs as frontend and a continuous testing and build

From 8-10 October 2021 there was VTB MORE tech 3.0, where the DUCK team presented their solution.
From 8-10 October 2021 there was VTB MORE tech 3.0, where the DUCK team presented their solution.

InvestmentGuideVTB Ссылка на репозиторий с бэкендом приложения: https://github.com/disarrik/vtbBackend Процесс сегментация происходит в отдельном окне

Owner
Albert Llousas Ortiz
@N26
Albert Llousas Ortiz
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
Reach plc. Apps Team Exercise (Junior)Reach plc. Apps Team Exercise (Junior)

Reach plc. Apps Team Exercise (Junior) Description One of our magazines is looking for new sources of revenues and starts a few partnerships with beau

null 0 Nov 9, 2021
Here is a ready to use JAICF bot template that utilises

JAICF Spring Bot template Here is a ready to use JAICF bot template that utilises Spring MongoDB Docker Prometheus Grafana Graylog How to use Please r

Just AI 1 Feb 13, 2022
Collection of JVM library logic that the Sirloin software development team is currently using

Collection of JVM library logic that the Sirloin software development team is currently using

Sirloin Dev 4 May 10, 2022
“Budgeter” is an optimized application for personal account management. Household account management is complicated.

Budgeter Links ?? Open-Source Library MVVM-Architecture Viewmodel-LiveData Room Database Dependency Injection-Hilt Coroutines Things we used while mak

Aditya Cheke 0 Dec 20, 2021
Android-kotlin-lifecycles-management - LifeCycles Management Techniques

Activity Lifecycle - DessertPusher This is the toy app for lesson 4 of the Andro

Jeliel Augusto Mota 0 Jan 8, 2022
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
Microservices with Ktor and Nomad

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

Ederson Ferreira 3 Sep 16, 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
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