2. About Me
• Director, EHS
• Principle Engineer, Yahoo
• Sr. Engineering Manager, Yahoo
• Solution Architecture, Yahoo
• Yahoo Frontpage
• Yahoo EC Shopping – VIP Box
• Yahoo iOS movies
• Yahoo Finance
• Yahoo News
• IT Head, Puma/Starlike
• SAP IS-Retail
I don’t know
what I don’t
know until I
know it. Ask
and learn.
13. Infrastructure
• Fully-managed by vendor
• Without managing server system: OS, CPU, memory, network
• Without managing server applications: apache, node.js, configurations
• Functions
• AWS Lambda: Javascript, Python, JVM language, C#
• Deploy
• BYOC: bring your own code. ZIP or code in console
• Scaling
• Request based automatically
• Trigger by events
• Defined by vendors: eg AWS S3, CloudWatch (schedule), Message Queue
• Http/s requests: eg. API Gateway, Webtask
23. Benefits
• Reduce operational costs
• Infrastructure cost: without pay as it is idle*
• People cost: focus on function development
• Reduce development cost
• BaaS: eg. Firebase, Auth0
• Spend development time on business-specific code
• Maximize iterations
• Minimize dependences: IT Ops, DBAs
• Easier Operational management
• Scaling benefits of FaaS
• Reduced packaging complexity
24. Cost Benefits
If your
traffic is uniform and
would consistently
make good utilization
of a running server,
you may not see this
cost benefit and may
actually spend more
using FaaS.
26. Drawbacks
• Vendor Lock-in
• Vendor control
• Startup latency: worst case 3 second for JVM
• Execution duration: 300 second for AWS
• DoS yourself: AWS 1,000 concurrent / second
• Versioning and deployment
• If you have 20 functions for your application, how you handle deployment?
• Any easy way to roll back all 20 functions atomically?
• Testing/Monitoring / Debugging
• Repetition library or codes
31. Where serverless make sense
• Fast is more important than elegant.
• Change in the application's functionality and usage is frequent.
• Change occurs at different rates within the application, so functional
isolation and simple integration are more important than module
cohesiveness.
• Functionality is easily separated into simple, isolatable components.
• Each single-function has one action.
37. Benefits
• Encapsulates the internal
structure of the application.
• Reduces the number of round
trips between the client and
application.
• Simplifies the client code
Drawbacks
• Yet another highly available
component.
• Performance and Scalability
• Wait inline to update the
gateway
42. Asynchronous, Message-Based Communication Benefits
• Decouples the
client from the
service
• Message buffering
• Flexible client-
service interactions
• Explicit
inter-process
communication
Drawbacks
• Operational Cost
• Complexity of
implementing
request/response-b
ased interaction
47. API Versioning
• General versioning rule. Suggest put this info in the return data.
• Major.Minor.Patch (example: 1.2.331)
• Four common ways to version a REST API
• URI Path
• Facebook: https://abc.com/api/v1/products
• URI parameters:
• NetFlix: https://abc.com/api/products?version=1
• Header Custom Field:
• Azure: x-ms-version: 2011-08-18
• Header Accept Field:
• GitHub: application/vnd.github.v3+json (vnd means vendor)
67. ACID Model (CA)
• Atomic
• All operations in a transaction succeed or every operation is rolled
back.
• Consistent
• On the completion of a transaction, the database is structurally sound.
• Isolated
• Transactions do not contend with one another. Contentious access to
data is moderated by the database so that transactions appear to run
sequentially.
• Durable
• The results of applying a transaction are permanent, even in the
presence of failures.
75. Event Driven Architecture
• Benefits
• Scale: it enables the implementation of transactions that span
multiple services and provide eventual consistency.
• Materialized view: It enables an application to maintain a data
store that contains the result of a query. It may be a join result or a
summary using an aggregate function.
• Drawbacks
• Handle atomically updating and publishing
• Deal with inconsistent data: change in-flight, materialized view is
not updated yet.
• Handle reverse state
• Handle time-ordered sequence of changes if needed
101. “I want to sequence functions”
“I want to select functions based on data”
“I want to retry functions”
“I want try/catch/finally”
“I have code that runs for hours”
“I want to run functions in parallel”
Functions into apps