SATURN 2015 Einar Landre, Jrn lmheim, Harald Wesenberg Statoil ASA - - PowerPoint PPT Presentation

saturn 2015 einar landre j rn lmheim harald wesenberg
SMART_READER_LITE
LIVE PREVIEW

SATURN 2015 Einar Landre, Jrn lmheim, Harald Wesenberg Statoil ASA - - PowerPoint PPT Presentation

SATURN 2015 Einar Landre, Jrn lmheim, Harald Wesenberg Statoil ASA Introduction The Case Domain Driven Design Microservices Discussion Data vs Domain Driven Organization and T eam Breaking the Monolith


slide-1
SLIDE 1

SATURN 2015 – Einar Landre, Jørn Ølmheim, Harald Wesenberg – Statoil ASA

slide-2
SLIDE 2

Introduction Discussion

  • The Case
  • Domain Driven Design
  • Microservices
  • Data vs Domain Driven
  • Organization and T

eam

  • Breaking the Monolith
slide-3
SLIDE 3

The Case

slide-4
SLIDE 4

DBR – Drilling Reporting System

Planning and reporting of drilling operations Began as a simple activity log Has evolved into much more over 20 years Client server application

  • 3,5 MLOC
  • 1,5 MLOC PLSQL
  • 1,0 MLOC C#/ APS.NET/Silverlight
  • 1,5 MLOC PowerBuilder

Began as a PowerBuilder / Oracle application

  • Extended with Web later
slide-5
SLIDE 5

Architecture & T echnology

DBR DB

Operations Experiences Risk Cost Estimates Experiences KPI´s Sections Plans

1,5MILL LOC PLSQL

Tightly coupled +10.000LOC procedures Fat Windows Client / Citrix Technological fragmented Scripted business logic

slide-6
SLIDE 6

The T eam

Small (3-5) over very long time

  • +15 years
  • Now two teams 6+4, two locations

Technology segregated

  • Database
  • Power Builder
  • Web (Microsoft Stack)

Vulnerable

  • Dependent on individuals
  • Number of years to retirement

Geographically segregated

  • Stavanger
  • Bergen
slide-7
SLIDE 7

Painpoints

Long lead times for new functionality Convoluted database model Deployment problems (windows client on Citrix) System level testing All in one build bundle Obsolete technology Short time to retirement

slide-8
SLIDE 8

Data User Interface Logic

  • 1. Make implicit concepts explicit.
  • 2. Create functional verticals in a

layered architecture.

  • 3. How to split the database?

Risks Risk Domain Model Risk Service API Risk UI Project Plans Project Planning Domain Model Project Planner Service API Project Planner UI

Way forward

slide-9
SLIDE 9

Domain Driven Design

Domain-Driven Design:

T ackling the complexity in the heart of software Eric Evans, 2003 http://www.domaindrivendesign.org

slide-10
SLIDE 10

An object model of the domain that incorporates both behavior and data. A single instance that handles the business logic for all rows in a database table or view.

  • Transaction Script

Patterns of Enterprise Application Architecture (p. 109-132) – Martin Fowler

Organizes business logic by procedures where each procedure handles a single request from the presentation.

  • T

able Module

  • Domain Model

Three main patterns for organizing the domain logic:

Domain Logic Patterns

slide-11
SLIDE 11

Domain Driven Design – distilled

  • Ubiquitous (domain based) language

− A language that is built around the concepts of the business and that permeates every activity in the project. − The language used to talk about the domain model in the project

  • Patterns for building a domain model
  • Strategic design principles and techniques
slide-12
SLIDE 12

Ubiquitous language – A Domain based language

T echnical Language Domain Language Ubiquitous Language

slide-13
SLIDE 13

Building blocks: Patterns

Domain Drive iven Design gn Servic vices Sma Smart UI Enti titi ties Va Value Objec ects Layer ered ed Arc rchitecture re Repos

  • sitori
  • ries

Aggr ggrega gates Factori

  • ries

Sma Smart Datab abas ase

slide-14
SLIDE 14

Domain Driven Design – Strategic Design

Cont ntex ext Ma Map

Contino nous us Inte tegrati tion Ubiqui uitous us Langu guage ge Share red Ker ernel nel Publis lished ed Langu guage ge Anticorru rruption Layer er Cu Custom

  • mer/

Supplier lier T e T eams Con Conformist Open H en Host Ser ervice Bound unded ed Con Context Sepa para rate Wa Ways Cor Core Do Domai ain Do Domai ain Vision

  • n

Statem ement nt Gen ener eric ic Subdomains ns Seg egreg egated ed Cor Core Highlig hlighted ed Cor Core Abs bstra ract Cor Core

slide-15
SLIDE 15

Strategic design: Context maps

In large systems (or set of systems), we need a map to give us a picture of the models that are inside.

Bounde ded d context xt Bounde ded d context xt Conte text t ma map Rela latio ions

2014-

slide-16
SLIDE 16

Strategic design: Integrity across systems

  • Bounded context

− The meaning of a domain concept is bound by the context it is used

  • Context map

− A map that describe the contexts and their relationships

  • Relation types:

− Shared kernel − Customer/supplier teams − Conformist − Anti-corruption layer − Separate ways − Open host service − Published language

slide-17
SLIDE 17

Strategic design: Types of relations

Ty Type Descrip iptio ion Share red kerne rnel

  • Overlapping models shared among teams

Customer er/supplier devel elopmen ent teams

  • One bounded context is maintained by one team but used by

another Conf nfor

  • rmist
  • As C/S development teams, but the customer team stricly adheres

to the supplier model, without the option to change it. Ant nticorru rruption

  • n l

layer

  • Isolation layer between models that take up the differences

Separ arate te w ways

  • Avoid integration, let the models develop on their own

Op Open h host s ser ervice

  • One system that has an open connection point that can be used

by (many) other systems Publis lished langu guage ge

  • Let the integration be based on a common, well-defined language
slide-18
SLIDE 18

Aggregates

+addProduct() +calculateCost() +getOrderLines() +deleteOrderLine() +create() «aggregate-root» Order

  • price

OrderLine 1 *

  • price

«aggregate-root» Product 1 1 +add() +findAll() +findMatching() OrderRepository 1 * +add() +findAll() +findMatching() ProductRepository 1 * Order aggregate Product aggregate

slide-19
SLIDE 19

…is a way

  • f designing software

as suites of

independently deployable

services

Microservices

slide-20
SLIDE 20
slide-21
SLIDE 21

governance

Independent

Service

Management

Ruby

Agile

Architecture

Skills

Team Cloud

App Engine

REST

Linux

Scala

Kanban

Application Development Mobility

Python Docker

node.js

web services JSON javascript Odata Atom Pub XML

slide-22
SLIDE 22

Smart Endpoints Dumb Pipes

slide-23
SLIDE 23
slide-24
SLIDE 24
slide-25
SLIDE 25

Infrastructure Automation

slide-26
SLIDE 26

Service Interfaces

slide-27
SLIDE 27

Organized around Buisness capabilities

slide-28
SLIDE 28

Conway’s Law

Organizations which design systems … are constrained to produce designs which are copies

  • f the communication structures
  • f these organizations

Melvin E. Conway

slide-29
SLIDE 29

Borrowed from James Lewis and Martin Fowler’s article: http://martinfowler.com/articles/microservices.html

slide-30
SLIDE 30

Borrowed from James Lewis and Martin Fowler’s article: http://martinfowler.com/articles/microservices.html

Inverse Conway maneuver

slide-31
SLIDE 31
  • Rapid provisioning
  • Basic monitoring
  • Rapid Application Development
  • DevOps Culture

Important success criteria

slide-32
SLIDE 32

Data driven vs Domain driven

slide-33
SLIDE 33

Discussion

Domain Driven Design is advocated as the best way

Still we see that the data driven approach dominate

Why?

Object oriented languages used as script languages 1000 or even 10.000 LOC methods are still written

slide-34
SLIDE 34

Data Driven Development

Has its origin in data processing Entry, Validation, Sorting, Summarization, Aggregation, … 1890 US Census Herman Hollerith Punch cards for data storage Electro-Mechanical machines until the 1950ties… COBOL programming language since 1959 …

slide-35
SLIDE 35

Object Oriented Development

Has its origin in simulation of dynamic systems Encapsulation of state and behaviour in “classes” Simula 67 language Ole Johan Dahl / Kristen Nygaard Simplifies the modelling of real-world behaviour Smalltalk, C++, Java, C#, Scala, …. Interception of ICBM’s

slide-36
SLIDE 36

Thoughts on DBR and its likes

Began as a data processing systems With time, more and more dynamic domain’s was added

Record and report performed operations

  • Materials used
  • Difficulties encountered
  • Failures

Planning (re-planning)

  • Automated planning
  • Optimisation
  • Monitoring

Scheduling

  • Cost function
  • Automatic re-scheduling
  • Optimisation

Dynamic domains are addressed with a data driven approach

slide-37
SLIDE 37

Micro-services to the rescue?

Planning & Scheduling

  • Automated planning
  • Multi-agent

Each service can be implemented with the most suitable technology

Analysis

  • R for statistics

Daily reports

  • Data driven
slide-38
SLIDE 38

Novice Advanced Novice Proficient Competent Expert

Knowledge Creativity

You need skills

slide-39
SLIDE 39 2014-04-24 39

Novice Competent Expert

10x 10x

Number of persons

Skills and productivity

slide-40
SLIDE 40

Organization

slide-41
SLIDE 41
slide-42
SLIDE 42

Our T eam

Small (3-5) over very long time

  • +15 years
  • Now two teams 6+4, two

locations T echnologically segregated

  • Database
  • Power Builder
  • Web (Microsoft Stack)
slide-43
SLIDE 43

Why have we not succeded?

slide-44
SLIDE 44 2014-04-24 44

Leadership

Good software leaders are rare

  • How to nurture talents?
  • How to develop the needed skills?

Leading from the front or back?

  • How to build trust?

How to ensure individuals pulls as a team?

slide-45
SLIDE 45

Conway’s Law

Organizations which design systems … are constrained to produce designs which are copies

  • f the communication structures
  • f these organizations

Melvin E. Conway

slide-46
SLIDE 46

Our T eam

Not cross functional

  • Database
  • Power Builder
  • Web (Microsoft Stack)

Vulnerable

  • Dependent on individuals
  • Number of years to retirement

Not co-located

  • Stavanger
  • Bergen
slide-47
SLIDE 47

Our company

Large enterprise organization

  • Divisional structure
  • Multinational
  • Central IT governance

Lacking

  • DevOps culture
  • Infrastructure automation
slide-48
SLIDE 48

Borrowed from James Lewis and Martin Fowler’s article: http://martinfowler.com/articles/microservices.html

slide-49
SLIDE 49

DB Server App Server Web Server

Custom code Custom code Custom code

Platform Custom Platform Development T eam

Group 1 Group 2 Group 3

Actors = 4

slide-50
SLIDE 50

DB Server App Server Web Server

Custom code Custom code Custom code

Platform Custom Platform Development T eam

Actors = 1

slide-51
SLIDE 51

Breaking the Monolith

slide-52
SLIDE 52

How do you eat an elephant?

  • ne bite at a time
slide-53
SLIDE 53

Goals

  • 1. Make it easier to implement new features
  • 2. Make stored data more easily available
  • 3. Simplify build and deployment
  • 4. Modernize technology stack

In short: Optimize delivery of new features and availability of data

slide-54
SLIDE 54

Cost Estimation Risk Profile

DBR

Risk Project Planner Reference Data Daily Reports Benchmarks KPI’s Analysis Experiences Schedules Cost Estimates Operations History

DBR DB (1,5mloc)

Bounded contexts

Monolith

slide-55
SLIDE 55

Risk Profile Project Planning

DBR - Modularized

Risk Project Planner Reference Data Daily Reports Benchmarks KPI’s Analysis Experiences Schedules Cost Estimates Operations History Risk Functionality integrated at each module level as services

  • Internal bus for DBR functionality
  • Services for external data

Daily Reports Project Planner Benchmarks KPI’s Experiences Schedules Analysis Operations History Reference Data Cost Estimates

slide-56
SLIDE 56

How do we get there?

slide-57
SLIDE 57

Making changes

slide-58
SLIDE 58

Extracting a bounded context

slide-59
SLIDE 59
  • 1. Duplicate databases, replicate data
  • 2. Duplicate schemas
  • 3. Views

Database tactics

slide-60
SLIDE 60

DBR

DBR

Risk

Project Planner Reference Data Daily Reports Benchmarks KPI’s Analysis Experiences Schedules Cost Estimates Operations

History

DBR

DBR - Risk

Risk

slide-61
SLIDE 61

DBR

Risk

DBR - Risk

Risk

(NoSQL)

DBR

Project Planner Reference Data Daily Reports Benchmarks KPI’s Analysis Experiences Schedules Cost Estimates Operations

History

slide-62
SLIDE 62

Database refactoring

slide-63
SLIDE 63

Master data

slide-64
SLIDE 64

Master Custo mer R E S T Application Custo mer

Publish/Subscribe Batch Pull

Application

Pull

Application Custo mer

T R A N S F O R M

Publish/Subscribe Batch Pull

slide-65
SLIDE 65

Summary

  • Data-driven monolithic apps
  • Change and adapt your organization
  • Bounded contexts as Microservices
  • Build domain modelling skills
  • Leadership is a critical success factor
slide-66
SLIDE 66

Thank you