DevOps(Document Repository)
10.4K subscribers
55 photos
689 files
736 links
🌀🌀🌀🌀🌀🌀🌀🌀🌀🌀
The first Devops documentary community on Telegram🚀
🌀🌀🌀🌀🌀🌀🌀🌀🌀🌀

🟡 لینک گروه جهت تبادل:
https://t.iss.one/DevopsDocGP
Download Telegram
DevOps(Document Repository)
Photo
⚙️ #SystemDesign 📈📊📊

Data is cached everywhere, from the front end to the back end!
This diagram illustrates where we cache data in a typical architecture.
There are multiple layers along the flow :

1. Client apps: HTTP responses can be cached by the browser.
We request data over HTTP for the first time, and it is returned with an expiry policy in the HTTP header; we request data again, and the client app tries to retrieve the data from the browser cache first.

2. CDN: CDN caches static web resources. The clients can retrieve data from a CDN node nearby.
3. Load Balancer: The load Balancer can cache resources as well.

4. Messaging infra: Message brokers store messages on disk first, and then consumers retrieve them at their own pace.
Depending on the retention policy, the data is cached in Kafka clusters for a period of time.

5. Services: There are multiple layers of cache in a service. If the data is not cached in the CPU cache, the service will try to retrieve the data from memory. Sometimes the service has a second-level cache to store data on disk.

6. Distributed Cache: Distributed cache like Redis hold key-value pairs for multiple services in memory. It provides much better read/write performance than the database.

7. Full-text Search: we sometimes need to use full-text searches like Elastic Search for document search or log search. A copy of data is indexed in the search engine as well.

8. Database: Even in the database, we have different levels of caches:
WAL(Write-ahead Log): data is written to WAL first before building the B tree index

9. Bufferpool: A memory area allocated to cache query results
Materialized View: Pre-compute query results and store them in the database tables for better query performance

10. Transaction log: record all the transactions and database updates
Replication Log: used to record the replication state in a database cluster.

©️ From : ByteByteGo


Group:
©️ https://t.iss.one/DevopsDocGP
Channel:
©️ https://t.iss.one/DevopsDoc
Please open Telegram to view this post
VIEW IN TELEGRAM
👍4❤‍🔥2👌2
⚙️ #SystemDesign 📈📊📊

How to reduce the latency in any software system?


1. Caching

Temporarily storing frequently accessed data in memory to reduce access time.

How It Helps:
Data Retrieval: Fetching data from a cache (e.g., Redis, Memcached) is significantly faster than querying a database.
Content Delivery: Caching static assets (like images, CSS, JS) reduces the need to retrieve them from the origin server repeatedly.


2. Load Balancing
Distributing incoming network traffic across multiple servers to ensure no single server becomes a bottleneck.

How It Helps:
Resource Utilization: Balances the load to prevent any single server from becoming overwhelmed, which can slow down response times.
Redundancy: Provides failover capabilities, ensuring requests are handled promptly even if some servers are down.


3. Asynchronous Processing
Handling tasks in the background without blocking the main execution thread, allowing the system to continue processing other requests.

How It Helps:
Non-blocking Operations: Users don't have to wait for long-running tasks (like sending emails or processing images) to complete.


4. Data Partitioning (Sharding)
Dividing a database into smaller, more manageable pieces (shards) that can be distributed across multiple servers.


How It Helps:
Parallelism: Queries can be executed in parallel across shards, reducing the time to retrieve data.
Scalability: Distributes the load, preventing any single database instance from becoming a bottleneck.


5. Content Delivery Networks (CDNs)
Distributed networks of servers that deliver web content based on the geographic location of the user.

How It Helps:
Proximity: Serves content from servers closest to the user, reducing the physical distance data must travel.
Caching: Caches static and dynamic content to speed up delivery.


6. Database Optimization
Tuning databases to perform queries more efficiently through indexing, query optimization, and proper schema design.

How It Helps:
Indexing: Speeds up data retrieval by allowing the database to find records without scanning entire tables.


7. Minimizing Network Hops
Reducing the number of intermediary steps data must pass through and choosing efficient communication protocols.

How It Helps:
Fewer Hops: Each network hop introduces additional latency; minimizing them speeds up data transmission.


8. Prefetching and Predictive Loading
Anticipating future data requests and loading them in advance.

How It Helps:
Reduced Wait Times: Data is already available when requested, eliminating retrieval delays.
Smoother User Experience: Especially effective in applications with predictable access patterns.

©️ From : DesignGurus


Group:
©️ https://t.iss.one/DevopsDocGP
Channel:
©️ https://t.iss.one/DevopsDoc
Please open Telegram to view this post
VIEW IN TELEGRAM
👌4🐳21👍1👏1
⚙️ #SystemDesign 📈📊📊


Popular Redis Use Cases


1. Caching
The most common use case is to utilize Redis for caching. This helps protect the database layer from overloading. Redis offers fast lookup for cached data and can help improve application performance.

2. Session Store
We use Redis to share user session data among stateless servers. Redis provides a centralized place to store session dat and makes it easy to scale out servers.

3. Distributed lock
We use Redis distributed locks to grant mutually exclusive access to shared resources. This prevents race conditions in distributed systems. Redis locks are easy to implement and automatically expire.

4. Counter and Rate Limiter
We use Redis to track like counts, view counts etc on social media apps. Redis counters provide atomic increments/ decrements. We also use Redis to enforce rate limits on our API endpoints. This helps prevent abuse.

5. Leaderboard
Sorted sets make it easy to implement gaming leaderboards in Redis. We can add, update, or remove users from the leaderboard and query ranges efficiently.

©️ From : ByteByteGo


Group:
©️ https://t.iss.one/DevopsDocGP
Channel:
©️ https://t.iss.one/DevopsDoc
Please open Telegram to view this post
VIEW IN TELEGRAM
3🐳3👍1👏1👌1
⚙️ #SystemDesign 📈📊📊

Forward proxy Vs Reverse proxy


A forward proxy is a server that sits between user devices and the internet. A forward proxy is commonly used for:

- Protect clients
- Avoid browsing restrictions
- Block access to certain content


A reverse proxy is a server that accepts a request from the client, forwards the request to web servers, and returns the results to the client as if the proxy server had processed the request. A reverse proxy is good for:

- Protect servers
- Load balancing
- Cache static contents
- Encrypt and decrypt SSL communications


©️ From : ByteByteGo


Group:
©️ https://t.iss.one/DevopsDocGP
Channel:
©️ https://t.iss.one/DevopsDoc
Please open Telegram to view this post
VIEW IN TELEGRAM
6👌4👍3
⚙️ #SystemDesign 📈📊📊

A Quick Reference to Database Scaling


1. Indexing: Analyze query patterns and create optimal indexes

2. Materialized Views: Pre-compute and store complex query results

3. Denormalization: Simplify joins to boost query performance

4. Vertical Scaling: Upgrade server resources (CPU, RAM, storage)

5. Caching: Store frequent data in faster memory

6. Replication: Create database copies on replicas to scale reads

7. Sharding: Distribute data across servers for improved scalability


©️ From : ByteByteGo


Group:
©️ https://t.iss.one/DevopsDocGP
Channel:
©️ https://t.iss.one/DevopsDoc
Please open Telegram to view this post
VIEW IN TELEGRAM
😍31👍1👏1
⚙️ #SystemDesign 📈📊📊

SSH Under the Hood

Secure Shell (SSH) creates an encrypted channel between client and server.
The process begins with a TCP connection, followed by version negotiation.
Both parties then agree on encryption algorithms, key exchange methods, and message authentication codes.
The client and server perform a key exchange (typically using Diffie-Hellman) to securely generate a shared session key for encrypting the connection.
For authentication, SSH commonly uses public key authentication.
The server verifies the client's identity through a challenge-response mechanism using the client's public key, without the private key ever being transmitted.
Once authenticated, the session key encrypts all further communication, providing a secure channel.


©️ From : ByteByteGo


Group:
©️ https://t.iss.one/DevopsDocGP
Channel:
©️ https://t.iss.one/DevopsDoc
Please open Telegram to view this post
VIEW IN TELEGRAM
👍43👌3
⚙️ #SystemDesign 📈📊📊

🤔How Do Companies Ship Code to Production?

Here are 11 steps from planning to production:
➡️
1) The Product Owner starts the entire process by creating user stories in a tool like Jira.

2) The Developer Team performs Sprint Planning activity and adds the user stories to the sprint.

3) Developers work on the assigned stories. Once a story is finished, they commit the code to Git and push it to GitHub.

4) Jenkins builds and runs the code through testing and quality check tools such as JUnit, Jacoco, and SonarQube.

5) If the build is successful, it is stored in the artifactory such as JFrog. Jenkins also deploys the build to the Dev Environment via Docker.

6) Next up, the feature gets deployed to the QA environment.
Since multiple teams may be working on the same code base, multiple QA environments will be created.

7) The QA team uses a particular QA environment and runs multiple test types such as QA, regression, and performance.

8) Once the QA verification is complete, features are deployed to the UAT (User Acceptance Testing) environment.

9) UAT testing verifies whether the feature satisfies the user's requirements.

10) Once the UAT testing is successful, the builds become release candidates. They are deployed to the production environment based on a specific schedule.

11) The SRE team uses tools like ELK and Prometheus to monitor the production environment and handle alerts in case of issues.


©️ From : ByteByteGo


Group:
©️ https://t.iss.one/DevopsDocGP
Channel:
©️ https://t.iss.one/DevopsDoc
Please open Telegram to view this post
VIEW IN TELEGRAM
5👍2😍2
⚙️ #SystemDesign 📈📊📊

An HTTP server cannot automatically initiate a connection to a browser. As a result, the web browser is the initiator. What should we do next to get real-time updates from the HTTP server?

Both the web browser and the HTTP server could be responsible for this task.

🔴Web browsers do the heavy lifting: short polling or long polling. With short polling, the browser will retry until it gets the latest data. With long polling, the HTTP server doesn't return results until new data has arrived.
🔴HTTP server and web browser cooperate: WebSocket or SSE (server-sent event). In both cases, the HTTP server could directly send the latest data to the browser after the connection is established. The difference is that SSE is uni-directional, so the browser cannot send a new request to the server, while WebSocket is fully-duplex, so the browser can keep sending new requests.

➡️Over to you: of the four solutions (long polling, short polling, SSE, WebSocket), which ones are commonly used, and for what use cases?


©️ From : ByteByteGo


Group:
©️ https://t.iss.one/DevopsDocGP
Channel:
©️ https://t.iss.one/DevopsDoc
Please open Telegram to view this post
VIEW IN TELEGRAM
7👍2👌1