# The DevOps & System Design Cheat Sheet: DNS, SQL vs NoSQL, and Queues

While working on real DevOps projects, I realized one thing:

✅ Deploying an app is not only about commands…  
✅ It’s about understanding **what happens behind the scenes**

So today I revised and wrote short notes on these important concepts:

* HTTP status codes (1xx to 5xx)
    
* DNS record types
    
* 3-tier architecture (Frontend → Backend → Database)
    
* SQL vs NoSQL
    
* Polyglot persistence (multiple databases in one system)
    
* Queues (why they are used in system design)
    

This post is written in a simple beginner-friendly way, but with real-world understanding.

*👋 If you found this article helpful and want to follow my* ***DevOps + System Design learning journey****,  
connect with me on LinkedIn 👉* [***Ramu Chelloju***](https://www.linkedin.com/in/ramuchelloju/)

# 3-Tier Architecture (Frontend → Backend → Database)

Most real applications follow **3-tier architecture**:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1769009138674/1d822b8d-7153-4be8-9edf-53324571294c.png align="center")

### 1) Frontend (UI Layer)

* Runs in browser
    
* React / Angular / HTML CSS JS
    
* Communicates via APIs
    

### 2) Backend (Application Layer)

* Implements business logic
    
* REST APIs
    
* Authentication, validation, processing
    

### 3) Database (Data Layer)

Stores data.

Common DB options:

* **MySQL/PostgreSQL** (SQL)
    
* **MongoDB/DynamoDB** (NoSQL)
    
* **Redis** (Caching / sessions)
    
* **RabbitMQ/Kafka** (Queue / streaming)
    

This separation makes the system scalable and manageable.

---

# SQL vs NoSQL (Simple Comparison)

There is no “best database”.  
We choose based on requirement.

---

## SQL Databases (Relational)

Examples:

* MySQL
    
* PostgreSQL
    
* Oracle
    
* MS SQL
    

### Features:

✅ Fixed schema (tables, rows, columns)  
✅ Strong consistency (ACID)  
✅ Best for relational data  
✅ Excellent for transactions and banking

### Example use case:

* Orders
    
* Payments
    
* Billing
    
* User accounts
    

---

## NoSQL Databases

Examples:

* MongoDB
    
* DynamoDB
    
* Cassandra
    
* Redis
    

### Features:

✅ Flexible schema (JSON documents / key-value)  
✅ Easy to scale horizontally  
✅ Faster for certain workloads  
✅ Best for unstructured or semi-structured data

### Example use case:

* product catalogs
    
* activity logs
    
* recommendations
    
* caching
    

---

# Polyglot Persistence (Modern System Design Concept)

In modern systems, we don’t use only one database.

Instead we use multiple databases in one application based on needs.

Example architecture:

✅ **MySQL** → core transactional data (users, billing)  
✅ **Redis** → caching + sessions  
✅ **MongoDB/DynamoDB** → product catalog or logs  
✅ **Elasticsearch** → searching and analytics

This approach is called:

### ✅ Polyglot Persistence

Meaning:

> Using multiple data storage technologies within a single application.

---

# Why Queues Matter (Queue = Decoupling)

A **queue** is like a buffer that holds messages until they are processed.

### Without Queue (Tightly Coupled)

Service A calls Service B directly using REST.

Problem:  
If Service B is down → Service A fails → user gets **500 error**

---

### With Queue (Loosely Coupled)

Service A sends message to queue (SQS / RabbitMQ)  
Service B will process later when it is available.

✅ Even if Service B is down, messages remain safe  
✅ Service B can come back later and process  
✅ This improves reliability and scalability

### Examples of queues:

* AWS SQS
    
* RabbitMQ
    
* Kafka (event streaming)
    

This is one of the most important **system design fundamentals**.

## ✅ Quick DevOps Troubleshooting Commands (Backend Check)

When your backend service is not responding, these are super useful:

### Check service status

```plaintext
systemctl status <service-name>
```

### Check which process is running (example Node.js)

```plaintext
ps -ef | grep node
```

### Check which port is listening

```plaintext
netstat -lntp
```

### Check application health endpoint

```plaintext
curl http://localhost:8080/health
```

In real deployments, these 4 commands are enough to debug many issues quickly.

---

# ✅ HTTP Status Codes (Most Important for DevOps + APIs)

When we call an API, we receive an HTTP response code.  
Understanding these codes helps you debug issues faster.

---

## 1xx — Informational

These responses mean: “Request received, continuing…”

Example:

* **100 Continue** → server says “you can continue sending request body”
    

Not used very often in day-to-day DevOps debugging, but good to know.

---

## ✅ 2xx — Success

These mean the request succeeded.

Common 2xx codes:

### **200 OK**

✅ Request succeeded

Example:

* GET request returns data
    
* Health API returns status
    

### **201 Created**

✅ Resource created successfully

Example:

* POST request created a new expense record
    

### **204 No Content**

✅ Request succeeded, but server returns no content

Example:

* DELETE success but no response body returned
    

---

## ✅ 3xx — Redirection

These mean the resource is available, but at a different location.

### **301 Moved Permanently**

✅ Permanent redirection  
Example: HTTP → HTTPS

### **302 Found (Temporary Redirect)**

✅ Temporary redirection  
Example: short time redirect to another URL

### **304 Not Modified**

✅ Resource not changed (browser uses cache)

This is why sometimes changes don’t reflect immediately due to caching.

---

## ✅ 4xx — Client Side Errors

These happen due to wrong request from client (frontend/Postman/user).

### **400 Bad Request**

Client request is wrong  
Example:

* invalid JSON
    
* missing required field
    

### **401 Unauthorized**

Authentication failed / token missing  
Example:

* no login token provided
    

### **403 Forbidden**

User is authenticated but has no permission  
Example:

* you are logged in but not allowed to access
    

### **404 Not Found**

Resource/API endpoint not found  
Example:

* wrong API path `/api/transacton` instead of `/api/transaction`
    

---

## ✅ 5xx — Server Side Errors

These happen due to issues in server/backend/database.

### **500 Internal Server Error**

Backend crashed or unhandled error occurred.

Common reasons:

* Node.js exception
    
* DB connection failure
    
* wrong environment variables
    

### **503 Service Unavailable**

Service is down / overloaded.

Example:

* backend is stopped
    
* load balancer returns 503
    

---

# ✅ DNS Record Types (Most Common and Practical)

DNS controls how domain names map to services.

### **NS Record — Name Server**

NS tells who manages your domain DNS.

Example:

* Route53 gives NS records
    
* You update them at domain registrar
    

### **SOA — Start of Authority**

Contains domain zone info like:

* primary nameserver
    
* admin email
    
* serial number
    

Mostly maintained automatically.

### **A Record — IPv4 address mapping**

Maps domain → IPv4 address

Example:

```plaintext
learndev.in → 3.110.xx.xx
```

### **AAAA Record — IPv6 mapping**

Same as A record but for IPv6.

### **MX Record — Mail exchange**

Used for email routing.

Example:

* Gmail setup
    
* Zoho mail setup
    

### **TXT Record**

Used for verification and security.

Examples:

* domain ownership verification
    
* SPF / DKIM records for email security
    

### **CNAME Record — Alias**

Maps one name to another name.

Example:

```plaintext
blog.learndev.in → hashnode-host-domain
```

# What I’m Going to Do Next (My Learning Plan)

From today onwards, I’m going to start **System Design concepts from the beginning** and write blogs in a simple easy-to-understand way.

Upcoming topics:

* Load balancer
    
* Caching
    
* Database indexing
    
* Rate limiting
    
* CDN
    
* Queue vs Stream
    
* Microservices basics
    
* Scalability concepts
    

---

## 🙌 Subscribe / Follow for More

If you are also learning DevOps + System Design and want beginner-friendly explanations with real examples, please subscribe and follow my blog 🚀

✅ I’ll be posting regularly as I learn and build.
