Serverless Deep Dive 2018 North America

2020-03-01 56浏览

  • 1.DeepDive:CNCF Serverless WG & CloudEvents Cathy Zhang - Cathy.H.Zhang@huawei.com Clemens Vasters - clemensv@microsoft.com
  • 2.Agenda ● Serverless Workflow ● CloudEvents Deep Dive ● Q&A
  • 3.● What is Serverless Workflow ● Why Do We Need a Workflow Specification ● Workflow Specification Scope ● Overview of Workflow Primitives ● Example Use Cases
  • 4.What is Serverless WorkFlow
  • 5.Why is the WorkFlow Spec Needed
  • 6.WorkFlow Specification Scope
  • 7.Workflow Overview (Key Primitives)
  • 8.Stock Trade Application Use Case
  • 9.Stock Trade Application Use Case
  • 10.Video Streaming Application Use Case
  • 11.CloudEvents Deep Dive
  • 12.Eventing vs Messaging • Events and messages are both mailing envelopes for data, decorated by metadata – but they are different. • Events carry facts. They report things that have happened. • State transitions, observed conditions, objects having been created, … • Messages carry intents. The sender expects something to happen. • Command execution, job handling, workflow progress, … • Events are published as an information option for interested subscribers. The audience size may be zero or many. • Messages are sent to handlers. There may be delivery and handling status feedback, replies, conversations, or complex control flows like Workflows and Sagas. The audience size may be one or many.
  • 13.CloudEvents - Base Specification • CloudEvents is a lightweight common convention for events. • It’s intentionally not a messaging model to keep complexity low. • No reply-path indicators, no message-to-message correlation, no target address indicators, no command verbs/methods. • Metadata for handling of events by generic middleware and/or dispatchers • • • • • What kind of event is it? eventtype When was it sent? eventtime What context was it sent out of? source What is this event’s unique identifier? eventid What’s the shape of the carried event data? contenttype, schemaurl • Event data may be text-based (esp. JSON) or binary
  • 14.CloudEvents - Event Formats • • • • Event formats bind the abstract CloudEvents information model to specific wire encodings. All implementation must support JSON. JSON is the default encoding for where metadata text must be rendered, e.g. HTTP header values AMQP type system encoding defined for metadata mapping to AMQP properties and annotations Further compact binary event format candidates might be CBOR, or Protobuf. { "specversion" : "0.1", "type" : "myevent", "source" : "uri:example-com:mydevice", "id" : "A234-1234-1234", "time" : "2018-04-05T17:31:00Z", "type" : "text/plain", "data" : "Hello" } JSON Representation
  • 15.HTTP Transport Binding • Transport bindings bind the CloudEvent event metadata and data to the transport frame of an existing application or transfer protocol. • HTTP TransportBinding:• • • Binds a CloudEvent event to the HTTP message. Works for both requests and replies. Does not constrain usage of methods or status codes; can be used for all cases where HTTP carries entity bodies. Structuredmode:'>mode: