Afif Dev (@afif_dev) header
Afif Dev (@afif_dev) profile picture

🧑🏻‍💻 HTML Developer

virtual env (homeless)
Joined January 2022
Photo by Afif Dev (@afif_dev)Photo by Afif Dev (@afif_dev)Photo by Afif Dev (@afif_dev)Photo by Afif Dev (@afif_dev)Photo by Afif Dev (@afif_dev)Photo by Afif Dev (@afif_dev)Photo by Afif Dev (@afif_dev)Photo by Afif Dev (@afif_dev)Photo by Afif Dev (@afif_dev)Photo by Afif Dev (@afif_dev)
Afif Dev retweeted
If you'd rather run things locally, you can. It's a good way to understand the internals, and it keeps your data on your own machine. Here are 5 easy ways to run LLMs locally.
How to Run LLMs Locally
3
19
118
19,000
Afif Dev retweeted
FAANG is dead. Now MANGOS is dominating the world.
92
4
3
166
13,684
Afif Dev retweeted
What does API gateway do?
5
148
1
878
97,117
Logging, tracing and metrics are 3 pillars of system observability. The diagram below shows their definitions and typical architectures. 🔹 Logging Logging records discrete events in the system. For example, we can record an incoming request or a visit to databases as events. It has the highest volume. ELK (Elastic-Logstash-Kibana) stack is often used to build a log analysis platform. We often define a standardized logging format for different teams to implement, so that we can leverage keywords when searching among massive amounts of logs. 🔹 Tracing Tracing is usually request-scoped. For example, a user request goes through the API gateway, load balancer, service A, service B, and database, which can be visualized in the tracing systems. This is useful when we are trying to identify the bottlenecks in the system. We use OpenTelemetry to showcase the typical architecture, which unifies the 3 pillars in a single framework. 🔹 Metrics Metrics are usually aggregatable information from the system. For example, service QPS, API responsiveness, service latency, etc. The raw data is recorded in time-series databases like InfluxDB. Prometheus pulls the data and transforms the data based on pre-defined alerting rules. Then the data is sent to Grafana for display or to the alert manager which then sends out email, SMS, or Slack notifications or alerts. 🔹 Over to you: Which tools have you used for system monitoring? -- Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): bit.ly/bbg-social
5
146
2
711
66,048
JavaScript 💔
71
147
41
1,402
83,750
Afif Dev retweeted
15 Open-Source Projects That Changed the World
24
341
10
2,042
157,718
Oauth 2.0 Explained With Simple Terms. OAuth 2.0 is a powerful and secure framework that allows different applications to securely interact with each other on behalf of users without sharing sensitive credentials. The entities involved in OAuth are the User, the Server, and the Identity Provider (IDP). What Can an OAuth Token Do? When you use OAuth, you get an OAuth token that represents your identity and permissions. This token can do a few important things: Single Sign-On (SSO): With an OAuth token, you can log into multiple services or apps using just one login, making life easier and safer. Authorization Across Systems: The OAuth token allows you to share your authorization or access rights across various systems, so you don't have to log in separately everywhere. Accessing User Profile: Apps with an OAuth token can access certain parts of your user profile that you allow, but they won't see everything. Remember, OAuth 2.0 is all about keeping you and your data safe while making your online experiences seamless and hassle-free across different applications and services. Over to you: Imagine you have a magical power to grant one wish to OAuth 2.0. What would that be? Maybe your suggestions actually lead to OAuth 3. -- Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): bit.ly/bbg-social
3
215
4
1,046
87,166
Life is Short, Use Dev Tools
20
533
12
3,344
312,362
Afif Dev retweeted
Why is Nginx so popular?
9
192
4
1,173
150,350
Afif Dev retweeted
Forward Proxy vs Reverse Proxy A forward proxy (or just proxy) is a server that sits between user devices and the internet. A forward proxy is commonly used for: - Protecting client privacy and anonymity - Avoiding browsing restrictions - Blocking access to certain content A reverse proxy is a server that accepts requests from clients, forwards them to backend web servers, and returns the responses to the clients. The clients interact with the reverse proxy as if it was the origin server. Reverse proxies are good for: - Protecting backend servers from direct exposure to clients - Load balancing requests across multiple backend servers - Caching static content closer to clients for faster delivery - Terminating SSL connections and offloading encryption/decryption tasks from the backend servers The key difference is that a forward proxy acts on behalf of clients, while a reverse proxy acts on behalf of servers. Forward proxies handle outbound requests to external servers, while reverse proxies handle inbound requests coming from clients. – Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): bit.ly/496keA7
2
62
278
19,001
A nice cheat sheet of different monitoring infrastructure in cloud services. This cheat sheet offers a concise yet comprehensive comparison of key monitoring elements across the three major cloud providers and open-source / 3rd party tools. Let's delve into the essential monitoring aspects covered: - Data Collection: Gather information from diverse sources to enhance decision-making. - Data Storage: Safely store and manage data for future analysis and reference. - Data Analysis: Extract valuable insights from data to drive informed actions. - Alerting: Receive real-time notifications about critical events or anomalies. - Visualization: Present data in a visually comprehensible format for better understanding. - Reporting and Compliance: Generate reports and ensure adherence to regulatory standards. - Automation: Streamline processes and tasks through automated workflows. - Integration: Seamlessly connect and exchange data between different systems or tools. - Feedback Loops: Continuously refine strategies based on feedback and performance analysis. Over to you: How do you prioritize and leverage these essential monitoring aspects in your domain to achieve better outcomes and efficiency? – Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): bit.ly/3KCnWXq
7
104
1
527
66,957
REST API Vs. GraphQL When it comes to API design, REST and GraphQL each have their own strengths and weaknesses. REST - Uses standard HTTP methods like GET, POST, PUT, DELETE for CRUD operations. - Works well when you need simple, uniform interfaces between separate services/applications. - Caching strategies are straightforward to implement. - The downside is it may require multiple roundtrips to assemble related data from separate endpoints. GraphQL - Provides a single endpoint for clients to query for precisely the data they need. - Clients specify the exact fields required in nested queries, and the server returns optimized payloads containing just those fields. - Supports Mutations for modifying data and Subscriptions for real-time notifications. - Great for aggregating data from multiple sources and works well with rapidly evolving frontend requirements. - However, it shifts complexity to the client side and can allow abusive queries if not properly safeguarded - Caching strategies can be more complicated than REST. The best choice between REST and GraphQL depends on the specific requirements of the application and development team. GraphQL is a good fit for complex or frequently changing frontend needs, while REST suits applications where simple and consistent contracts are preferred. – Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): bit.ly/3KCnWXq
1
124
4
496
42,836
weAllNeedBackupPlans reddit.com/r/programmerhumor…
15
120
18
924
69,265
Nmap
9
394
2
2,243
304,732
Have you heard of the 12-Factor App? The "12 Factor App" offers a set of best practices for building modern software applications. Following these 12 principles can help developers and teams in building reliable, scalable, and manageable applications. Here's a brief overview of each principle: 1. Codebase: Have one place to keep all your code, and manage it using version control like Git. 2. Dependencies: List all the things your app needs to work properly, and make sure they're easy to install. 3. Config: Keep important settings like database credentials separate from your code, so you can change them without rewriting code. 4. Backing Services: Use other services (like databases or payment processors) as separate components that your app connects to. 5. Build, Release, Run: Make a clear distinction between preparing your app, releasing it, and running it in production. 6. Processes: Design your app so that each part doesn't rely on a specific computer or memory. It's like making LEGO blocks that fit together. 7. Port Binding: Let your app be accessible through a network port, and make sure it doesn't store critical information on a single computer. 8. Concurrency: Make your app able to handle more work by adding more copies of the same thing, like hiring more workers for a busy restaurant. 9. Disposability: Your app should start quickly and shut down gracefully, like turning off a light switch instead of yanking out the power cord. 10. Dev/Prod Parity: Ensure that what you use for developing your app is very similar to what you use in production, to avoid surprises. 11. Logs: Keep a record of what happens in your app so you can understand and fix issues, like a diary for your software. 12. Admin Processes: Run special tasks separately from your app, like doing maintenance work in a workshop instead of on the factory floor. Over to you: Where do you think these principles can have the most impact in improving software development practices? -- Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): bit.ly/3KCnWXq
1
162
2
618
42,393
whatVersionAreYouUsing reddit.com/r/programmerhumor…
34
144
31
1,765
77,533
Afif Dev retweeted
What does a typical microservice architecture look like? 👇 The diagram below shows a typical microservice architecture. 🔹Load Balancer: This distributes incoming traffic across multiple backend services. 🔹CDN (Content Delivery Network): CDN is a group of geographically distributed servers that hold static content for faster delivery. The clients look for content in CDN first, then progress to backend services. 🔹API Gateway: This handles incoming requests and routes them to the relevant services. It talks to the identity provider and service discovery. 🔹Identity Provider: This handles authentication and authorization for users. 🔹Service Registry & Discovery: Microservice registration and discovery happen in this component, and the API gateway looks for relevant services in this component to talk to. 🔹Management: This component is responsible for monitoring the services. 🔹Microservices: Microservices are designed and deployed in different domains. Each domain has its own database. The API gateway talks to the microservices via REST API or other protocols, and the microservices within the same domain talk to each other using RPC (Remote Procedure Call). Benefits of microservices: - They can be quickly designed, deployed, and horizontally scaled. - Each domain can be independently maintained by a dedicated team. - Business requirements can be customized in each domain and better supported, as a result. Over to you: 1). What are the drawbacks of the microservice architecture? 2). Have you seen a monolithic system be transformed into microservice architecture? How long does it take? – Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): bit.ly/3KCnWXq
4
128
490
33,813
Afif Dev retweeted
Creating a system using microservices is extremely difficult unless you follow some strong principles. 9 best practices that you must know before building microservices: 1 - Design For Failure A distributed system with microservices is going to fail. You must design the system to tolerate failure at multiple levels such as infrastructure, database, and individual services. Use circuit breakers, bulkheads, or graceful degradation methods to deal with failures. 2 - Build Small Services A microservice should not do multiple things at once. A good microservice is designed to do one thing well. 3 - Use lightweight protocols for communication Communication is the core of a distributed system. Microservices must talk to each other using lightweight protocols. Options include REST, gRPC, or message brokers. 4 - Implement service discovery To communicate with each other, microservices need to discover each other over the network. Implement service discovery using tools such as Consul, Eureka, or Kubernetes Services 5 - Data Ownership In microservices, data should be owned and managed by the individual services. The goal should be to reduce coupling between services so that they can evolve independently. 6 - Use resiliency patterns Implement specific resiliency patterns to improve the availability of the services. Examples: retry policies, caching, and rate limiting. 7 - Security at all levels In a microservices-based system, the attack surface is quite large. You must implement security at every level of the service communication path. 8 - Centralized logging Logs are important to finding issues in a system. With multiple services, they become critical. 9 - Use containerization techniques To deploy microservices in an isolated manner, use containerization techniques. Tools like Docker and Kubernetes can help with this as they are meant to simplify the scaling and deployment of a microservice. Over to you: what other best practice would you recommend? – Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): bit.ly/3KCnWXq #systemdesign #coding #interviewtips .
1
189
3
721
42,206