> For the complete documentation index, see [llms.txt](https://www.pranaypourkar.co.in/the-programmers-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.pranaypourkar.co.in/the-programmers-guide/database/sql-vs-nosql/acid-and-base-properties.md).

# ACID & BASE Properties

## **ACID Properties (SQL Databases)**

ACID ensures **data reliability and consistency** in relational databases by enforcing strict transactional integrity.

* **Atomicity** → Transactions are **all-or-nothing** (e.g., a bank transfer completes fully or not at all).
* **Consistency** → Data **always remains valid** according to predefined rules (e.g., referential integrity).
* **Isolation** → Transactions **run independently** to prevent conflicts (e.g., locking mechanisms).
* **Durability** → Once committed, data is **permanently saved** even after failures (e.g., disk persistence).

**Best For:** Banking, finance, healthcare, stock trading.

## **BASE Properties (NoSQL Databases)**

BASE **prioritizes availability and scalability** over strict consistency, making it ideal for distributed systems.

* **Basically Available** → System **remains operational** despite failures (e.g., partial data availability).
* **Soft State** → Data **may change** over time due to background replication.
* **Eventually Consistent** → Data **syncs across nodes** but not instantly (e.g., DNS updates, social media posts).

**Best For:** Social media, e-commerce, IoT, big data analytics.

## **Comparison**

<table data-full-width="true"><thead><tr><th>Feature</th><th>ACID (SQL)</th><th>BASE (NoSQL)</th></tr></thead><tbody><tr><td><strong>Consistency</strong></td><td>Strong (Immediate)</td><td>Weak (Eventual)</td></tr><tr><td><strong>Availability</strong></td><td>Lower</td><td>Higher</td></tr><tr><td><strong>Scalability</strong></td><td>Limited</td><td>Highly Scalable</td></tr><tr><td><strong>Use Case</strong></td><td>Critical transactions</td><td>High-speed, distributed systems</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://www.pranaypourkar.co.in/the-programmers-guide/database/sql-vs-nosql/acid-and-base-properties.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
