Adding content to 115-communication

content/system-design
syedmouaazfarrukh 2 years ago
parent c72acfc86d
commit bf5f25d30e
  1. 9
      src/roadmaps/system-design/content/115-communication/100-http.md
  2. 14
      src/roadmaps/system-design/content/115-communication/101-tcp.md
  3. 19
      src/roadmaps/system-design/content/115-communication/102-udp.md
  4. 8
      src/roadmaps/system-design/content/115-communication/103-rpc.md
  5. 16
      src/roadmaps/system-design/content/115-communication/104-rest.md
  6. 8
      src/roadmaps/system-design/content/115-communication/105-grpc.md
  7. 9
      src/roadmaps/system-design/content/115-communication/106-graphql.md
  8. 29
      src/roadmaps/system-design/content/115-communication/index.md

@ -1 +1,8 @@
# Http
# HTTP
HTTP is a method for encoding and transporting data between a client and a server. It is a request/response protocol: clients issue requests and servers issue responses with relevant content and completion status info about the request. HTTP is self-contained, allowing requests and responses to flow through many intermediate routers and servers that perform load balancing, caching, encryption, and compression.
To learn more, visit the following links:
- [What Is HTTP?](https://www.nginx.com/resources/glossary/http/)
- [What is the difference between HTTP protocol and TCP protocol?](https://www.quora.com/What-is-the-difference-between-HTTP-protocol-and-TCP-protocol)

@ -1 +1,13 @@
# Tcp
# TCP
TCP is a connection-oriented protocol over an IP network. Connection is established and terminated using a handshake. All packets sent are guaranteed to reach the destination in the original order and without corruption through:
- Sequence numbers and checksum fields for each packet
- Acknowledgement packets and automatic retransmission
If the sender does not receive a correct response, it will resend the packets. If there are multiple timeouts, the connection is dropped. TCP also implements flow control and congestion control. These guarantees cause delays and generally result in less efficient transmission than UDP.
To learn more, visit the following links:
- [What Is TCP?](https://github.com/donnemartin/system-design-primer#TCP)
- [What is the difference between HTTP protocol and TCP protocol?](https://www.quora.com/What-is-the-difference-between-HTTP-protocol-and-TCP-protocol)

@ -1 +1,18 @@
# Udp
# UDP
UDP is connectionless. Datagrams (analogous to packets) are guaranteed only at the datagram level. Datagrams might reach their destination out of order or not at all. UDP does not support congestion control. Without the guarantees that TCP support, UDP is generally more efficient.
UDP can broadcast, sending datagrams to all devices on the subnet. This is useful with DHCP because the client has not yet received an IP address, thus preventing a way for TCP to stream without the IP address.
UDP is less reliable but works well in real time use cases such as VoIP, video chat, streaming, and realtime multiplayer games.
Use UDP over TCP when:
- You need the lowest latency
- Late data is worse than loss of data
- You want to implement your own error correction
To learn more, visit the following link:
- [What Is UDP?](https://github.com/donnemartin/system-design-primer#UDP)
- [Difference between TCP and UDP?](https://stackoverflow.com/questions/5970383/difference-between-tcp-and-udp)

@ -1 +1,7 @@
# Rpc
# RPC
In an RPC, a client causes a procedure to execute on a different address space, usually a remote server. The procedure is coded as if it were a local procedure call, abstracting away the details of how to communicate with the server from the client program. Remote calls are usually slower and less reliable than local calls so it is helpful to distinguish RPC calls from local calls. Popular RPC frameworks include Protobuf, Thrift, and Avro.
To learn more, visit the following links:
- [What Is RPC?](https://github.com/donnemartin/system-design-primer#RPC)

@ -1 +1,15 @@
# Rest
# REST
REST is an architectural style enforcing a client/server model where the client acts on a set of resources managed by the server. The server provides a representation of resources and actions that can either manipulate or get a new representation of resources. All communication must be stateless and cacheable.
There are four qualities of a RESTful interface:
- Identify resources (URI in HTTP) - use the same URI regardless of any operation.
- Change with representations (Verbs in HTTP) - use verbs, headers, and body.
- Self-descriptive error message (status response in HTTP) - Use status codes, don't reinvent the wheel.
- HATEOAS (HTML interface for HTTP) - your web service should be fully accessible in a browser.
To learn more, visit the following links:
- [What Is REST?](https://github.com/donnemartin/system-design-primer#REST)
- [What are the drawbacks of using RESTful APIs?](https://www.quora.com/What-are-the-drawbacks-of-using-RESTful-APIs)

@ -1 +1,7 @@
# Grpc
# gRPC
gRPC is a high-performance, open-source framework for building remote procedure call (RPC) APIs. It is based on the Protocol Buffers data serialization format and supports a variety of programming languages, including C#, Java, and Python.
Learn more from the following links:
- [What Is gRPC?](https://www.wallarm.com/what/the-concept-of-grpc)

@ -1 +1,8 @@
# Graphql
# GraphQL
GraphQL is a query language and runtime for building APIs. It allows clients to define the structure of the data they need and the server will return exactly that. This is in contrast to traditional REST APIs, where the server exposes a fixed set of endpoints and the client must work with the data as it is returned.
To learn more, visit the following links:
- [GraphQL Server](https://www.howtographql.com/basics/3-big-picture/)
- [What is GraphQL?](https://www.redhat.com/en/topics/api/what-is-graphql)

@ -1 +1,28 @@
# Communication
# Communication
## Hypertext transfer protocol (HTTP)
HTTP is a method for encoding and transporting data between a client and a server. It is a request/response protocol: clients issue requests and servers issue responses with relevant content and completion status info about the request. HTTP is self-contained, allowing requests and responses to flow through many intermediate routers and servers that perform load balancing, caching, encryption, and compression.
## Transmission control protocol (TCP)
TCP is a connection-oriented protocol over an IP network. Connection is established and terminated using a handshake. All packets sent are guaranteed to reach the destination in the original order and without corruption through:
- Sequence numbers and checksum fields for each packet
- Acknowledgement packets and automatic retransmission
## User datagram protocol (UDP)
UDP is connectionless. Datagrams (analogous to packets) are guaranteed only at the datagram level. Datagrams might reach their destination out of order or not at all. UDP does not support congestion control. Without the guarantees that TCP support, UDP is generally more efficient.
UDP can broadcast, sending datagrams to all devices on the subnet. This is useful with DHCP because the client has not yet received an IP address, thus preventing a way for TCP to stream without the IP address.
## Remote procedure call (RPC)
In an RPC, a client causes a procedure to execute on a different address space, usually a remote server. The procedure is coded as if it were a local procedure call, abstracting away the details of how to communicate with the server from the client program. Remote calls are usually slower and less reliable than local calls so it is helpful to distinguish RPC calls from local calls. Popular RPC frameworks include Protobuf, Thrift, and Avro.
## Representational state transfer (REST)
REST is an architectural style enforcing a client/server model where the client acts on a set of resources managed by the server. The server provides a representation of resources and actions that can either manipulate or get a new representation of resources. All communication must be stateless and cacheable.
To learn more, visit the following links:
- [Getting started with Communication](https://github.com/donnemartin/system-design-primer)
Loading…
Cancel
Save