LHS flight scheduling APP
Scalable architecture with Akka and CQRS.
Andrzej Dębski, Bartłomiej Szczepanik,
Stefan Spahr, Maciej Malawski
AGENDA
- What does it do?
- How does it work?
- Does it scale?
What does it do?
ubiquitous language
- Airplane is assigned to a rotation.
- A rotation consists of legs.
- A leg is a directed relocation of airplane between two airports at given date.
- A flight consist of legs and has a flight designator.
- Each airport defines standard ground time which is the minimum time that airplane have to spend on ground between consecutive legs.
- One can check if all legs in a rotation hold continuity property, does not violate standard ground times and flight numbers are not duplicated.
Rotations EXAMPLE

continuity check example

ground time check example

flight designator check example

import example


REST API - THE write side
- POST /abstract-leg
- POST /airplane
- POST /airplane/assign-rotation
- POST /rotation
- DELETE /rotation/:id
- POST /rotation/add-leg
- POST /rotation/remove-leg
- POST /import
REST API - THE READ side
- GET /rotation
- GET /rotation/:id
- GET /airplane
- GET /airplane/:id
- GET /checks/neo4j?checkType=groundTime
- GET /checks/neo4j?checkType=flightDesignator
- GET /checks/neo4j?checkType=rotationContinuity
- GET /checks/inMemory?checkType=groundTime
- GET /checks/inMemory?checkType=flightDesignator
- GET /checks/inMemory?checkType=rotationContinuity
DEMO I
it actually works
How does it work?
building blocks






Event sourcing

Command query responsibility segratation

Application architecture

Life of an event



LIFE of an event



LIFE of an event



LIFE of an event



LIFE of an event



main challenges
- Event sourcing
- solution: akka-persistence
- Replayable event bus
- solution: own on top of Kafka and Cassandra
- Load balancing
- solution: akka-clustering routers
does it scale?
Read model scalability

Life of a read model



Life of a read model



LIFE of a query



Life of a query


write model scalability - soon

akka-cluster-sharding
tools
- Ansible
- Kamon
- Zipkin
- Akka tracing
- Gatling
- Akka clustering JMX
- Visual VM
- SBT
DEMO II
scale out!
discussion
Stefan Spahr
stefan.spahr@lhsystems.com
Andrzej Dębski
andrzejdebski91 @ gmail.com
Flight scheduling application
By mequrel
Flight scheduling application
- 1,364