2.0 Communication Flashcards
What does HTTP stand for?
Hypertext Transfer Protocol
HTTP is a method for encoding and transporting data between a client and a server.
What type of protocol is HTTP?
Request/response protocol
What are the components of a basic HTTP request?
Verb (method) and resource (endpoint)
List three common HTTP verbs.
- GET
- POST
- DELETE
True or False: The GET method is idempotent.
True
Fill in the blank: The _______ method creates or replaces a resource.
PUT
What does TCP stand for?
Transmission Control Protocol
TCP is a connection-oriented protocol over an IP network.
What is a key feature of TCP?
Connection established and terminated using a handshake
What ensures packets are delivered in the original order in TCP?
Sequence numbers and acknowledgment packets
What is one disadvantage of TCP compared to UDP?
More delays and less efficient transmission
When should you use TCP over UDP?
- You need all of the data to arrive intact
- You want to automatically make a best estimate use of the network throughput
What does UDP stand for?
User Datagram Protocol
UDP is a connectionless protocol.
What is a key characteristic of UDP?
Datagrams might reach their destination out of order or not at all
List two scenarios where UDP is preferred over TCP.
- You need the lowest latency
- Late data is worse than loss of data
What is RPC?
Remote Procedure Call
In an RPC, a client causes a procedure to execute on a different address space.
What is the main disadvantage of using RPC?
Clients become tightly coupled to the service implementation
What does REST stand for?
Representational State Transfer
What is a key principle of REST?
Stateless communication
List the four qualities of a RESTful interface.
- Identify resources (URI)
- Change with representations (Verbs)
- Self-descriptive error message (status response)
- HATEOAS (HTML interface for HTTP)
True or False: REST is focused on exposing behaviors.
False
What is a disadvantage of REST?
It can require multiple round trips to fetch complicated resources
How is an RPC call structured?
Client calls the client stub, marshals the procedure id and arguments into a request message
What is the purpose of HATEOAS in REST?
Ensures the web service is fully accessible in a browser
Fill in the blank: REST minimizes the coupling between ______ and ______.
client, server
What is one reason to choose a native library for RPC?
You want to control how your ‘logic’ is accessed
List three popular RPC frameworks.
- Protobuf
- Thrift
- Avro
What is a key difference between RPC and REST in terms of operation?
RPC requires a new API for every new operation; REST uses standard HTTP methods