Showing posts with label Web development. Show all posts
Showing posts with label Web development. Show all posts

Wednesday, October 22, 2025

What caused the AWS outage that broke the internet on Oct 21st 2025

AWS outage 2025: More than 1,000 services were impacted by the outage, including popular platforms like WhatsApp, Snapchat and Reddit, which rely on AWS services, along with financial institutions like the British government’s tax services and entertainment services
In India, the impact of the outage was most pronounced in the aviation sector, with hundreds of flights delayed and several cancelled as airline operators found their systems inoperational and had to switch to manual processes. At least ten banks and NBFCs had “minor disruptions”, which have either been resolved or are being resolved, the Reserve Bank of India said at the time.

Here is a technical explanation for the AWS Outage due to a DNS failure.

AWS's own internal control plane is built on top of DynamoDB. It's a hidden dependency. When AWS's internal services couldn't find the IP for DynamoDB, the entire management layer collapsed.

Stage 1: DNS Fails. The internal DNS servers for dynamodb.us-east-1.amazonaws.com stopped working.

Stage 2: Control Plane Fails. AWS's own services that depend on DynamoDB immediately broke. This included:

IAM (for authentication and session state)


The EC2 instance launch subsystem (which uses DynamoDB for metadata)


Network Load Balancer (NLB) health checks (which, it turns out, write their health state to a DynamoDB table)

Stage 3: Circular Dependency. This is the crazy part. When the NLB health checks failed (because they couldn't write to DynamoDB), it caused more network connectivity issues, which in turn impacted the (already struggling) DynamoDB service itself. It created a vicious feedback loop.

Why it lasted 15+ hours (The UDP problem)

Fixing the DNS issue only took a couple of hours. The reason the recovery took so long was twofold:

The Retry Storm: DNS queries use UDP, which is a stateless, "fire and forget" protocol. When the DNS queries failed, millions of clients (SDKs, Lambda functions, other AWS services) didn't get an immediate "connection refused" (like with TCP). They just timed out after 5+ seconds and then retried. This created a "retry storm" (or thundering herd) of millions of requests that hammered the DNS servers and caches, preventing them from recovering even after the initial fix was in.

The Global Control Plane: Many of AWS's core control plane services (like IAM) are centralized in us-east-1. Even if your app was running in eu-west-1, if it needed to authenticate or launch an instance, that control plane operation was routed through us-east-1 and failed.

Wednesday, May 14, 2025

PostgreSQL list of commands

PostgreSQL, or Postgres, is an object-relational database management system that utilizes the SQL language. PSQL is a powerful interactive terminal for working with the PostgreSQL database. It enables users to execute queries efficiently and manage databases effectively.

Here, we highlight some of the most frequently used PSQL commands, detailing their functionalities to enhance your PostgreSQL experience.
Top PSQL Commands in PostgreSQL

Here are the top 22 PSQL commands that are frequently used when querying a PostgreSQL database:
Serial No.CommandDescription1 psql -d database -U user -W Connects to a database under a specific user
2 psql -h host -d database -U user -W Connect to a database that resides on another host
3 psql -U user -h host "dbname=db sslmode=require" Use SSL mode for the connection
4 \c dbname Switch connection to a new database
5 \l List available databases
6 \dt List available tables
7 \d table_name Describe a table such as a column, type, modifiers of columns, etc.
8 \dn List all schemes of the currently connected database
9 \df List available functions in the current database
10 \dv List available views in the current database
11 \du List all users and their assign roles
12 SELECT version(); Retrieve the current version of PostgreSQL server
13 \g Execute the last command again
14 \s Display command history
15 \s filename Save the command history to a file
16 \i filename Execute psql commands from a file
17 \? Know all available psql commands
18 \h Get help
19 \e Edit command in your own editor
20 \a Switch from aligned to non-aligned column output
21 \H Switch the output to HTML format
22 \q Exit psql shell

Additional Information:
The -d option in psql commands is used to state the database name.
The -U option specifies the database user.
The -h option indicates the host on which the database server resides.
The \h ALTER TABLE can be used to get detailed information on the ALTER TABLE statement.

Friday, May 9, 2025

How to deply Ollama & open web-ui on your laptop

How to deploy Ollama
 Installation:
  • Download Ollama: Get the Ollama package from the GitHub repository. 
  • Install Dependencies: Ensure you have any required dependencies, including libraries for your specific model. 
  • Verify Installation: Use ollama --version to confirm Ollama is installed correctly. 
2. Model Deployment and Usage:
  • Pull the Model: Use the ollama pull <model_name> command to download the desired model. 
  • Run the Model: Use ollama run <model_name> to initiate the model's execution. 
  • Interacting with the Model: Ollama provides an API at http://localhost:11434/api/generate for interacting with the model. 
  • Optional: Web UI: Explore Open WebUI for a user-friendly interface to manage and interact with models. 
  • Optional: Custom Applications: Build custom applications using libraries like FastAPI and Gradio to integrate Ollama models into your workflows. 

How to deploy open-webui

Open WebUI is an extensible, feature-rich, and user-friendly self-hosted AI platform designed to operate entirely offline. It supports various LLM runners like Ollama and OpenAI-compatible APIs, with built-in inference engine for RAG, making it a powerful AI deployment solution.

How to Install 🚀

Installation via Python pip 🐍

Open WebUI can be installed using pip, the Python package installer. Before proceeding, ensure you're using Python 3.11 to avoid compatibility issues.

  1. Install Open WebUI: Open your terminal and run the following command to install Open WebUI:

    pip install open-webui
  2. Running Open WebUI: After installation, you can start Open WebUI by executing:

    open-webui serve

This will start the Open WebUI server, which you can access at http://localhost:8080



To upgrade the Open-webui components

pip install open-webui --upgrade

Sunday, March 26, 2023

Go error: go : go.mod file not found in current directory or any parent directory; (working on GOPATH/src)

As of Go 1.16, the GO111MODULE environment variable is treated as "on" by default, meaning Go expects to find a go.mod file, and no longer falls back to pre-module GOPATH behavior.

If you want to go back to the pre-1.16 behavior, you now have to explicitly specify GO111MODULE=auto, but you're far better off creating a go.mod file.

See https://golang.org/doc/go1.16#go-command and https://golang.org/ref/mod


Source - https://stackoverflow.com/questions/67929883/go-error-go-go-mod-file-not-found-in-current-directory-or-any-parent-director 

Sunday, March 5, 2023

𝐒𝐲𝐬𝐭𝐞𝐦 𝐃𝐞𝐬𝐢𝐠𝐧 𝐆𝐨𝐥𝐝𝐦𝐢𝐧𝐞 ❤️️

 System Design rounds are an important part of the Software Engineering interview process because they test a candidate's ability to design and implement large-scale systems.


Here is the list of some amazing resource on System Design -


✅ Things you must know in System Design


👉System design basics: https://bit.ly/3SuUR0Y


👉Horizontal and vertical scaling: https://bit.ly/3slq5xh


👉 Load balancing and Message queues: https://bit.ly/3sp0FP4


👉High-level design and low-level design, Consistent Hashing, Monolithic and Microservices architecture: https://bit.ly/3DnEfEm

👉 Caching, Indexing, Proxies: https://bit.ly/3SvyVDc


👉 Networking, How Browsers work, Content Network Delivery ( CDN): https://bit.ly/3TOHQRb


👉 Database Sharding, CAP Theorem, Database schema Design: https://bit.ly/3CZtfLN


👉 Concurrency, API, Components + OOP + Abstraction : https://bit.ly/3sqQrhj


👉 Estimation and Planning, Performance: https://bit.ly/3z9dSPN


👉 Map Reduce, Patterns, and Microservices: https://bit.ly/3zcsfmv


👉 SQL vs NoSQL and Cloud: https://bit.ly/3z8Aa49


👉 Most Popular System Design Questions: https://bit.ly/3Dp40Ux


✅ System Design Case Studies 


👉 Design Netflix: https://bit.ly/3GrAUG1


👉 Design Reddit: https://bit.ly/3OgGJrL


👉 Design Messenger App : https://bit.ly/3DoAAXi


👉 Design Instagram: https://bit.ly/3BFeHlh


👉 Design Dropbox: https://bit.ly/3SnhncU


👉 Design Youtube: https://bit.ly/3dFyvvy


👉 Design Tinder: https://bit.ly/3Mcyj3X


👉 Design Yelp: https://bit.ly/3E7IgO5


👉 Design Whatsapp: https://bit.ly/3M2GOhP


👉 Design URL shortener : https://bit.ly/3xP078x


👉 Design Amazon Prime Video: https://bit.ly/3hVpWP4


👉 Design Twitter: https://bit.ly/3qIG9Ih


👉 Design Uber: https://bit.ly/3fyvnlT


👉 Design TikTok : https://bit.ly/3UUlKxP


👉 Design Facebook's Newsfeed: https://bit.ly/3RldaW7


👉 Design Web Crawler: https://bit.ly/3DPZTBB


👉 Design API Rate Limiter: https://bit.ly/3BIVuh7


✅ All solved case studies: https://bit.ly/3dCG1rc


👉 System Design Important terms - https://bit.ly/3Om9d3H


👉 Most Popular System Design Questions: https://bit.ly/3E9oH7K


👉 Complete System Design Basics Series: https://bit.ly/3rG1cfr


Save this post for later.


Follow Aman Barnwal for more. ❤️️


Join my Telegram group for 𝐈𝐧𝐭𝐞𝐫𝐯𝐢𝐞𝐰 𝐏𝐫𝐞𝐩𝐚𝐫𝐚𝐭𝐢𝐨𝐧 𝐑𝐞𝐬𝐨𝐮𝐫𝐜𝐞𝐬 👉https://lnkd.in/gDBqRNBw 

 

Tuesday, February 28, 2023

API architectural styles



The following image displays the most common architectural styles for APIs.

🔹 1. REST REST, which was proposed in 2000, is the most widely used style for APIs. It is often utilized between front-end clients and back-end services, and it adheres to six architectural constraints. The payload format may be JSON, XML, HTML, or plain text.

🔹 2. GraphQL Meta proposed GraphQL in 2015. It provides a schema and type system that is ideal for complicated systems where entities' relationships are graph-like. In the diagram below, GraphQL can retrieve user and order information in one call, while REST necessitates multiple calls.

GraphQL does not replace REST but can be built upon existing REST services.

🔹 3. Web socket Web socket is a protocol that enables full-duplex communications over TCP. Clients create web sockets to receive real-time updates from back-end services. Unlike REST, which always "pulls" data, web socket allows data to be "pushed".

🔹 4. Webhook Webhooks are frequently used for third-party asynchronous API calls. In the diagram below, Stripe or Paypal is used for payment channels, and a webhook for payment results is registered. When a third-party payment service is completed, it notifies the payment service if the payment was successful or failed. Webhook calls are usually part of the system's state machine.

🔹 5. gRPC gRPC, which was released in 2016, is used for communications among microservices. The gRPC library handles encoding/decoding and data transmission.

🔹 6. SOAP SOAP stands for Simple Object Access Protocol, and its payload is only XML, making it suitable for internal system communications.



Thursday, February 16, 2023

From UX perspective is it good to show all prerequisite checks in a single screen or split them into multiple screens?

From a UX perspective, it's generally best to split prerequisite checks into multiple screens if they are numerous or complex, especially if they require user input or interaction.

When multiple prerequisite checks are displayed on a single screen, it can be overwhelming for the user, and it may be difficult to understand which checks have been completed and which ones are outstanding. This can lead to confusion, frustration, and errors.

Splitting the prerequisite checks into multiple screens can make the process more manageable for the user. Each screen can focus on a specific task or set of tasks, with clear instructions and feedback on completion. This can help the user feel more in control of the process and less overwhelmed by the overall number of prerequisite checks.

However, if the prerequisite checks are simple and can be completed quickly, it may be appropriate to display them all on a single screen, provided they are clearly organized and easy to understand. In this case, a single screen can be more efficient and faster for the user, and it can also provide a sense of progress as they complete each check.

In summary, the decision to split or combine prerequisite checks into screens depends on the number and complexity of the checks, the amount of user input required, and the overall user experience goals of the application or website.

Wednesday, February 16, 2022

Type or Category or Classification of Design Patterns

 Type or Category or Classification of Design Patterns

Creational  Based on the concept of creating an object.
    Class
      Factory MethodThis makes an instance of several derived classes based on interfaced data or events.
    Object
      Abstract FactoryCreates an instance of several families of classes without detailing concrete classes.
      BuilderSeparates object construction from its representation, always creates the same type of object.
      PrototypeA fully initialized instance used for copying or cloning.
      SingletonA class with only a single instance with global access points.
        
  Structural  Based on the idea of building blocks of objects.
    Class
      AdapterMatch interfaces of different classes therefore classes can work together despite incompatible interfaces.
    Object
      AdapterMatch interfaces of different classes therefore classes can work together despite incompatible interfaces.
      BridgeSeparates an object's interface from its implementation so the two can vary independently.
      CompositeA structure of simple and composite objects which makes the total object more than just the sum of its parts.
      DecoratorDynamically add alternate processing to objects.
      FacadeA single class that hides the complexity of an entire subsystem.
      FlyweightA fine-grained instance used for efficient sharing of information that is contained elsewhere.
      ProxyA place holder object representing the true object.
 
  Behavioral  Based on the way objects play and work together.
    Class
      InterpreterA way to include language elements in an application to match the grammar of the intended language.
      Template
       Method
Creates the shell of an algorithm in a method, then defer the exact steps to a subclass.
    Object
      Chain of
      Responsibility
A way of passing a request between a chain of objects to find the object that can handle the request.
      CommandEncapsulate a command request as an object to enable, logging and/or queuing of requests, and provides error-handling for unhandled requests.
      IteratorSequentially access the elements of a collection without knowing the inner workings of the collection.
      MediatorDefines simplified communication between classes to prevent a group of classes from referring explicitly to each other.
      MementoCapture an object's internal state to be able to restore it later.
      ObserverA way of notifying change to a number of classes to ensure consistency between the classes.
      StateAlter an object's behavior when its state changes.
      StrategyEncapsulates an algorithm inside a class separating the selection from the implementation.
      VisitorAdds a new operation to a class without changing the class.

 

Featured

TechBytes on Linux

This is a growing list of Linux commands which might come handy for the of Linux users. 1. Found out i had to set the date like this: ...

Popular Posts