Weitere ähnliche Inhalte Ähnlich wie Architecting Next Generation Serverless SaaS Solutions on AWS (ARC324-R1) - AWS re:Invent 2018 (20) Mehr von Amazon Web Services (20) Architecting Next Generation Serverless SaaS Solutions on AWS (ARC324-R1) - AWS re:Invent 20182. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Architecting Next Generation Serverless SaaS
Solutions on AWS
Tod Golding
Partner Solutions Architect
Amazon Web Services
A R C 3 2 4
3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
SaaS and serverless: a natural fit
4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
No more over-provisioning
Tenants Tenant consumptionCost, scale, performance
Consumption Time
5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
High level serverless SaaS architecture
6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Shared onboarding services
7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Serverless authentication and authorization
Amazon
CognitoTenant
JWT token
(user, tenant, role)
Validate tenant,
user, role access
8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Tenant throttling strategies
Tenant 1
(Standard Tier)
Tenant 2
(Professional Tier)
Tenant 3
(Premium Tier)
API key(s)
Usage plan
9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Compute isolation and serverless
EC2 Instances
EC2 silo model
Tenant 2Tenant 1
ECS Cluster
Tenant 1 Tenant 2
ECS silo model
EC2 Instances
ECS Cluster
How do these
map to serverless?
10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Tenant isolation with siloes
Tenant 1 Tenant 2
11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Tenant isolation with policies
Tenant 2Tenant 1
12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Tenant isolation with tokens
Tenant 1 Tenant 2
13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Wrapper-based isolation
var lambdaFunc = require('myModule/mymod.js’);
var lambda = require('lambda-wrapper').wrap(lambdaFunc);
lambda.run(event, function(err, data) {
if (err) {
... handle error
}
... process data returned by the Lambda function
})
14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
The good news
Tenant 1 Tenant 2
Tenant 2Tenant 1
15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Serverless application services
TenantID Name
Tenant-1 Jane Doe
Tenant-4 Mike Doe
16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
A different scaling mindset
GetOrder()
UpdateOrder()
DeleteOrder()
GetOrder() GetOrder()
UpdateOrder()
Scale
Policy
Policy
Order
Management
Service
Order
Management
Service
Order
Management
Service
Order
Management
Service
POST /orders/712
PUT /orders/42
DELETE /orders/651
GET /orders
Scale
17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Hiding away multi-tenant awareness
Multi-tenant data access
Metering&
analytics
Logging
18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Flowing tenant context through services
Tenant
Token
Token (HTTP headers)
Metering
Logging
Data Access
Token
Tenant 1 Tenant 2
19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
State residue for functions
Tenant 1
1
2
Tenant 2
20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Serverless and SaaS agility
Scheduled Maintenance
Friday, April 1, 11:00-12:00PM
The system will be down for maintenance this
evening. We apologize for any inconvenience this
may cause.
Close
Achieving zero-downtime on SaaS requires
• Ability to deploy small, decoupled units of functionality
• A strategy that expects and embraces fault tolerance
• A well-defined mechanism for staging and releasing new features
• An approach that enables continual and frequent releases
21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Can’t get much smaller than this
Commit
Unit
Test
System
Test
QA Staging Prod
Commit
Unit
Test
System
Test
QA Staging Prod
Commit
Unit
Test
System
Test
QA Staging Prod
GetOrder()
CreateOrder()
UpdateOrder()
22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Smaller blast radius = better fault tolerance
• Finer grained functions promote more refined fault tolerance
• More opportunities for implement fallback strategies
• Less exposure and visibility when a service fails
• Greater resilience translates into greater agility
Catalog
Ratings
Checkout
Taxation
CrossSell
Cart
Search
23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Servers impact SaaS storage
db.m4.large
db.m4.16xlarge
db.m4.4xlarge
Tenants
24. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Strategies for addressing compute size
Over provisioning
Load-driven resizing
Tenant 1 Tenant 2
Tenant 1
Tenant 1
Tenant 1
25. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Pooled storage compute challenges
TenantID Name StartDate
Tenant-1 Jane Doe 01-12-2012
Tenant-4 John Doe 09-01-2015
Tenant-9 Mary Smith 11-04-2017SaaS
Database
Customer table
Tenant 1
Tenants can rapidly saturate and instance
Tenant 2
Tenant 3
26. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
On-demand sizing with Amazon Aurora Serverless
Proxy fleet
Instance Instance Instance
Aurora instances
Application
Storage Storage Storage
• Remove the notion of servers/instances
• All data is kept in highly available
storage volume
• Application talks to a MySQL
compatible endpoint
• Fleet of proxy servers manage, queue
and route database traffic
27. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Leveraging pooled instances
Instance Instance Instance
Aurora instances
Warm instance pool
28. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Data partitioning with Amazon Aurora Serverless
Instance
Aurora instance
Tenant 1
Instance
Aurora instance
Tenant 1 Tenant 2
Instance
Aurora instance
Tenant 2
Warm instance pool
Silo partitioning Pool partitioning
29. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Full stack serverless SaaS
Amazon API Gateway
Aurora Serverless Storage
Tenant 1 Tenant 2
• Brings serverless to relational environments
• Isolation of compute and storage with no
idle costs
• Simplified management and deployment
• Less operational focus on tuning and sizing
policies
• More focus on your application IP
Tenant 1 Tenant 2
30. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Where does AWS Fargate fit?
Fargate cluster
Tenant 1 Tenant 2
• A more coarse-grained view of serverless
• Often fits the developer mental model
• Can represent a more natural transition for
legacy systems
Tenant 3
31. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Takeaways
• Use serverless to focus more attention on your IP
• Find the isolation balance that best suits your domain
• Tenant load profile should influence service decomposition
• Find the logical services for data encapsulation
• Consider extending the reach of serverless to storage
• Use serverless DevOps to simplify your zero downtime store
• Serverless and SaaS are a natural match
32. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Additional SaaS Breakouts
Monday, 11/26
GPSTEC3-2 - SaaS Reference Architectures: A Review of Real World Patterns and Strategies
6:15 PM | Venetian, Level 2, Venetian Theater
Tuesday, 11/27
ARC324 - Architecting Next Generation Serverless SaaS Solutions on AWS (Repeat)
4:00 PM | Venetian, Level 2, Titian 2204
Thursday, 11/29
ARC418 Deconstructing SaaS: Deep Dive into Building Multi-Tenant Solutions on AWS (Repeat)
4:00 PM | Aria, Aria West, Level 3, Ironwood 5
Wednesday, 11/28
ARC418 Deconstructing SaaS: Deep Dive into Building Multi-Tenant Solutions on AWS
12:15 PM | Mirage, Mirage Event Center B
33. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
SaaS Chalk Talks
Monday, 11/26
ARC216 - SaaS Operations: The Foundation of SaaS Agility
11:30 – 12:30 | Venetian, Level 2, Veronese 2406
Tuesday, 11/27
ARC210 - SaaS Jumpstart: A Primer for Launching Your SaaS Journey
9:15 – 10:15 | Venetian, Level 4, Lando 4304
Wednesday, 11/28
ARC419 – Optimizing Your SaaS Solutions on AWS
1:00 – 2:00 | Venetian, Level 3, Murano 3202
ARC326 - Migrating Single-Tenant Applications to Multi-Tenant SaaS
4:00 – 5:00 | Aria West, Level 3, Starvine 7
ARC210 - SaaS Jumpstart: A Primer for Launching Your SaaS Journey
1:45 – 2:45 | Aria West, Level 3, Ironwood 8
34. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
SaaS Chalk Talks
Thursday, 11/29
ARC210 - SaaS Jumpstart: A Primer for Launching Your SaaS Journey
1:45 – 2:45 | MGM, Level 1, South Concourse 105
Friday, 11/30
ARC326 – Migrating Single-Tenant Applications to Multi-Tenant SaaS
10:00 – 11:00 | MGM, Level 1, South Concourse 105
ARC419 – Optimizing Your SaaS Architecture on AWS
1:00 – 2:00 | Venetian, Level 3, Murano 3202
35. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
SaaS Workshops
Monday, 11/26
Hands-on SaaS: Constructing Multi-Tenant Solutions on AWS
4:00 – 6:15 PM | Mirage, Mirage Event Center C3
Friday, 11/30
Hands-on SaaS: Constructing Multi-Tenant Solutions on AWS
9:15 AM – 11:30 AM | Mirage, Mirage Event Center C2
36. Thank you!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Tod Golding
todg@amazon.com
37. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.