> 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
