IP4
An IPv4 address consists of four parts. Each part can store 8 bits, i.e., values from 0 to 255. Every IP has two parts: the Network part and the Host part. These parts are determined using CIDR.
The CIDR can range from 0 to 32, because IPv4 addresses are 32 bits long. If we go beyond 32, it is not valid.
Concept of Reverse Proxy
We cannot directly route incoming traffic to multiple IPs at the same time if a service is running on multiple machines. So, we use a Reverse Proxy. The incoming traffic is first directed to the reverse proxy, which then forwards it to different systems.
Analogy: Similar to a load balancer in AWS Cloud.
How it fetches the IP through the DNS?
Before starting, let's be clear about what DNS is. DNS is like a label that maps a domain name to an IP address.
Let’s say we are searching for "WIKIPEDIA".
First, the machine checks within itself (browser/cache) asking, "Do you remember the IP of Wikipedia?" If it doesn’t find it there, the request is forwarded to the router/modem. If it still doesn’t know, it is sent to the resolver (Internet Service Provider).
If the resolver also doesn’t have it cached, it queries the Root Name Server. From there, it is directed to the appropriate Top-Level Domain (TLD) server like .com, .in, or .org. Then it reaches the authoritative name server, where it finds Wikipedia’s IP from the zone file.
Finally, the IP address is returned back to the user.
HTTP methods used in API
GET POST PUT PATCH DELETE
GET is used to fetch data.
POST is used to create new data.
PUT is used to update/replace the entire resource.
PATCH is used to partially update the data.
DELETE is used to delete the data.
IDEMPOTENCY
It means performing the same operation multiple times has the same effect as performing it once.
GET, PUT, and DELETE are idempotent.
POST is not idempotent.
PATCH depends on how it is implemented.
Why HTTPS over HTTP?
In HTTP, the data is sent in plain text, so intermediaries (like ISPs) can read your data.
In HTTPS, the data is encrypted using TLS/SSL, making it secure and unreadable to others.
Top comments (0)