SlideShare a Scribd company logo
© OPITZ CONSULTING 2018
s
¢¢¢ überraschend mehr Möglichkeiten!
© OPITZ CONSULTING 2018
Sven Bernhardt, Danilo Schmiedel
Serverless architectures
with Fn Project
© OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 2
OPITZ CONSULTING - A success story since 1990
¢ Our Mission: Help organizations to leverage the possibilities of
digitalization to be different, better and faster than their competitors
¢ Owner-led company with
¢ 450+ consultants
¢ 11 locations in Germany and Poland
Danilo Schmiedel
¢
¢ Senior Managing Consultant
¢ Business Development and Innovation
About us
Sven Bernhardt
¢ Senior Solution Architect
¢ Technical Lead for API Management
© OPITZ CONSULTING 2018 Seite 3
Agenda
1
2
3
5
Serverless, FaaS, BaaS
Fn Project
Fn Flow
Summary
Serverless architectures with Fn Project
4 Use Cases and Scenarios
© OPITZ CONSULTING 2018 Seite 4
Serverless, FaaS and BaaS
1
Serverless architectures with Fn Project
© OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 5
Serverless standard picture
¢ Serverless != No Server => Just means someone else‘s computer
https://www.flickr.com/photos/91707070@N03/8331732961
Source: https://bit.ly/2zeliT9
Serverless = Exit door from traditional IT operations,
since no Servers are needed anymore?
Clearly no! Serverless just mean that your code is
running on someone elses computer somewhere,
somehow and you don‘t have to care about it.
© OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 6
Promises of Serverless
¢ Easier: Just think about your code, not infrastructure
¢ Powerful: Transparent and limitless scaling
¢ Faster: Deploy faster, iterate faster, innovate faster
¢ Cheaper: Only pay for what you use (never idle)
Source: https://bit.ly/2QSP0nd
© OPITZ CONSULTING 2018 Serverless architectures with Fn Project
Serverless Manifesto by Potes & Nair (AWS)
¢ Functions are the unit of deployment and scaling
¢ No machines, VMs, or containers visible in the programming model
¢ Permanent storage lives elsewhere
¢ Scales per request: Users cannot over- or under-provision capacity
¢ Never pay for idle (no cold servers/containers or their costs)
¢ Implicitly fault-tolerant because functions can run anywhere
¢ BYOC — Bring Your Own Code
¢ Metrics and logging are a universal right
Seite 7
© OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 8
Characteristics of a Function
¢ Granular compute unit in Serverless
¢ Short-lived
¢ Ephemeral
¢ Stateless
¢ Scalable
¢ Event-Driven
¢ Single Purpose
¢ Self-contained
¢ Function has one output for a specific input Function f
Input x
Output f(x)
© OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 9
Serverless, FaaS and BaaS
¢ Serverless: Abstraction of infrastructure and its operations including
provisioning, scaling, patching, etc.
¢ Serverless applications significantly depend on third-party services
¢ A Serverless Computing Platform may provide one or both of:
¢ Functions-as-a-Service:
¢ Compute component in a serverless platform
¢ Custom Code that runs in ephemeral containers
¢ Backend-as-a-Service:
¢ Third-party API-based services
¢ Replaces core subsets of functionality in an application
© OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 10
Evolution of application architectures
Monolithic
architectures
µService
architectures
Serverless
architectures
f(a1) f(a2)
f(a3) f(a4) f(b4)f(b3)
f(b2)f(b1)
f(c3) f(c4)
f(c2)f(c1) f(d1) f(d2)
f(d3) f(d4)
Ø Single application
Ø Mixed data from different
business context
Ø Mixed business logic
Ø Application consists of
different µService
Ø Business logic and data
belong to a bounded
business context
Ø Application consists of
multiple functions
Ø Fine-granular logic for a
specific step, data resides
externally
© OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 11
Serverless: Focus on implementing business logic
© OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 12
Serverless and Cloud-Native technologies
Source: https://bit.ly/2S5tgoH
© OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 13Source: https://bit.ly/2CJaco4
© OPITZ CONSULTING 2018 Seite 14
Fn Project
2
Serverless architectures with Fn Project
© OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 15
About Fn Project
¢ Open-source Functions-as-a-Service compute platform (Apache 2.0
licence)
¢ Easy to use for developers
¢ Easy to manage for operators
¢ Active large core team, 3500+ commits, 75+ contributors
¢ Members on the CNCF serverless working group
¢ Native CloudEvents support (https://cloudevents.io/)
¢ Specification for describing event data in a common way
¢ Event declaration and delivery across services and platforms
© OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 16
Fn Project architecture
¢ Written in Go
¢ Container-based: Leverages Docker
¢ Run anywhere:
¢ Cloud
¢ On-Premise Datacenter
¢ Local development environment
© OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 17
Fn Project runtime
¢ Fn is runtime-agnostic
¢ Can be targeted to run on Kubernetes (K8s)
¢ K8s optimizations are WIP
¢ Plans for deeper K8s integration using CRDs
¢ Helm chart available to install to K8s (https://bit.ly/2S1bvXm)
¢ Runtime monitoring:
¢ Prometheus support for metrics collection
¢ Metrics visualization with Grafana
© OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 18
Function in Fn
¢ Small chunk of code wrapped into a container image
¢ Developers just need to care about business logic
¢ Function is wrapped in a Container Image
¢ Function is defined and deployed within an app
¢ Functions are written in code
Function f
STDIN
(Input)
STDOUT
(Output)
STDERR
(Logs)
© OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 19
Wait! Functions and Containers... What the heck?
¢ Serverless Manifesto says: „No machines, VMs, or containers visible in the
programming model“ à So Fn Project is not really Serverless, right?
¢ Fn is FaaS, the underlying platform needs to ensure that
¢ Developer does not need to care about the containers and the technical stuff belonging to
it (Build, Deploy, Run....)
¢ Users does not need to pay for idle containers
¢ Function is capable to scale automatically and infinitetly
¢ Advantage of the container-based approach is increased iteroperability
(no vendor lock-in)
¢ Other Container-based FaaS Frameworks: Kubeless, Fission
© OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 20
Function development
¢ Multi language support through Function Developer Kit (FDK)
¢ FDKs comprise of different building blocks, like
¢ Language-specific Fn libraries
¢ Build-Time Docker images
¢ Minimal runtime Docker images
¢ Fn CLI is used to manage and create Functions
© OPITZ CONSULTING 2018 Serverless architectures with Fn Project
Serverless Manifesto and Fn Project
¢ Functions are the unit of deployment and scaling ✓
¢ No machines, VMs, or containers visible in the programming model ✓
¢ Permanent storage lives elsewhere ✓
¢ Scales per request: Users cannot over- or under-provision capacity
¢ Never pay for idle (no cold servers/containers or their costs)
¢ Implicitly fault-tolerant because functions can run anywhere
¢ BYOC — Bring Your Own Code ✓
¢ Metrics and logging are a universal right ✓
Seite 21
© OPITZ CONSULTING 2018 Seite 22
Demo - Function development
Serverless architectures with Fn Project
© OPITZ CONSULTING 2018 Seite 23
Fn Flow
3
Serverless architectures with Fn Project
© OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 24
Building advanced functions with Fn Flow
¢ Build reliable and scalable FaaS applications with functions
¢ Flow functions are written purely in code
¢ Build distributed applications
¢ Provides rich concurrency primitives including fork-join, chaining,
delays and error handling
¢ Testable using standard programming tools and mechanisms (e.g.
Unit tests)
© OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 25
Fn Flow compared to workflow solutions
¢ No context-switching, beause everything is code
¢ Leverage full power of the used programming language
¢ More powerful errorhandling capabilities
¢ Easy, consistent and comprehensible data and context handling
¢ Highly functional approach for implementing the flow
¢ Might be hard to read and understand for non-technicians
© OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 26
Example Use Case Fn Flow: Saga
¢ Microservice Pattern: Saga defined
by Chris Richardson
¢ Specifically: Orchestration-based
Saga
Source: https://microservices.io/patterns/data/saga.html
© OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 27Source: https://github.com/fnproject/tutorials/blob/master/FlowSaga/images/1-travel-app.png
© OPITZ CONSULTING 2018 Seite 28
Use Cases and Scenarios
4
Serverless architectures with Fn Project
© OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 29
10 common use cases for Serverless platforms
© OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 30
Serverless Best Practices
1. Each function should do only one thing
2. Functions don‘t call other functions
3. Use as few libraries in your functions as possible
4. Avoid using connection based services (use services rather than
connections)
5. One function per route (if using HTTP)
6. Learn to use messages and queues
7. Data flows, not data lakes
8. Just coding for scale is a mistake, you have to consider how it scales
(c) Paul Johnsten, ServerlessDays CoFounder
© OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 31
Severless & Enterprise Integration Patterns (EIP)
¢ EIPs try to address integration problems based on
messaging
¢ In EIPs there are definitions for basic components that
are used to implement integrations, like
¢ Channels
¢ Splitter
¢ Aggregator
¢ Router …
Source: https://www.enterpriseintegrationpatterns.com/patterns/messaging/Filter.html
© OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 32
Example: EIP Message Translator
System A System B
X
f(x) getData f(x) sendDataf(x) transformData
https://www.enterpriseintegrationpatterns.com/patterns/messaging/MessageTranslator.html
© OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 33
Example: EIP Message Splitter and Router
System A
System C
System B
f(x) getData f(x) splitData f(x) routeDataToC
f(x) routeDataToB
© OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 34
When is FaaS adequate for integration?
¢ Typical use cases:
¢ Batch processing, which takes place on regular schedules
¢ Event processing
¢ Considerations to make:
¢ Number of invocations
¢ Keep runtime short
¢ Serverless Platforms will terminate long-running Functions
¢ Don‘t block HW resources for too long
© OPITZ CONSULTING 2018 Seite 35
Summary
5
Serverless architectures with Fn Project
© OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 36
Summary
¢ Functions are first class citizens
¢ Fn Project is a
¢ Framework for implementing FaaS-style applications
¢ But is not a Serverless framework (no Serverless runtime available)
¢ FaaS is good for the right use cases, but it‘s no silver bullet!
¢ Strength of Fn Project: No vendor lock-in!
¢ FaaS provides new opportunities for implementing applications
¢ Event-based, scalable and ephemeral
¢ Stateless
¢ Infinitely scalable (in theory)
© OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 37
With great power, comes great responsibility...
¢ Rethink the traditional application architectures!
Client
API Gateway
IDM /
Authentication
PlaceOrder
SearchProducts
POST /api/v1/orders
GET /api/v1/products
CreateInvoiceCheckoutWarehouse
Event Hub
OrderCreated
OrderCreatedOrderCreated
© OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 38
Links and Resources
¢ Fn Project: http://fnproject.io
¢ Github Fn Project: https://github.com/fnproject
¢ CNCF Whitepaper Serverless: https://bit.ly/2S5tgoH
¢ CloudEvents: https://cloudevents.io/
¢ Enterprise Integration Patterns:
https://www.enterpriseintegrationpatterns.com
¢ Microservices Patterns: https://microservices.io
© OPITZ CONSULTING 2018 Seite 39Serverless architectures with Fn Project
Q & A
© OPITZ CONSULTING 2018
¢¢¢ überraschend mehr Möglichkeiten!
@OC_WIRE OPITZCONSULTING opitzconsultingWWW.OPITZ-CONSULTING.COM
Seite 40
Contact us!
Danilo Schmiedel
Senior Managing Consultant Solutions | Oracle ACE Director
OPITZ CONSULTING Deutschland GmbH
Tempelhofer Weg 64, 12347 Berlin, Germany
Phone: +49 173 7279001
Mail: danilo.schmiedel@opitz-consulting.com
@dschmied
http://inside-bpm-and-soa.blogspot.com
Sven Bernhardt
Senior Solution Architect | Oracle ACE
OPITZ CONSULTING Deutschland GmbH
Kirchstrasse 6, 51647 Gummersbach, Germany
Phone: +49 172 2193529
Mail: sven.bernhardt@opitz-consulting.com
@sbernhardt
https://svenbernhardt.wordpress.com
Serverless architectures with Fn Project

More Related Content

PDF
Ich brauche einen Abstraktions-Layer für meine Cloud
PPTX
betterCode Workshop: Effizientes DevOps-Tooling mit Go
PDF
Clean Infrastructure as Code
PDF
CQRS - Eine Einführung - NOUG 2011
PDF
Cloud-native is just part of the game
PDF
Go for Operations
PDF
Kubernetes für Workstations Edge und IoT Devices
PDF
Cicd pixelfederation
Ich brauche einen Abstraktions-Layer für meine Cloud
betterCode Workshop: Effizientes DevOps-Tooling mit Go
Clean Infrastructure as Code
CQRS - Eine Einführung - NOUG 2011
Cloud-native is just part of the game
Go for Operations
Kubernetes für Workstations Edge und IoT Devices
Cicd pixelfederation

What's hot (20)

PDF
Continuous (Non)-Functional Testing of Microservices on k8s
PDF
Continuous (Non-)Functional Testing of Microservices on K8s
PPTX
Rancher master class globalized edge workloads with k3s
PDF
8.cncf en
PDF
High-Performance FAAS with Nuclio
PDF
[DevConf.US 2019]Quarkus Brings Serverless to Java Developers
PDF
Real World CI/CD with Kubernetes
PPTX
K8s from Zero to ~Hero~ Seasoned Beginner
PDF
Knative makes Developers Incredible on Serverless
PDF
Enabling Cloud Native Buildpacks for Windows Containers
PDF
Building and Running Workloads the Knative Way
PDF
Cloud-Native Modernization or Death? A false dichotomy. | DevNation Tech Talk
PDF
Cloud-Native Drupal: a survival guide
PDF
How we can do Multi-Tenancy on Kubernetes
PDF
E bpf and profilers
PDF
Quarkus: From developer joy to Kubernetes nirvana! | DevNation Tech Talk
PDF
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...
PDF
OpenShift pour le developpement cloud native - 20171214
PDF
Integracia security do ci cd pipelines
PDF
Introduction to Kubernetes and GKE
Continuous (Non)-Functional Testing of Microservices on k8s
Continuous (Non-)Functional Testing of Microservices on K8s
Rancher master class globalized edge workloads with k3s
8.cncf en
High-Performance FAAS with Nuclio
[DevConf.US 2019]Quarkus Brings Serverless to Java Developers
Real World CI/CD with Kubernetes
K8s from Zero to ~Hero~ Seasoned Beginner
Knative makes Developers Incredible on Serverless
Enabling Cloud Native Buildpacks for Windows Containers
Building and Running Workloads the Knative Way
Cloud-Native Modernization or Death? A false dichotomy. | DevNation Tech Talk
Cloud-Native Drupal: a survival guide
How we can do Multi-Tenancy on Kubernetes
E bpf and profilers
Quarkus: From developer joy to Kubernetes nirvana! | DevNation Tech Talk
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...
OpenShift pour le developpement cloud native - 20171214
Integracia security do ci cd pipelines
Introduction to Kubernetes and GKE
Ad

Similar to Serverless architectures with Fn Project (20)

PPTX
TechEvent Servlerless Computing with Fn Project
PDF
Serverless Computing with Fn Project
PPTX
The FN Project by Maximilian Jerg
PDF
Introduction to Serverless through Architectural Patterns
PPTX
Functions and DevOps
PPTX
An introduction to Serverless
PPTX
Building Serverless Microservices Using Serverless Framework on the Cloud
PPTX
Serverless design with Fn project
PDF
ApiOps Tampere meetup 17.11.2017- serverless_with_openfaas
PDF
Java Serverless in Action - Voxxed Banff
PDF
Serverless brewbox
PDF
Free the Functions with Fn project!
PPTX
Serverless Presentation from Devoxx 2017 Casablanca (AWS Lambda / FaaS / Fn ...
PDF
It's a Serverless World
PPTX
Democratizing Serverless
PPTX
Building Cross-Cloud Platform Cognitive Microservices Using Serverless Archit...
PPTX
The Architectural Thinking Behind Full Stack Serverless
PDF
FaaS you like it (if Shakespeare had written Functions-as-a-Service)
PPTX
Serverless Architectures
PDF
Where can you use serverless?  How does it relate to APIs, integration and mi...
TechEvent Servlerless Computing with Fn Project
Serverless Computing with Fn Project
The FN Project by Maximilian Jerg
Introduction to Serverless through Architectural Patterns
Functions and DevOps
An introduction to Serverless
Building Serverless Microservices Using Serverless Framework on the Cloud
Serverless design with Fn project
ApiOps Tampere meetup 17.11.2017- serverless_with_openfaas
Java Serverless in Action - Voxxed Banff
Serverless brewbox
Free the Functions with Fn project!
Serverless Presentation from Devoxx 2017 Casablanca (AWS Lambda / FaaS / Fn ...
It's a Serverless World
Democratizing Serverless
Building Cross-Cloud Platform Cognitive Microservices Using Serverless Archit...
The Architectural Thinking Behind Full Stack Serverless
FaaS you like it (if Shakespeare had written Functions-as-a-Service)
Serverless Architectures
Where can you use serverless?  How does it relate to APIs, integration and mi...
Ad

More from Sven Bernhardt (20)

PDF
The integration revolution: Building bridges between On-premises and Cloud ec...
PDF
Efficient development of smart apps: The role of AI gateways
PDF
Next-level Kubernetes Service Management with an API gateway
PDF
Effective and simple - integration architectures with Apache Camel and Quarkus
PDF
One Gateway to Rule them All: Building a Federated API Management Platform
PDF
Modernization options for Oracle Forms applications
PDF
Elevating Development: Embracing APIOps for Enhanced Developer Productivity
PDF
Kong 101 - Jumpstart into the world of APIs
PDF
Declarative observability management for Microservice architectures
PDF
Integration architectures based on Microservices, APIs and events
PDF
Build and Manage Multi-Cloud Applications Using Kuma
PDF
Build and Manage Multi-Cloud Applications Using Kuma
PDF
Torch the light - Implementing Observability for Microservice Architectures
PDF
Analytics meets Integration - Modern Development with Data APIs
PDF
Modern Integration based on OCI Cloud-native Services
PDF
Service Mesh Advanced Use Cases
PDF
Cloud-native Application Development on OCI
PDF
Rumble in the Jungle - API Kickstart with Kong
PDF
Cloud-native Application Development - The new normal
PDF
Efficient API delivery with APIOps
The integration revolution: Building bridges between On-premises and Cloud ec...
Efficient development of smart apps: The role of AI gateways
Next-level Kubernetes Service Management with an API gateway
Effective and simple - integration architectures with Apache Camel and Quarkus
One Gateway to Rule them All: Building a Federated API Management Platform
Modernization options for Oracle Forms applications
Elevating Development: Embracing APIOps for Enhanced Developer Productivity
Kong 101 - Jumpstart into the world of APIs
Declarative observability management for Microservice architectures
Integration architectures based on Microservices, APIs and events
Build and Manage Multi-Cloud Applications Using Kuma
Build and Manage Multi-Cloud Applications Using Kuma
Torch the light - Implementing Observability for Microservice Architectures
Analytics meets Integration - Modern Development with Data APIs
Modern Integration based on OCI Cloud-native Services
Service Mesh Advanced Use Cases
Cloud-native Application Development on OCI
Rumble in the Jungle - API Kickstart with Kong
Cloud-native Application Development - The new normal
Efficient API delivery with APIOps

Recently uploaded (20)

PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPT
Teaching material agriculture food technology
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Cloud computing and distributed systems.
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Big Data Technologies - Introduction.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Electronic commerce courselecture one. Pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Teaching material agriculture food technology
Mobile App Security Testing_ A Comprehensive Guide.pdf
Cloud computing and distributed systems.
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Spectral efficient network and resource selection model in 5G networks
Diabetes mellitus diagnosis method based random forest with bat algorithm
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
The AUB Centre for AI in Media Proposal.docx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Big Data Technologies - Introduction.pptx
Encapsulation_ Review paper, used for researhc scholars
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
MIND Revenue Release Quarter 2 2025 Press Release
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Unlocking AI with Model Context Protocol (MCP)
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Electronic commerce courselecture one. Pdf

Serverless architectures with Fn Project

  • 1. © OPITZ CONSULTING 2018 s ¢¢¢ überraschend mehr Möglichkeiten! © OPITZ CONSULTING 2018 Sven Bernhardt, Danilo Schmiedel Serverless architectures with Fn Project
  • 2. © OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 2 OPITZ CONSULTING - A success story since 1990 ¢ Our Mission: Help organizations to leverage the possibilities of digitalization to be different, better and faster than their competitors ¢ Owner-led company with ¢ 450+ consultants ¢ 11 locations in Germany and Poland Danilo Schmiedel ¢ ¢ Senior Managing Consultant ¢ Business Development and Innovation About us Sven Bernhardt ¢ Senior Solution Architect ¢ Technical Lead for API Management
  • 3. © OPITZ CONSULTING 2018 Seite 3 Agenda 1 2 3 5 Serverless, FaaS, BaaS Fn Project Fn Flow Summary Serverless architectures with Fn Project 4 Use Cases and Scenarios
  • 4. © OPITZ CONSULTING 2018 Seite 4 Serverless, FaaS and BaaS 1 Serverless architectures with Fn Project
  • 5. © OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 5 Serverless standard picture ¢ Serverless != No Server => Just means someone else‘s computer https://www.flickr.com/photos/91707070@N03/8331732961 Source: https://bit.ly/2zeliT9 Serverless = Exit door from traditional IT operations, since no Servers are needed anymore? Clearly no! Serverless just mean that your code is running on someone elses computer somewhere, somehow and you don‘t have to care about it.
  • 6. © OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 6 Promises of Serverless ¢ Easier: Just think about your code, not infrastructure ¢ Powerful: Transparent and limitless scaling ¢ Faster: Deploy faster, iterate faster, innovate faster ¢ Cheaper: Only pay for what you use (never idle) Source: https://bit.ly/2QSP0nd
  • 7. © OPITZ CONSULTING 2018 Serverless architectures with Fn Project Serverless Manifesto by Potes & Nair (AWS) ¢ Functions are the unit of deployment and scaling ¢ No machines, VMs, or containers visible in the programming model ¢ Permanent storage lives elsewhere ¢ Scales per request: Users cannot over- or under-provision capacity ¢ Never pay for idle (no cold servers/containers or their costs) ¢ Implicitly fault-tolerant because functions can run anywhere ¢ BYOC — Bring Your Own Code ¢ Metrics and logging are a universal right Seite 7
  • 8. © OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 8 Characteristics of a Function ¢ Granular compute unit in Serverless ¢ Short-lived ¢ Ephemeral ¢ Stateless ¢ Scalable ¢ Event-Driven ¢ Single Purpose ¢ Self-contained ¢ Function has one output for a specific input Function f Input x Output f(x)
  • 9. © OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 9 Serverless, FaaS and BaaS ¢ Serverless: Abstraction of infrastructure and its operations including provisioning, scaling, patching, etc. ¢ Serverless applications significantly depend on third-party services ¢ A Serverless Computing Platform may provide one or both of: ¢ Functions-as-a-Service: ¢ Compute component in a serverless platform ¢ Custom Code that runs in ephemeral containers ¢ Backend-as-a-Service: ¢ Third-party API-based services ¢ Replaces core subsets of functionality in an application
  • 10. © OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 10 Evolution of application architectures Monolithic architectures µService architectures Serverless architectures f(a1) f(a2) f(a3) f(a4) f(b4)f(b3) f(b2)f(b1) f(c3) f(c4) f(c2)f(c1) f(d1) f(d2) f(d3) f(d4) Ø Single application Ø Mixed data from different business context Ø Mixed business logic Ø Application consists of different µService Ø Business logic and data belong to a bounded business context Ø Application consists of multiple functions Ø Fine-granular logic for a specific step, data resides externally
  • 11. © OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 11 Serverless: Focus on implementing business logic
  • 12. © OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 12 Serverless and Cloud-Native technologies Source: https://bit.ly/2S5tgoH
  • 13. © OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 13Source: https://bit.ly/2CJaco4
  • 14. © OPITZ CONSULTING 2018 Seite 14 Fn Project 2 Serverless architectures with Fn Project
  • 15. © OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 15 About Fn Project ¢ Open-source Functions-as-a-Service compute platform (Apache 2.0 licence) ¢ Easy to use for developers ¢ Easy to manage for operators ¢ Active large core team, 3500+ commits, 75+ contributors ¢ Members on the CNCF serverless working group ¢ Native CloudEvents support (https://cloudevents.io/) ¢ Specification for describing event data in a common way ¢ Event declaration and delivery across services and platforms
  • 16. © OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 16 Fn Project architecture ¢ Written in Go ¢ Container-based: Leverages Docker ¢ Run anywhere: ¢ Cloud ¢ On-Premise Datacenter ¢ Local development environment
  • 17. © OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 17 Fn Project runtime ¢ Fn is runtime-agnostic ¢ Can be targeted to run on Kubernetes (K8s) ¢ K8s optimizations are WIP ¢ Plans for deeper K8s integration using CRDs ¢ Helm chart available to install to K8s (https://bit.ly/2S1bvXm) ¢ Runtime monitoring: ¢ Prometheus support for metrics collection ¢ Metrics visualization with Grafana
  • 18. © OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 18 Function in Fn ¢ Small chunk of code wrapped into a container image ¢ Developers just need to care about business logic ¢ Function is wrapped in a Container Image ¢ Function is defined and deployed within an app ¢ Functions are written in code Function f STDIN (Input) STDOUT (Output) STDERR (Logs)
  • 19. © OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 19 Wait! Functions and Containers... What the heck? ¢ Serverless Manifesto says: „No machines, VMs, or containers visible in the programming model“ à So Fn Project is not really Serverless, right? ¢ Fn is FaaS, the underlying platform needs to ensure that ¢ Developer does not need to care about the containers and the technical stuff belonging to it (Build, Deploy, Run....) ¢ Users does not need to pay for idle containers ¢ Function is capable to scale automatically and infinitetly ¢ Advantage of the container-based approach is increased iteroperability (no vendor lock-in) ¢ Other Container-based FaaS Frameworks: Kubeless, Fission
  • 20. © OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 20 Function development ¢ Multi language support through Function Developer Kit (FDK) ¢ FDKs comprise of different building blocks, like ¢ Language-specific Fn libraries ¢ Build-Time Docker images ¢ Minimal runtime Docker images ¢ Fn CLI is used to manage and create Functions
  • 21. © OPITZ CONSULTING 2018 Serverless architectures with Fn Project Serverless Manifesto and Fn Project ¢ Functions are the unit of deployment and scaling ✓ ¢ No machines, VMs, or containers visible in the programming model ✓ ¢ Permanent storage lives elsewhere ✓ ¢ Scales per request: Users cannot over- or under-provision capacity ¢ Never pay for idle (no cold servers/containers or their costs) ¢ Implicitly fault-tolerant because functions can run anywhere ¢ BYOC — Bring Your Own Code ✓ ¢ Metrics and logging are a universal right ✓ Seite 21
  • 22. © OPITZ CONSULTING 2018 Seite 22 Demo - Function development Serverless architectures with Fn Project
  • 23. © OPITZ CONSULTING 2018 Seite 23 Fn Flow 3 Serverless architectures with Fn Project
  • 24. © OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 24 Building advanced functions with Fn Flow ¢ Build reliable and scalable FaaS applications with functions ¢ Flow functions are written purely in code ¢ Build distributed applications ¢ Provides rich concurrency primitives including fork-join, chaining, delays and error handling ¢ Testable using standard programming tools and mechanisms (e.g. Unit tests)
  • 25. © OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 25 Fn Flow compared to workflow solutions ¢ No context-switching, beause everything is code ¢ Leverage full power of the used programming language ¢ More powerful errorhandling capabilities ¢ Easy, consistent and comprehensible data and context handling ¢ Highly functional approach for implementing the flow ¢ Might be hard to read and understand for non-technicians
  • 26. © OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 26 Example Use Case Fn Flow: Saga ¢ Microservice Pattern: Saga defined by Chris Richardson ¢ Specifically: Orchestration-based Saga Source: https://microservices.io/patterns/data/saga.html
  • 27. © OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 27Source: https://github.com/fnproject/tutorials/blob/master/FlowSaga/images/1-travel-app.png
  • 28. © OPITZ CONSULTING 2018 Seite 28 Use Cases and Scenarios 4 Serverless architectures with Fn Project
  • 29. © OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 29 10 common use cases for Serverless platforms
  • 30. © OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 30 Serverless Best Practices 1. Each function should do only one thing 2. Functions don‘t call other functions 3. Use as few libraries in your functions as possible 4. Avoid using connection based services (use services rather than connections) 5. One function per route (if using HTTP) 6. Learn to use messages and queues 7. Data flows, not data lakes 8. Just coding for scale is a mistake, you have to consider how it scales (c) Paul Johnsten, ServerlessDays CoFounder
  • 31. © OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 31 Severless & Enterprise Integration Patterns (EIP) ¢ EIPs try to address integration problems based on messaging ¢ In EIPs there are definitions for basic components that are used to implement integrations, like ¢ Channels ¢ Splitter ¢ Aggregator ¢ Router … Source: https://www.enterpriseintegrationpatterns.com/patterns/messaging/Filter.html
  • 32. © OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 32 Example: EIP Message Translator System A System B X f(x) getData f(x) sendDataf(x) transformData https://www.enterpriseintegrationpatterns.com/patterns/messaging/MessageTranslator.html
  • 33. © OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 33 Example: EIP Message Splitter and Router System A System C System B f(x) getData f(x) splitData f(x) routeDataToC f(x) routeDataToB
  • 34. © OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 34 When is FaaS adequate for integration? ¢ Typical use cases: ¢ Batch processing, which takes place on regular schedules ¢ Event processing ¢ Considerations to make: ¢ Number of invocations ¢ Keep runtime short ¢ Serverless Platforms will terminate long-running Functions ¢ Don‘t block HW resources for too long
  • 35. © OPITZ CONSULTING 2018 Seite 35 Summary 5 Serverless architectures with Fn Project
  • 36. © OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 36 Summary ¢ Functions are first class citizens ¢ Fn Project is a ¢ Framework for implementing FaaS-style applications ¢ But is not a Serverless framework (no Serverless runtime available) ¢ FaaS is good for the right use cases, but it‘s no silver bullet! ¢ Strength of Fn Project: No vendor lock-in! ¢ FaaS provides new opportunities for implementing applications ¢ Event-based, scalable and ephemeral ¢ Stateless ¢ Infinitely scalable (in theory)
  • 37. © OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 37 With great power, comes great responsibility... ¢ Rethink the traditional application architectures! Client API Gateway IDM / Authentication PlaceOrder SearchProducts POST /api/v1/orders GET /api/v1/products CreateInvoiceCheckoutWarehouse Event Hub OrderCreated OrderCreatedOrderCreated
  • 38. © OPITZ CONSULTING 2018 Serverless architectures with Fn Project Seite 38 Links and Resources ¢ Fn Project: http://fnproject.io ¢ Github Fn Project: https://github.com/fnproject ¢ CNCF Whitepaper Serverless: https://bit.ly/2S5tgoH ¢ CloudEvents: https://cloudevents.io/ ¢ Enterprise Integration Patterns: https://www.enterpriseintegrationpatterns.com ¢ Microservices Patterns: https://microservices.io
  • 39. © OPITZ CONSULTING 2018 Seite 39Serverless architectures with Fn Project Q & A
  • 40. © OPITZ CONSULTING 2018 ¢¢¢ überraschend mehr Möglichkeiten! @OC_WIRE OPITZCONSULTING opitzconsultingWWW.OPITZ-CONSULTING.COM Seite 40 Contact us! Danilo Schmiedel Senior Managing Consultant Solutions | Oracle ACE Director OPITZ CONSULTING Deutschland GmbH Tempelhofer Weg 64, 12347 Berlin, Germany Phone: +49 173 7279001 Mail: danilo.schmiedel@opitz-consulting.com @dschmied http://inside-bpm-and-soa.blogspot.com Sven Bernhardt Senior Solution Architect | Oracle ACE OPITZ CONSULTING Deutschland GmbH Kirchstrasse 6, 51647 Gummersbach, Germany Phone: +49 172 2193529 Mail: sven.bernhardt@opitz-consulting.com @sbernhardt https://svenbernhardt.wordpress.com Serverless architectures with Fn Project