99
„Multi-Channel“-Architecture Lars Röwekamp | CIO New Technologies | @mobileLarson open knowledge | #WISSENTEILEN

Herausforderung „Multi-Channel“-Architektur

Embed Size (px)

Citation preview

„Multi-Channel“-ArchitectureLars Röwekamp | CIO New Technologies | @mobileLarson

open knowledge | #WISSENTEILEN

Branchenneutrale Softwareentwicklung und IT-Beratung

ÜBER OPEN KNOWLEDGE

#WISSENTEILEN

Lars Röwekamp (a.k.a. @mobileLarson)

ÜBER MICH

LR

#WISSENTEILEN

Wer bin ich - und wen ja, wie viele?

• CIO New Technologies • Enterprise & Mobile • Author, Speaker, Coach & Mentor

• Snowboard & MTB Enthusiast• dreifacher Vater, einfacher Ehemann

#WISSENTEILEN

„Multi-Channel? Warum?“

Motivation

#WISSENTEILEN

Motivation

#WISSENTEILEN

„The Mindshift“

#WISSENTEILEN

„The expectation that I can get what i want in my immediate context and moments of need!“

#WISSENTEILEN

„Mindshift“ in ... Verhalten, Erwartungen, Kontrolle

#WISSENTEILEN

„Multi-Channel, na klar!Wo liegt das Problem?“

Motivation

#WISSENTEILEN

Motivation

#WISSENTEILEN

Motivation

#WISSENTEILEN

Motivation

#WISSENTEILEN

Responsiveness

#WISSENTEILEN

Responsiveness

#WISSENTEILEN

Multi-Channel?

Responsiveness

#WISSENTEILEN

Cross-Channel?

Responsiveness

#WISSENTEILEN

Omni-Channel!

Responsiveness

#WISSENTEILEN

Responsiveness

Single-Channel(a.k.a. „the Past“)

Multi-Channel(a.k.a. „the Reality“)

Cross-Channel(a.k.a. „the Wannabe“)

#WISSENTEILEN

Responsiveness

Omni-Channel(a.k.a. „the far-far-away Future“)

#WISSENTEILEN

Responsiveness

Hmmm, kind of Fail?

#WISSENTEILEN

Responsiveness

#WISSENTEILEN

What‘s the Problem?It‘s old but not sooo bad.

#WISSENTEILEN

Architektur

#WISSENTEILEN

A responsive Monolithis still a Monolith!

Multi-Channel Architecture

Monolith

#WISSENTEILEN

• Umsetzung von Features dauert zu lange• Architektur-Qualität nimmt ab (an Bedeutung)• Qualität verwässert• Technologische „Schulden“ sind bekannt• „-ility“ Probleme wohin man schaut• Deplyoment ist kompliziert und dauert lang• Skalierung hat Limit erreicht• Replacement/Refactoring ist zu teuer

#WISSENTEILEN

Monolith meets„Time to Market“

#WISSENTEILEN

Architektur

Resources vs. Views

#WISSENTEILEN

Architektur

#WISSENTEILEN

Architektur

#WISSENTEILEN

Heavy Load

#WISSENTEILEN

Requst / Responsevs.

Event / Notification

Architektur

#WISSENTEILEN

Architektur

#WISSENTEILEN

Architektur

#WISSENTEILEN

Skalierung?

#WISSENTEILEN

ArchitekturYou want to be here!

#WISSENTEILEN

Domain vs. Application

Architektur

#WISSENTEILEN

Architektur

#WISSENTEILEN

Architektur

#WISSENTEILEN

Architektur

#WISSENTEILEN

Autonomie?

#WISSENTEILEN

Architektur

Application Servervs.

Platform Service

#WISSENTEILEN

Architektur

#WISSENTEILEN

Architektur

#WISSENTEILEN

Oh, my god!

#WISSENTEILEN

Microservices! PaaS!

#WISSENTEILEN

TODOYeah, all Work done!

#WISSENTEILEN

TODOReally? ALL Work done?

#WISSENTEILEN

Architektur

#WISSENTEILEN

Distributed System

#WISSENTEILEN

Versionierung?ErrorHandling?Caching&Sync?

Security?Analytics?

#WISSENTEILEN

Versionierung?

Multi-Channel Architecture

Versionierung

#WISSENTEILEN

• Client/Service entwickeln sich unterschiedlich• Request /Response passen nicht zueinander

• Fehlende/unbekannte Request Attribute• Fehlende/unbekannte Response Attribute

• Geänderte Semantik von Attributen • Geänderte Semantik von Defaults

Multi-Channel Architecture

Versionierung

#WISSENTEILEN

Best Practices strategisch

• so lang wie möglich verhindern• enge Koppelung vermeiden• Consumer-Driven Contracts

• Semantic Versioning (Major.Minor.Patch)• Koexistenz verschiedener Endpoints• konkurierende Service Versionen

#WISSENTEILEN

Versionierung

#WISSENTEILEN

Versionierung

#WISSENTEILEN

Versionierung

#WISSENTEILEN

Versionierung

#WISSENTEILEN

Versionierung

#WISSENTEILEN

Versionierung

Multi-Channel Architecture

Versionierung

#WISSENTEILEN

Best Practices technisch

• gar nicht• gar nicht (via neue Ressourcen) • gar nicht (via erweiterbarer Datenformate)• Versionsnummer in der URL• Version Request Header• Content Negotiation

Multi-Channel Architecture

Versionierung

#WISSENTEILEN

// Versioning via multiple resources

// GET all ordersGET /orders HTTP/1.1

// GET all newordersGET /neworders HTTP/1.1

Multi-Channel Architecture

Versionierung

#WISSENTEILEN

// Versioning via adaptable data format

{ "items" : [ {"name" : "coffee","quantity" : 1,"milk" : "semi","size" : "large",

} ],"location" : ”take-away"

}

Multi-Channel Architecture

Versionierung

#WISSENTEILEN

// Versioning via adaptable data format

{ ”items" : [ {"name" : "coffee","quantity" : 1,"milk" : "semi","size" : "large","price" : "4.00 USD"

} ],"location" : "take-away"

}

Multi-Channel Architecture

Versionierung

#WISSENTEILEN

// Versioning via adaptable data format

{ ”items" : [ {"name" : "coffee","quantity" : 1,"milk" : "semi","size" : "large","price" : "4.00 USD"

} ],“total-price" : "4.00 USD""location" : "take-away"

}

Multi-Channel Architecture

Versionierung

#WISSENTEILEN

// Versioning via adaptable data format

{ ”items" : [ {"name" : "coffee","quantity" : 1,"milk" : "semi","size" : "large","price" : "4.00 USD"

} ],“price" : "4.00 USD""location" : "take-away"

}

„Areyou atolerantreader?“

Multi-Channel Architecture

Versionierung

#WISSENTEILEN

// Versioning via URL (default version)GET /orders/1234 HTTP/1.1[various other headers]

// Versioning via URL (version part of path)GET /v2/orders/1234 HTTP/1.1[various other headers]

// Versioning via URL (as request parameter)GET /orders/1234?ver=v2 HTTP/1.1[various other headers]

Multi-Channel Architecture

Versionierung

#WISSENTEILEN

// Versioning via Header(default version)GET /orders/1234 HTTP/1.1

// Versioning via Version Header GET /orders/1234 HTTP/1.1Api-version: 2.1

// Versioning via Accept HeaderGET /orders/1234 HTTP/1.1Accept: application/vnd.abc.xyz.v2.1+json

#WISSENTEILEN

Errors?

Multi-Channel Architecture

Error Handling

#WISSENTEILEN

„Is it a bug or a feature?“

• Error Handling• Compensation Algorithm

Multi-Channel Architecture

Error Handling

#WISSENTEILEN

Status Codes - Pro Tipp: Use them!

• 1xx: Hold on ...• 2xx: Here you go!• 3xx: Go away!• 4xx: You f#!?ed up!• 5xx: I f#!?ed up!

Facebook„Always200“Anti-Pattern

Multi-Channel Architecture

Error Handling

#WISSENTEILEN

Multi-Channel Architecture

Error Handling

#WISSENTEILEN

// POST a request for some async workloadPOST /asynccall ... HTTP/1.1[various other headers]

// Response with no payload, because it is// not calculated yetHTTP/1.1. 202 Accepted

Multi-Channel Architecture

Error Handling

#WISSENTEILEN

// DELETE order with id 1234DELETE /orders/1234 HTTP/1.1[various other headers]

// Order successfully deleted. Response has// no content (by purpose)HTTP/1.1. 204 No content

Multi-Channel Architecture

Error Handling

#WISSENTEILEN

// Response with error payloadHTTP/1.1 403 ForbiddenContent-Type: application/problem+jsonContent-Language: en{ "type": https://example.com/no-credit,

"title": “You have not enough credit.“,"detail": "Your balance is 30, but ...“,"instance": "/account/12345/msgs/abc“,"balance": 30,"accounts": ["/account/12345", "/account/67890”]

}

Multi-Channel Architecture

Error Handling

#WISSENTEILEN

Manchmal kommt es anders als man denkt!

• „Code for Code“• „Message for People“• „Payload and Format“

• Kein Stacktrace• Exception Mapper als Provider

Multi-Channel Architecture

Error Handling

#WISSENTEILEN

// JAX-RS Exception Handler Example@Providerpublic class MyAppExceptionHandler implements

ExceptionMapper<MyAppError> {@Overridepublic Response toResponse(MyAppError error){

return Response.status(Status.BAD_REQUEST).entity(error.getMessage()).build();

}}

Multi-Channel Architecture

Error Handling

#WISSENTEILEN

Compensation Algorithm

• Transactions • Eventual Consistency• Service not available

„Starbucksdoes notuseTwo-PhaseCommit“

http://www.enterpriseintegrationpatterns.com/ramblings/18_starbucks.html

#WISSENTEILEN

Caches&Sync?

Multi-Channel Architecture

Caching

#WISSENTEILEN

Always remember: „The Web is your Friend“

• das Web bietet tolle Möglichkeiten • RESTful Service nutzen das Web bzw. HTTP

Multi-Channel Architecture

Caching

#WISSENTEILEN

Aber wer cached eigentlich was?

• Client (Web Browser, REST Client, ...) • Proxy Caches („man in the middle cache“)• Content Delivery Networks (CDNs)

Multi-Channel Architecture

Caching

#WISSENTEILEN

Wie funktioniert HTTP Caching?

• Expires Header (HTTP 1.0)• Cache-Control (HTTP 1.1)

• Revalidation & Conditional GETs

Multi-Channel Architecture

Caching

#WISSENTEILEN

Expires Header (HTTP 1.0)

• Hint, ob Daten noch gültig sind oder nicht

Expires: Tue, 22 DEC 2015 16:00 GMT

Multi-Channel Architecture

Caching

#WISSENTEILEN

Cache Control (HTTP 1.1)

• deutlich genauere Cache-Steuerung als bei Expires Header

• private, public• no-cache• no-store• no-transform• max-age, s-maxage

Multi-Channel Architecture

Caching

#WISSENTEILEN

Revalidation & Conditional GET (HTTP 1.1)

• Prüfung, ob Cache-Daten wirklich invalide• Server sendet Header zur Prüfung zurück

• Last-Modified• Etag

#WISSENTEILEN

Analytics?

Multi-Channel Architecture

Analytics

#WISSENTEILEN

Wider dem Kontrollverlust: Analytics als Grundlage für strategische Entscheidungen

• Was macht der User eigentlich?• Und in welchem Kontext?

• Werden meine Daten genutzt?• Und wenn ja, wie?

Multi-Channel Architecture

Analytics

#WISSENTEILEN

Schritt 1: notwendige Daten identifizieren

• Was sind die Business relevanten Metriken?• Was sind die technischen Metriken? • Was sind weitere Erfolgsmetriken?

Multi-Channel Architecture

Analytics

#WISSENTEILEN

Schritt 2: Nutzbarkeit prüfen

• Kann ich die gewünschten Daten sammeln?• Habe ich die notwendigen Analysetools?• Habe ich die notwendige Analyseerfahrung?

Multi-Channel Architecture

Analytics

#WISSENTEILEN

Monitore deine Ratings

• Ratings unbedingt ernst nehmen!• Bester Kanal hin zu den Nutzern

• Nächstes Feature ist wahrscheinlich schon alsReview in den Ratings und nicht im Backlog

Multi-Channel Architecture

Analytics

#WISSENTEILEN

Monitore deinen Traffic

• Erkennen von Serverproblemen• Probleme werden auf den Client geschoben.

• BTW: App ist nicht Web - einmal deinstalliert ist immer deinstalliert!

Multi-Channel Architecture

Analytics

#WISSENTEILEN

Monitore deine UX

• Nutzerverhalten verstehen lernen• Client Performance messen• Netzwerklatenz erkennen

• In welchen Ländern/Regionen?• Auf welchen Geräten/Browsern?

#WISSENTEILEN

FAZIT

Mutli-Channel Architecture

Fazit

#WISSENTEILEN

„Mit Multi-Channel verlagere ich bestehendes Business.

Mit Omni-Channel generiere ich neues Business!“

#WISSENTEILEN

Mutli-Channel Architecture

Fazit

#WISSENTEILEN

„Time-to-Market“ via

• Resources statt Views• Events statt Request/Response• Domain Services statt Application• Modularization statt Monolith

Omni___

FRAGEN

? ? ?#WISSENTEILEN

LARS RÖWEKAMPCIO NEW TECHNOLOGIES

[email protected]+49 (0)441 4082 – 101

@mobileLarson@_openknowledge

OFFENKUNDIGGUT

KONTAKT

#WISSENTEILEN

#1: © Rawpixel.com - shutterstock.com#6: © OneinchPunch- fotolia.com#40: © g-stockstudio – shutterstock.com#82: © tomer_turjeman – fotolia.com

#84: © Peshkova - shutterstock.com

All other pictures inside this presentation orginate from pixabay.com.

BILDNACHWEISE

#WISSENTEILEN