From bf5f25d30e460fd4a229294e2ce1f1165b8361a8 Mon Sep 17 00:00:00 2001 From: syedmouaazfarrukh Date: Wed, 18 Jan 2023 06:34:31 -0800 Subject: [PATCH] Adding content to 115-communication --- .../content/115-communication/100-http.md | 9 +++++- .../content/115-communication/101-tcp.md | 14 ++++++++- .../content/115-communication/102-udp.md | 19 +++++++++++- .../content/115-communication/103-rpc.md | 8 ++++- .../content/115-communication/104-rest.md | 16 +++++++++- .../content/115-communication/105-grpc.md | 8 ++++- .../content/115-communication/106-graphql.md | 9 +++++- .../content/115-communication/index.md | 29 ++++++++++++++++++- 8 files changed, 104 insertions(+), 8 deletions(-) diff --git a/src/roadmaps/system-design/content/115-communication/100-http.md b/src/roadmaps/system-design/content/115-communication/100-http.md index b0e41f6d5..5edc4bab2 100644 --- a/src/roadmaps/system-design/content/115-communication/100-http.md +++ b/src/roadmaps/system-design/content/115-communication/100-http.md @@ -1 +1,8 @@ -# Http \ No newline at end of file +# 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) \ No newline at end of file diff --git a/src/roadmaps/system-design/content/115-communication/101-tcp.md b/src/roadmaps/system-design/content/115-communication/101-tcp.md index 2ff51ffd4..b486a1498 100644 --- a/src/roadmaps/system-design/content/115-communication/101-tcp.md +++ b/src/roadmaps/system-design/content/115-communication/101-tcp.md @@ -1 +1,13 @@ -# Tcp \ No newline at end of file +# 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) \ No newline at end of file diff --git a/src/roadmaps/system-design/content/115-communication/102-udp.md b/src/roadmaps/system-design/content/115-communication/102-udp.md index 88c788fb4..f01e13681 100644 --- a/src/roadmaps/system-design/content/115-communication/102-udp.md +++ b/src/roadmaps/system-design/content/115-communication/102-udp.md @@ -1 +1,18 @@ -# Udp \ No newline at end of file +# 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) \ No newline at end of file diff --git a/src/roadmaps/system-design/content/115-communication/103-rpc.md b/src/roadmaps/system-design/content/115-communication/103-rpc.md index 82d418a48..205ca03e0 100644 --- a/src/roadmaps/system-design/content/115-communication/103-rpc.md +++ b/src/roadmaps/system-design/content/115-communication/103-rpc.md @@ -1 +1,7 @@ -# Rpc \ No newline at end of file +# 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) diff --git a/src/roadmaps/system-design/content/115-communication/104-rest.md b/src/roadmaps/system-design/content/115-communication/104-rest.md index 5088a865c..99fc65ac9 100644 --- a/src/roadmaps/system-design/content/115-communication/104-rest.md +++ b/src/roadmaps/system-design/content/115-communication/104-rest.md @@ -1 +1,15 @@ -# Rest \ No newline at end of file +# 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) \ No newline at end of file diff --git a/src/roadmaps/system-design/content/115-communication/105-grpc.md b/src/roadmaps/system-design/content/115-communication/105-grpc.md index 5d543f43c..f36b64680 100644 --- a/src/roadmaps/system-design/content/115-communication/105-grpc.md +++ b/src/roadmaps/system-design/content/115-communication/105-grpc.md @@ -1 +1,7 @@ -# Grpc \ No newline at end of file +# 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) \ No newline at end of file diff --git a/src/roadmaps/system-design/content/115-communication/106-graphql.md b/src/roadmaps/system-design/content/115-communication/106-graphql.md index 92b738b69..53928a758 100644 --- a/src/roadmaps/system-design/content/115-communication/106-graphql.md +++ b/src/roadmaps/system-design/content/115-communication/106-graphql.md @@ -1 +1,8 @@ -# Graphql \ No newline at end of file +# 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) \ No newline at end of file diff --git a/src/roadmaps/system-design/content/115-communication/index.md b/src/roadmaps/system-design/content/115-communication/index.md index 7e37400e2..4aec47310 100644 --- a/src/roadmaps/system-design/content/115-communication/index.md +++ b/src/roadmaps/system-design/content/115-communication/index.md @@ -1 +1,28 @@ -# Communication \ No newline at end of file +# 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) \ No newline at end of file