In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

49
> Inflight Asset Management Nov 14, 2013

description

Being part of a flagship project that brings next-generation Inflight-Entertainment systems onto passenger aircrafts, Michael Wilmes tackles the operational aspects of managing IT systems in flight, on ground and anywhere in between. He will give insight on what key factors made Neo4j the database of choice during development of a custom tailored asset management application and how Neo4j was integrated using technologies like Spring, Thymeleaf, Bootstrap and D3.js.

Transcript of In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

Page 1: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

>  Inflight Asset Management

Nov 14, 2013

Page 2: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

About us

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 2

Page 3: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 3

§  Lufthansa - leading group of European quality carriers §  more than 103 million passengers in 2012 Passenger Airlines

Catering

Maintenance, Repair & Overhaul (MRO)

Logistics

IT Services

§  Lufthansa Cargo AG - One of the world’s leading cargo airlines

§  1,724 million tons of freight / mail shipped in 2012

§  Lufthansa Systems AG - One of the leading IT service providers for the airline and aviation industry

§  Around 450 customers worldwide, more than 300 airlines

§  LSG Sky Chefs - The world’s largest airline caterer §  Provider of integrated inflight service solutions

§  Lufthansa Technik - worldwide leading provider of maintenance, repair and overhaul services for civil aircraft

§  More than 33 operating subsidiaries and affiliates

Page 4: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

Michael Wilmes

Solution architect @ BoardConnect

► [email protected]

► @theeagermichael

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 4

Page 5: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

The product

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 5

Page 6: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 6

Page 7: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

The problem

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 7

Page 8: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

Business Rules

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 8

Aircrafts

Software

Hardware Lifecycle information

Configuration

Virtual Containers

Content Items Licenses

Page 9: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

How to keep track of what we rolled out?

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 9

Page 10: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

The questions

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 10

Page 11: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

Database How to efficiently store and receive complex data maintaining high performance?

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 11

Page 12: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

Access How to provide easy access to data backend via web proven technologies?

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 12

Page 13: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

Visualization How to visualize complex networks and dependencies?

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 13

Page 14: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

The attitude

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 14

Page 15: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

Radical inclusion

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 15

Page 16: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

Acceptance Accept the complexity and nature of the product. Welcome data were possible. Sense might not be immediately apparent.

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 16

Page 17: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

Embrace change. Product develops at a rapid change. Live with it. Welcome connectivity. API first. Make the added value accessible.

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 17

Page 18: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

The approach

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 18

Page 19: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

Features and Requirements

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 19

Realtime access by aircraft installations and BC suppliers

Asset Management

Constant performance independant of query

type and size of dependency trees

Schema agility to easily accomodate

product innovations.

Configuration Database

Realtime access for unattended device

configuration

Master Data Management

Complete Real-World view of BoardConnect environment as it IS.

Horizontal scale-out possibility

Operational Database

Page 20: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

Does the problem nature really differ from social networks?

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 20

Page 21: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

Actually NO.

Big value lies in the relation of information. Modern approachs targeting the social network world might be equally well suited to asset management problem scopes.

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 21

Page 22: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

The architecture

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 22

Page 23: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

REST API

UI

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 23

Asset Management

Aircraft Data Feed

Media Library

CMS

CMDB

misc. ETL

Page 24: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

>  Development goals

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 24

WebService

Business Logic

Embedded Database

ready for use instantly, grows with the needs

low maintenance efforts, low cost development

easy visualization

whiteboard friendly (instant documentation) embraces change

easy deployment

maps reality 1:1

Page 25: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

The good thing?

§  We start from

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 25

Page 26: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 26 (this is a blank page)

Page 27: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

Spring Framework Why? § Great community backing § Approaching today‘s problems (NOSQL, Enterprise-Integration, REST, Big Data) § Lightweight deployment

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 27

Page 28: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

Neo4j Embedded Why? § Puts the database back into the application domain. § Induces no additional restraints. § Avoiding dead-ends. Provides capable foundation for future queries not yet foreseen. § „What you see is what it is“. Transparency.

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 28

Page 29: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

Neo4j Embedded Why?

A perfect match for the radical inclusion paradigm

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 29

Page 30: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

Spring Data Neo4j Why? § Allows for POJO domain based development § Natural extension of the Spring Data provided programming model § Provides a high level uniform access to the persistence layer while allowing core-API fallback

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 30

Page 31: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

Spring Data REST Why? § Exposes domain objects using auto generated full fledged CRUD controllers § Supports custom DAO queries § Keeps you API on par with your ever evolving domain model

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 31

Page 32: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

Thymeleaf Why? § Natural templates. Finally. § It‘s HTML you write. Well layed out. Standalone. § Easy integration with Spring MVC § Easy to learn and well documented

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 32

Page 33: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

Boostrap Why? § Rapid UI development using CSS § Fallback to JS where needed § Responsive Web Design § Well established framework

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 33

Page 34: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

D3.js Why? § Because it‘s awesome

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 34

Page 35: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

>  Layered architecture, self containment

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 35

Neo4j Embedded

Spring Data Neo4j

Spring Framework

Business Layer

Spring MVC

Thymeleaf

Bootstrap D3.js

Spring Data REST }

.jar

Page 36: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

The application

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 36

Page 37: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

>  Oh my.... A graph!

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 37

D3.js / Autocomplete

Direct access (A

JAX

)

springdata REST

Page 38: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

Implementation

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 38

Page 39: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

>  Use rich relations where possible

Aircraft-[:CONTAINS]->AccessPoint

Aircraft-[:CONTAINS]->Server

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 39

Aircraft-[r:CONTAINS_BCAP]->AccessPoint

Aircraft-[r:CONTAINS_BCS]->Server

X

Page 40: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

>  Graph aware POJO using SDN

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 40

@NodeEntity public abstract class AbstractAsset implements Asset, LastModifiedDateAware, Authored {

@GraphId private Long nodeId;

@NotNull @Indexed(unique = true, level=Level.INSTANCE) private String uuid;

@NotNull @Size(min = 3, max = 50) @Indexed(level=Level.INSTANCE) private String name;

private Date dateLastModified;

Page 41: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

>  SDN provided ApplicationEventHandler (e.g. setting lifecycle properties)

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 41

@Override public void onApplicationEvent(BeforeSaveEvent event) ... { LastModifiedDateAware entity = (LastModifiedDateAware) event.getEntity(); entity.setDateLastModified(new Date()); … }

Page 42: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

...things get even better with Neo4j 2.0 and SDN 3.0, especially §  labels §  optional constrains

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 42

Page 43: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

>  Thymeleaf integration

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 43

Page 44: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

Query examples

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 44

Page 45: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

>  Single question ! Single query ! Instant response…

► What aircrafts have to be supplied with a new SSD in order to remove the movie from being shown to public?

► Are all licenses present that are needed for playback of all movies inside the freshly inserted hard drive on aircraft?

match (bcs)-[:INSTALLED_IN]-()-[:CLONED_FROM]->()-[CONTAINS*]->(video)-->(license) where bcs.name=… return license

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 45

Page 46: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

>  Demo

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 46

Page 47: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

Q & A

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 47

Page 48: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

>  Ressources

Lufthansa Systems – http://www.lhsystems.com Neo4j – http://www.neo4j.org Spring – http://spring.io Spring Data Neo4j - http://www.neo4j.org/develop/spring Spring Data REST - http://projects.spring.io/spring-data-rest Thymeleaf - http://www.thymeleaf.org D3.js - http://d3js.org Bootstrap - http://getbootstrap.com

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 48

Page 49: In-Flight Asset Management with Neo4j - Michael Wilmes @ GraphConnect London 2013

Michael Wilmes

Solution architect @ BoardConnect

► [email protected]

► @theeagermichael

Nov 14, 2013 Inflight Asset Management | Michael Wilmes Chart 49