Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Serverless Architectures: Devoxx 2017 Presentations (includes AWS Lambda, Fn Project)

Frank Munz
November 15, 2017

Serverless Architectures: Devoxx 2017 Presentations (includes AWS Lambda, Fn Project)

AWS Lambda, Fn Project, Microservices, Serverless

Frank Munz

November 15, 2017
Tweet

More Decks by Frank Munz

Other Decks in Technology

Transcript

  1. Dr Frank Munz
    @frankmunz
    www.munzandmore.com/blog
    #DevoxxMA
    Serverless
    Architectures
    DOAG 2017

    View Slide

  2. View Slide

  3. • Founded munz & more in 2007
    • > 15 years Middleware,
    Cloud, and Distributed Computing
    • Consulting and
    High-End Training
    • Wrote two WebLogic and
    a Cloud book
    Dr. Frank Munz
    @frankmunz

    View Slide

  4. Content
    1. Clouds
    2. FaaS (AWS Lambda)
    3. Serverless
    4. Frameworks (Fn Project)
    5. Conclusion
    #serverless @frankmunz

    View Slide

  5. Clouds
    #serverless @frankmunz

    View Slide

  6. API
    @frankmunz

    View Slide

  7. Elasticity

    View Slide

  8. Pay Per Use
    • 1 US cent/h (micro), geo-distribution included
    • You own a massively parallel, distributed and
    highly available supercomputer with linear
    costs:
    1 instance for 100 hours $= 100 instances for 1h
    @frankmunz

    View Slide

  9. Cloud Computing
    API Elasticity Pay per use
    Fully Programmable Data Center

    View Slide

  10. PaaS
    IaaS Amazon EC2
    Oracle CI
    AWS Beanstalk
    Oracle ACCS
    FaaS AWS Lambda
    Oracle TBD
    Automated elasticity.
    True pay per use.
    Container Service AWS ECS
    OCCS
    API?
    Elasticity?
    Pay per use?

    View Slide

  11. AWS Lambda
    #serverless @frankmunz

    View Slide

  12. FaaS: AWS Lambda
    • AWS announced Lambda in 2014
    • Lambda is Function as a Service (FaaS)
    @frankmunz

    View Slide

  13. AWS Lambda
    AWS SAM Local: test and locally run Lambda (Public Beta)
    event: event passed to function
    context: runtime context
    callback: optional return
    (or null)
    @frankmunz

    View Slide

  14. Create Lambda
    S3
    @frankmunz
    Vendor lock-in?

    View Slide

  15. Lambda Tech Details I
    • Stateless, with 5 min max exec time
    • Start threads and processes
    • Events based, but no event bus visible
    • Retries + dead letter Q
    • You can use environment variables
    • Invocation times differ per language and per call
    @frankmunz

    View Slide

  16. Lambda Tech Details II
    • No config for scaling
    • You pay for GB *s, metered in 100 ms
    • One event can trigger several funcs
    • Function executes at least once (-> idempotent f)
    • AWS Step Function: visual designer
    • No SLAs
    @frankmunz

    View Slide

  17. Test Code
    1
    2
    3
    4

    View Slide

  18. Example: REST Request

    View Slide

  19. Example: Image Recognition Flow
    munz & more #19
    Extract
    meta data
    AI based
    recognition
    Create
    thumbnail
    How to model flow?

    View Slide

  20. λ
    Example: BaaS
    Define an
    Intent with Slots
    and Utterances
    speechlet

    View Slide

  21. Pricing
    Every started request is charged:
    • First 1 million req/month are free, forever
    + 400,000 GB seconds of compute time
    • Measured in increments of 100 msec
    • $0.20 per 1 million req
    + $0.00001667 per GB second
    Tip: Use AWS
    Cloud Watch
    alarms for billing!
    @frankmunz

    View Slide

  22. Cost Savings
    Expedia(2016):
    – 2.3 billions calls
    – 200k hours / month
    – $ 550 a month
    Postlight
    – API GW, Lambda, Serverless
    – Costs dropped 2 orders of magnitude down to $ 370
    https://www.youtube.com/watch?v=gT9x9LnU_rE
    https://trackchanges.postlight.com/serving-39-million-requests-for-370-month-or-how-we-reduced-our-hosting-costs-by-two-orders-of-edc30a9a88cd
    http://serverlesscalc.com/
    @frankmunz

    View Slide

  23. FaaS
    #serverless @frankmunz

    View Slide

  24. Function as a Service
    • Automated elasticity
    • True pay per invocation
    • Ephemeral compute
    Definition
    Characteristics
    • Event based
    • Reduced control plane
    (mem + CPU + I/O)
    • Uses container tech

    View Slide

  25. AMIGO: Public Cloud Services
    Amazon Microsoft IBM Google Oracle
    Name Lambda Azure Functions Open Whisk Cloud Functions tbd
    Year 2014 2016 2016 2016 2016
    Status prod prod prod beta announced
    Language
    Support
    NodeJS 4.3.2,
    Java8,Python
    2.7, .Net C#,
    native Linux
    JS, PHP, C#, F#,
    Python, bash,
    PowerShell
    NodeJS, Java,
    Phython,
    (Docker)
    NodeJS
    (not Java)
    Docker based ?
    Remarks Bundle functions,
    OneDrive and
    Bot integration
    Apache
    Incubator
    Deploy from
    github or
    BitBucket, CLI
    Based on
    open source
    Fn Project?
    Link https://aws.amazon.
    com/lambda/
    https://azure.microsoft.co
    m/en-
    us/services/functions/
    https://openwhisk.apa
    che.org/
    https://azure.microsoft.co
    m/en-
    us/services/functions/
    https://cloud.oracle.com/home

    View Slide

  26. Security
    “Try to attack something
    that only lives for few milli-seconds”
    (AWS)
    @frankmunz

    View Slide

  27. Youtube: Gone in 60ms
    https://www.youtube.com/watch?v=YZ058hmLuv0
    @frankmunz

    View Slide

  28. Microservices
    Developing a single application as
    • a suite of small services
    • each running in its own process / owns it‘s data
    • communicating with lightweight mechanisms
    (M. Fowler / J. Lewis)
    https://martinfowler.com/articles/microservices.html
    @frankmunz

    View Slide

  29. FaaS = Microservice?
    • FaaS fulfills M. Fowler’s microservices definition
    • A real micro service consists of multiple functions
    • FaaS vs. Docker / Kubernetes?

    Benefits of FaaS
    - Serverless
    - Zero config auto scaling
    - True pay per use
    -> higher abstraction
    Limits of FaaS
    - Language choice
    - Resource limits
    - Vendor lock-in
    -> reduced flexibility
    @frankmunz

    View Slide

  30. Serverless
    #serverless @frankmunz

    View Slide

  31. View Slide

  32. Serverless
    Mark Cavage, Java One 2017:
    “Reduce notion of all infrastructure”
    Serverless
    Example: AWS SQS
    1 Mio Req $0.40
    @frankmunz
    Wasn’t that PaaS ?
    Yes it‘s PaaS, but serverless requires…
    • Never pay for idle
    • Automated elasticity
    • Reduced config settings

    View Slide

  33. Frameworks
    #serverless @frankmunz

    View Slide

  34. Serverless Frameworks dealing with …
    @frankmunz
    AWS Chalice
    Portability
    Complexity Standards

    View Slide

  35. FaaS OS Frameworks
    Overlap in functionality
    -> expect consolidation
    Survival is about:
    • Integration: K8s, Traefik, Zipkin,
    Prometheus, Kafka etc.
    • Adoption, adoption, adoption
    • FaaS as PaaS implementation?
    https://github.com/faas-lane/
    FaaS-Lane/tree/master/candidates
    @frankmunz

    View Slide

  36. Fn Project
    • Apache 2, Open Source Java One 2017
    • Fn Server (micro API GW), LB, Flow
    • Function / Container duality
    • Docker is only dependency -> polyglot
    @frankmunz

    View Slide

  37. Fn Project
    • Jackson for JSON marshalling in Java
    • JAX-RS demo
    • Hot functions (30 seconds)
    • Fn PaaS service likely? J
    @frankmunz

    View Slide

  38. Fn Flow
    Java 8 CompletableFutures API

    View Slide

  39. Fancy a demo?

    View Slide

  40. Outlook
    • Oracle’s Cloud Native Container strategy
    – Kubernetes
    – Wercker
    – Pay per invocation (?)
    • Fn Project as PaaS and on premises
    • Azure Container Instance: pay per invoke
    (today!)
    @frankmunz

    View Slide

  41. Conclusion
    #serverless @frankmunz

    View Slide

  42. TL;DR #serverless & #FaaS
    in all major clouds / could compose
    µ out of / PaaS ⊇ Serverless ⊇ FaaS /
    FaaS = stateless / true pay per use /
    automated scalability / event driven /
    integrates with other CS / architect against
    vendor lock in / cloud agnostic FaaS
    frameworks emerge / FaaS frameworks
    consolidation ahead /
    only technically the new µ (AWS).
    @frankmunz

    View Slide

  43. 3 Membership Tiers
    • Oracle ACE Director
    • Oracle ACE
    • Oracle ACE Associate
    bit.ly/OracleACEProgram
    500+ Technical Experts
    Helping Peers Globally
    Connect:
    Nominate yourself or someone you know: acenomination.oracle.com
    @oracleace
    Facebook.com/oracleaces
    [email protected]

    View Slide

  44. munzandmore.com/blog
    @frankmunz
    munzandmore.com/youtube

    View Slide