Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
Architecture Styles and Hypes
Michael Hilton Claire Le Goues
Christopher Meiklejohn
October 15, 2020
1
Administrativia
• Homework 4 will be released today.
• No recitation Friday.
• Wednesday recitation – bring questions or we end early!
o Work through problems on the previous midterms – many students found
this helpful.
o Any questions on the previous midterm questions – bring them to recitation
to discuss as a class.
• Midterm on October 22nd.
2
Learning Goals
• Understand history of Microservices
• Reason about tradeoffs of Microservices architectures.
3
MICROSERVICES
17-313 Software Engineering
4
17-313 Software Engineering
5
17-313 Software Engineering
6
17-313 Software Engineering
7
8
Netflix
17-313 Software Engineering
9
(as of 2016)
Bookmarks
Recommendations
My List
Metrics
AppBoot
17-313 Software Engineering
10
(as of 2016)
Microservices
17-313 Software Engineering
11
17-313 Software Engineering
12
source: http://martinfowler.com/articles/microservices.html
13
Uber
17-313 Software Engineering
14
(as of 2016)
17-313 Software Engineering
15
(as of 2016)
17-313 Software Engineering
16
(as of 2016)
17-313 Software Engineering
17
(as of 2016)
Microservices
• Building applications as suite of small and easy to replace services
o fine grained, one functionality per service
(sometimes 3-5 classes)
o composable
o easy to develop, test, and understand
o fast (re)start, fault isolation
o modelled around business domain
• Interplay of different systems and languages
• Easily deployable and replicable
• Embrace automation, embrace faults
• Highly observable
17-313 Software Engineering
18
Service Oriented Architectures(SOA)
• Service: self-contained functionality
• Remote invocation, language-
independent interface
• Dynamic lookup possible
• Often used to wrap
legacy systems
17-313 Software Engineering
19
Service Registry
Service Requestor
Service Providerbind
call
publishfind
Service Oriented Architectures(SOA) Microservice Architecture
• Service: self-contained functionality
• Language-independent interface
• Dynamic lookup
17-313 Software Engineering
20
Kubernetes
Service A(Container)
Service B(Containers)
HTTP/GRPC
Runs andAssigns IP
DNSLookup
Technical Considerations
• HTTP/REST/JSON/GRPC/etc. communication
• Independent development and deployment
• Self-contained services (e.g., each with own database)
o multiple instances behind load-balancer
• Streamline deployment
17-313 Software Engineering
21
17-313 Software Engineering
22
source: http://martinfowler.com/articles/microservices.html
23
Hipster Shop
Hipster Shop User Interface
17-313 Software Engineering
24
Hipster Shop Bingo Game
17-313 Software Engineering
25
https://docs.google.com/presentation/d/1P7X7nFMIWAQW12kOk6pW66jtk34S_j_RnCt2c3BwMvM/edit?usp=sharing
Make a copy of the first slide for your group.
Add your Andrew IDs to the slide.
Frontend
FREE SPOT
Hipster Shop Microservice Architecture
17-313 Software Engineering
26
https://github.com/GoogleCloudPlatform/microservices-demo
Microservices overhead
17-313 Software Engineering
27
28
Cinema
Cinema Diagram
17-313 Software Engineering
29
https://codeahoy.com/2016/07/10/writing-microservices-in-python-using-flask/
https://github.com/umermansoor/microservices/
30
Cinema Code Walkthrough
Drawbacks
• Complexities of distributed systems
o network latency, faults, inconsistencies
o testing challenges
• Resource overhead, RPCs
• Shifting complexities to the network
• Operational complexity
• Frequently adopted by breaking down monolithic application
• HTTP/REST/JSON communication
o Schemas?
17-313 Software Engineering
31
Discussion of Microservices
• Are they really “new”?
• Do microservices solve problems, or push them down the line?
• What are the impacts of the added flexibility?
• Beware “cargo cult”
• “If you can’t build a well-structured monolith, what makes you think
microservices is the answer?” – Simon Brown
• Leads to more API design decisions
17-313 Software Engineering
32
33
Serverless
17-313 Software Engineering
34
SERVERLESS
SERVERLESS
17-313 Software Engineering
35
SERVERLESS
17-313 Software Engineering
36
SERVERLESS
Serverless (Functions-as-a-Service)
• “extreme” use of microservices
• Instead of writing minimal services, write just functions
• No state, rely completely on cloud storage or other cloud services
• Pay-per-invocation billing with elastic scalability
• Drawback: more ways things can fail, state is expensive
• Examples:
AWS lambda, CloudFlare workers, Azure Functions
• What might this be good for?
• (New in 2019/20) Stateful Functions:
Azure Durable Entities, CloudFlare Durable Objects
17-313 Software Engineering
37
17-313 Software Engineering
38