Tech Articles – (please note these posts are collated from AmigosCode, Alex Xu and many others. Full copyright to the owners of their material)
- HTTP (Hypertext Transfer Protocol): The foundation of data communication on the web, HTTP allows web pages to be requested and delivered across the internet.
- HTTPS (Hypertext Transfer Protocol Secure): An extension of HTTP, HTTPS adds a layer of security by encrypting data, making it safer for sensitive transactions online.
- FTP (File Transfer Protocol): A protocol used to transfer files between computers over a network, FTP is essential for managing and sharing large amounts of data.
- TCP (Transmission Control Protocol): Ensures that data sent over the internet arrives intact and in the correct order, making it reliable for most applications.
- IP (Internet Protocol): The addressing system for the internet, IP assigns unique addresses to devices, enabling them to be identified and communicate with each other.
- UDP (User Datagram Protocol): A faster but less reliable protocol compared to TCP, UDP is ideal for applications where speed is critical, like gaming and video streaming.
- SMTP (Simple Mail Transfer Protocol): The protocol responsible for sending emails across networks, ensuring messages reach their intended recipients.
- SSH (Secure Shell): A protocol that provides secure access to remote computers, widely used for system administration and secure data transfers.
- IMAP (Internet Message Access Protocol): Allows users to access and manage their email on a remote server, making it easier to sync messages across multiple devices.
1. HTTP GET This retrieves a resource from the server. It is idempotent. Multiple identical requests return the same result. '
2. HTTP PUT This updates or Creates a resource. It is idempotent. Multiple identical requests will update the same resource.
3. HTTP POST This is used to create new resources. It is not idempotent, making two identical POST will duplicate the resource creation.
4. HTTP DELETE This is used to delete a resource. It is idempotent. Multiple identical requests will delete the same resource.
5. HTTP PATCH The PATCH method applies partial modifications to a resource.
6. HTTP HEAD The HEAD method asks for a response identical to a GET request but without the response body.
7. HTTP CONNECT The CONNECT method establishes a tunnel to the server identified by the target resource.
8. HTTP OPTIONS This describes the communication options for the target resource.
9. HTTP TRACE This performs a message loop-back test along the path to the target resource.
Kafka was originally built for massive log processing. It retains messages until expiration and lets consumers pull messages at their own pace. Let’s review the popular Kafka use cases.
- Log processing and analysis
- Data streaming in recommendations
- System monitoring and alerting
- CDC (Change data capture)
- System migration
Step 1 – The client sends an HTTP request to the API gateway.
Step 2 – The API gateway parses and validates the attributes in the HTTP request.
Step 3 – The API gateway performs allow-list/deny-list checks.
Step 4 – The API gateway talks to an identity provider for authentication and authorization.
Step 5 – The rate limiting rules are applied to the request. If it is over the limit, the request is rejected.
Steps 6 and 7 – Now that the request has passed basic checks, the API gateway finds the relevant service to route to by path matching.
Step 8 – The API gateway transforms the request into the appropriate protocol and sends it to backend microservices.
Steps 9-12: The API gateway can handle errors properly, and deals with faults if the error takes a longer time to recover (circuit break). It can also leverage ELK (Elastic-Logstash-Kibana) stack for logging and monitoring. We sometimes cache data in the API gateway.
Over to you: 1) What’s the difference between a load balancer and an API gateway? 2) Do we need to use different API gateways for PC, mobile and browser separately?