Wk 3 Storage Flashcards
Microservice bus function:
Connects microservices together with an open pluggable framework.
Instead of all services having a different protocol you have a common protocol “Bus”.
Microservice bus Characteristics :
It has a single:
- communication protocol
- Data format
- Interface convention
Ex:
Http
Json
Rest
Http:
Synchronous protocol.
Client sends a request and then blocks the channel until it receives a response form the server.
It is well understood, widely implemented and trusted
Http request sections:
- Request Line
- Headers
- Body ( optional)
Rest
Representational state transfer. ( Way to standardize APIs)
What are a the resources provided by microservices:
Resources are formed by combining smaller resources.
Not all resources fit together.
Resources archetypes:
- Documents
- Collection
- Store
- Controller
Documents:
Describe operations on files like resources.
Ex GET PUT DELETE
Collection:
Operations on directory like resources.
The server chooses the name of the resources.
Ex
Get reads directory
Post create new resource in the directory
Store:
Collection of objects.
Each item in the store is named differently.
Operations are directory like but the user decides the object name.
Controller:
Describes impossibile operations on external resources.
Posts causes the external resource to carry out some task and returns any result.
Google remote procedure call
Services connected through grpc are defined using protocol buffers (type safety) and binary data ( for efficient transfer)
How does grpc work:
You agree between two services a binary format that you are going to exchange there after you use your binary encoding.
Benefit or grpc
7 times faster than REST when recieving data and 10 times faster when sending.
( No need to change the data to JSON)
An enterprise computer system may store data using:
- centralised database
- distributed database
Centralised database / monolith database andvantages:
- easier
- ensures accuracy
- consistency of data is maintained
- completeness
Disadvantages of centralised databases:
Everything is coupled so you need an agreement from all departments to effect a change.
Centralised database transactions:
- Commit ( completes successfully) database is moved to a new consistent state
-Aborts ( completes unsuccessfully) the database is restored to a previous consistent state