Top Banner
Lagom Reactive microservices framework Fabrice Sznajderman - @fsznajderman 16 septembre 2016 @lagom #JSC2016
36

Lagom, reactive framework

Jan 09, 2017

Download

Technology

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Lagom, reactive framework

LagomReactive microservices framework

Fabrice Sznajderman - @fsznajderman16 septembre 2016 @lagom #JSC2016

Page 2: Lagom, reactive framework

Roadmap

● Microservices / Event Sourcing / CQRS

● Lagom : overview

● Principales fonctionnalités

● Anatomie d’un projet

● Live coding

● Next step

Page 3: Lagom, reactive framework

Qui vous parle?

Fabrice Sznajderman

● Développeur Scala @Zenika○ Formateur Java/Scala

● Contributeur (Lagom, JHipster, rapture)● Bagger (Scala - Lagom - SBT)

Page 4: Lagom, reactive framework

October 27th and 28th, 2016. Lyon, France

Page 5: Lagom, reactive framework

Core concepts

Microservices / Event Sourcing / CQRS

Page 6: Lagom, reactive framework

Microservices

Page 7: Lagom, reactive framework

Microservices

Page 8: Lagom, reactive framework

Microservices

Microservices-Based Architecture is a simple concept: it advocates creating a system from a collection of small, isolated services, each of which owns their data, and is independently isolated, scalable and resilient to failure. Services integrate with other services in order to form a cohesive system that’s far more flexible than the typical enterprise systems we build today.

Reactive Microservices Architecture: Design Principles for Distributed Systems - James Boner http://www.oreilly.com/programming/free/reactive-microservices-architecture.html

Page 9: Lagom, reactive framework

Microservices

Page 10: Lagom, reactive framework

Event Sourcing

Page 11: Lagom, reactive framework

Approche traditionnelle

Page 12: Lagom, reactive framework

Approche traditionnelle

Page 13: Lagom, reactive framework

Approche traditionnelle

Page 14: Lagom, reactive framework

Event sourcing

Page 15: Lagom, reactive framework

CQRS

Page 16: Lagom, reactive framework

CQRS

● Command● Query● Responsability● Segregation

Page 17: Lagom, reactive framework

Approche traditionelle

Page 18: Lagom, reactive framework

CQRS

Write (Command) :Event log. Modèle simple.

Read (Query) : Dénormalisation, scalabillité, performance...

Page 19: Lagom, reactive framework

CQRS

Page 20: Lagom, reactive framework

Lagom

Page 21: Lagom, reactive framework

Overview

Page 22: Lagom, reactive framework

● Construire un système de microservices

● Basé sur les principes réactifs

● Intégration dans l’environnement de développement

Overview - Objectifs

Page 23: Lagom, reactive framework

● Coeur du framework est écrit en Scala

● API en Java 8

● Bientôt une version Scala

Overview - Quel langage ?

Page 24: Lagom, reactive framework

● Java 8 (& Scala)● (Immutables)● SBT / Maven● Jackson● Cassandra● Play framework● Guice● Akka : Persistence, Pub/Sub, cluster● Akka Stream● SLF4J & Logback

Overview - Composants techniques

Page 25: Lagom, reactive framework

Principales fonctionnalités

Page 26: Lagom, reactive framework

● Description de l’API basée sur une interface

● Request / response synchrone

● Message asynchrone - Streaming

Fonctionnalités - Service API

Page 27: Lagom, reactive framework

● Garde l’état courant en mémoire

● Capture et persiste tous les changements d’états (events)

● CQRS Read side (query & update)

● Clustering / sharding

● CassandraSession

Fonctionnalités - Persistance API

Page 28: Lagom, reactive framework

● Intégration dans l’IDE

● Plusieurs services fournis par défaut

● Rechargement du code à chaud

● Une seule commande pour démarrer le système

Fonctionnalités - Environnement de développement

Page 29: Lagom, reactive framework

● ConductR pour la production

● Scalabilité

● Déploiement

● Monitoring

Fonctionnalités - Environnement Production

Page 30: Lagom, reactive framework

Anatomie d’un projet

Page 31: Lagom, reactive framework

● Activator

● Plugin SBT: *scaffolding-plugin-lagom

Structure d’un projet - Démarrer un projet

*https://github.com/Fabszn/scaffolding-plugin-lagom

Page 32: Lagom, reactive framework

Structure d’un projet - Arborescence

Page 33: Lagom, reactive framework

Structure d’un projet - Démarrage du système

● Une commande pour lancer le système : sbt runAll

● Plusieurs services activés au démarrage : ○ Cassandra

○ Service locator

○ service gateway

○ tous les services déclarés

Page 34: Lagom, reactive framework

Live coding

Page 35: Lagom, reactive framework

Next step

● [Documentation] http://www.lagomframework.com

● [Gitter] https://gitter.im/lagom/lagom

● [Github] https://github.com/lagom/lagom

● [Plugin] https://github.com/Fabszn/scaffolding-plugin-lagom

Page 36: Lagom, reactive framework

Merci!