Contenu connexe Similaire à Enterprise Systems Built With Microservices are Designed to Expect Failures, But Then What? How Do We Handle Failures? (20) Plus de VMware Tanzu (20) Enterprise Systems Built With Microservices are Designed to Expect Failures, But Then What? How Do We Handle Failures? 1. Enterprise systems built with
Microservices are designed to expect
failures, but then what? How do we
handle failures?
By Dalia Borker
Vice President JP Morgan Chase
2. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Distributed Microservices Systems
2
Microservices can be scaled as needed
3. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Online Book Seller Service
Need data consistency but expect failures!
3
Online Book
Seller Service
Books
Catalog
Payment
Service Payment
Service
Books
Catalog
Online Book
Seller Service
Admin
Customer
4. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
The Problem
• Legacy monolithic systems chipped away into individual apps
• Individual microservices can go down at any time !
How to minimize complete system or user process failures?
4
5. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Architecture Resiliency Patterns in Cloud Native
Applications
Consumer Contracts
• API definition
• API versioning
Retries and Idempotent APIs
Promise and Fallback
• Circuit Breakers
• Caching
5
6. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Circuit Breaker with Netflix Hystrix
6
https://github.com/Netflix/Hystrix/wiki/images/hystrix-command-flow-chart.png
7. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Caching Frameworks on PCF
• Redis for PCF
• Pivotal Cloud Cache
• Hazelcast
7
8. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Use Cases
• Online Book Seller Customer searches for available books to place an order.
• High volume of Customers search available books on Online Book Seller
app
8
9. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Redis – Remote Dictionary Server
• Fast and light weight
• Most major languages supported
for clients
• Key-value store
• In-Memory NoSQL Database.
• Keys can expire
• for querying
9
• Redis instances operate in silo.
• No high availability across multiple
instances
• Scaling requires pre-provisioning
• No support for querying
• Operator installs Redis service
plans: Dedicated-VM, Shared-VM
10. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Use Case: Customer searches for available
books with Redis for PCF
10
Online Book
Seller Service Books
Catalog Books
Catalog
Online Book
Seller Service
Customer
Redis
PCF
1. User looks up
Books
2.Service called to
get list of books
4. Store list of
books in cache
binding
binding
3. List of Books returned
5. User get list
11. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Use Case: Customer searches for available
books with Redis for PCF failure recovery
11
Online Book
Seller Service Books
Catalog Books
Catalog
Online Book
Seller Service
Customer
Redis
PCF
1. User looks up
Books
2.Service called to
get list of books
binding
binding
3. Lookup
books from
Cache
5. User sees books
displayed
4. Books
returned
12. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Use Case: Customer searches for available
books with Redis for PCF failure recovery
12
13. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Use Case: Customers searches for available
books with Redis for PCF
13
Online Book
Seller Service Books
Catalog Books
Catalog
Online Book
Seller Service
Customers
Redis
PCF
1. User looks up
Books
2.Service called to
get list of books
binding
binding
User may get error
message if not found
In Redis instqnce
PaaS
Support
Reconfigures
Redis
14. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Pivotal Cloud Cache
• Key-value store
• Apache Gemfire under the hood
• Gemfire command restrictions
• Highly available clustered solutions
• Java Clients supported
• Runs on PCF
• Asynchronous replication across
cluster
14
• WAN replication across
geographically distributed data
centers
• Provides strong consistency (“C” of
CAP theory), partitioning and very
good availability
• Great for “update oriented”
systems.
15. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Use Case: Customer searches for available
books with PCC
15
Online Book
Seller Service Books
Catalog
Books
Catalog
Online Book
Seller Service
Customer
PCF
PCC Cluster
1. User looks up
Books
2.Service called to
get list of books
4. Store list of
books in cache
binding
binding
3. List of Books
returned
5. User get list
PCF
16. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Use Case: Customer searches for available
books with PCC continued
16
Online Book
Seller Service Books
Catalog
Books
Catalog
Online Book
Seller Service
Customer
PCF
PCC Cluster
1. User looks up
Books
2.Service called to
get list of books
3. Lookup books
from cache
binding
binding
4. List of
Books
returned
5. Books displayed to User
PCF
17. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Use Case: High number of Customers searches
for available books with PCC
17
18. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Hazelcast on PCF
• Distributed in-memory data grid
(IMDG)
• Based on Hazelcast® IMDG open
source
• Availability (“A” of CAP theory) at
the cost of Consistency (“C”)
• Support for querying
18
• Requires no pre-provisioning of
VMs by Operator
• WAN replication
• Highly available clustered solution
• Written in Java
• JCache (JSR 107) standard
supported
19. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Use Case: Customer searches for available
books with Hazelcast®
19
20. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Use Case: Customer searches for available
books with Hazelcast® continued
20
21. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Use Case: High number of Customers search for
available books with Hazelcast®
21
Online Book
Seller Service Books
Catalog
Books
Catalog
Online Book
Seller Service
Customers
PCF
Hazelcast
Cluster
1. User looks up
Books
2.Service called to
get list of books
3. Lookup books
from cache
binding
binding
4. List of
Books
returned
5. Books displayed to User
PCF
Adds to PCC
cluster
DevOps
Support
1. User looks up
Books
22. Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Summary
• Resiliency in microservices systems needs to be planned from the start.
• Redis, Hazelcast and PCC can all be used to provide fallback strategies
in case of failures!
Choose the caching solution suited to your use cases and build more resilient
cloud native enterprise applications!
22