Skip to main content

Posts

Showing posts from September, 2023

Distributed Caches and Data Consistency: Boosting Performance with Effective Caching Strategies

What are Distributed CACHES and how do they manage DATA CONSISTENCY? What is a Cache?  Caching is a common technique used to reduce latency and minimize the load on backend resources like databases or external services. Saves network calls Avoid repeated computations Reduce DB Load Cache Policy -> LRU -> Least Recently Used -> LRU operates on the principle that when the cache is full and a new item needs to be added, the item that hasn't been used for the longest time is the one selected for removal. Thrashing -> due to low-performing cache policy -> excessive evictions and replacements, leading to poor cache performance and inefficiency Caching Strategies ->  Write-through cache , whenever data is modified or written to the cache, the same write operation is immediately performed on the corresponding location in the main memory or backing store. This ensures that the main memory is always up-to-date with the data in the cache. Write-back cache , changes to...

HTTP and HTTPS Protocols Explained

HyperText Transfer Protocol (HTTP) is a fundamental application layer protocol used for accessing and transferring various types of data, including text, images, videos, and more, over the World Wide Web. It operates as a client-server protocol, relying on the TCP/IP family of protocols, and follows a request-response model. HTTP typically operates on port number 80, and its operation involves the following key steps: Request-Response : In HTTP, a client sends a request message to a server, specifying the desired data or resource. The server processes this request and responds accordingly. TCP Connection : After receiving the request, HTTP establishes a TCP connection between the client and the server to facilitate data transfer. Data Retrieval : The server collects and sends the requested data back to the client over the established connection. Connection Termination : Once the data exchange is complete, the connection between the client and the server is terminated. If further reques...