Module 2b - Services & Microservices Flashcards
What is a service?
A service is a self-contained and reusable component that performs a specific task.
Ex: return price of a stock, append a message to a blog
What is encapsulation with respect to services?
A service is encapsulated if it exposes an interface and hides its implementation
What are Web Services?
Services that use web protocols (ex HTTP) for transport
How are services accessed? As in how do they facilitate communication between other services?
Through communication protocols that may be layered on top of other protocols for transport
What is a service-oriented architecture? (SOA)
An architecture where functionality is separated into a collection of services that can can be developed, deployed, and maintained independently
Service-Oriented Architectures include middleware infrastructure. Why?
To facilitate integration of services
What strategy do microservice-based architectures follow that service-oriented-architectures do not?
Microservice Architectures take the divide-and-conquer strategy of service-oriented-architectures and make it more loosely coupled and distributed
Do Microservices rely on a common communication mechanism? Do they share data?
What benefits & drawbacks does this provide?
They don’t rely on a single method of communication, and they do not share data.
This improves fault tolerance but complicates coordination among components
Are microservices are typically divided into small computing units. What is the benefit of this?
They become easy to develop, deploy, and maintain independently than larger components.
This also helps scalability
What is SOAP?
Simple Object Access Protocol
Can only make HTTP POST requests
What other protocol is SOAP layered on top of?
What does SOAP use for its message format?
SOAP is layered on top of HTTP
SOAP uses XML as its message format
What is REST?
Representational State Transfer
A stateless model for interacting with HTTP
What is the motivation behind using REST over SOAP
Simple Web services can be constructed by using HTTP protocol directly instead of layering another protocol on top of it (SOAP does that). SOAP only can make POST requests
REST is lighter weight than SOAP
Does REST avoid layering another protocol on top of HTTP?
REST directly provides access to remote resources using HTTP methods such as GET, PUT, POST
REST is a model of interaction rather than a protocol
What differentiates REST from SOAP?
- REST is not a protocol (SOAP is)
- SOAP can only make POST requests, REST can make all HTTP requests
- REST is stateless
- REST defines the format of messages (SOAP is only XML)
- REST can cache responses to GET requests, SOAP cannot