> For the complete documentation index, see [llms.txt](https://huy312100.gitbook.io/software-development/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://huy312100.gitbook.io/software-development/cloud-service/aws/certificate/clf-c02/cloud-technology-and-services/database-and-analytics/overview.md).

# Overview

* Storing data on disk (EFS, EBS, EC2 Instance Store, S3) can have its limits
* Sometimes, you want to store data in a database...
* You can structure the data
* You build indexes to efficiently query / search through the data
* You define relationships between your datasets
* Databases are optimized for a purpose and come with different

  features, shapes, and constraints

### Relational Databases

• Looks just like Excel spreadsheets, with links between them!

• Can use the SQL language to perform queries/lookups

<figure><img src="https://1722711354-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwNXdoUkfmcozr29fRrfb%2Fuploads%2FAmbEsYa08TotJyhBYFx9%2FScreenshot%202023-12-13%20at%2022.31.52.png?alt=media&amp;token=78c672b9-50ef-4362-b22d-6e0e28d0a760" alt=""><figcaption></figcaption></figure>

### NoSQL Databases

* NoSQL = non-SQL = non relational databases
* NoSQL databases are purpose built for specific data models and have flexible schemas for building modern applications.
* Benefits:
  * Flexibility: easy to evolve data model
  * Scalability: designed to scale-out by using distributed clusters
  * High-performance: optimized for a specific data model
  * Highly functional: types optimized for the data model
* Examples: Key-value, document, graph, in-memory, search databases
* JSON = JavaScript Object Notation
* JSON is a common form of data that fits into a NoSQL model
* Data can be nested
* Fields can change over time
* Support for new types: arrays, etc...

<figure><img src="https://1722711354-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwNXdoUkfmcozr29fRrfb%2Fuploads%2F9LQ30bllzjm4FtwmZFPG%2FScreenshot%202023-12-13%20at%2022.34.14.png?alt=media&amp;token=ffe8a7c9-a84c-4c25-b850-dad0451118fd" alt=""><figcaption></figcaption></figure>

### Databases & Shared Responsibility on AWS

• AWS offers use to manage different databases

• Benefits include:

* Quick Provisioning, High Availability, Vertical and Horizontal Scaling
* Automated Backup & Restore, Operations, Upgrades
* Operating System Patching is handled by AWS
* Monitoring, alerting

• Note: many databases technologies could be run on EC2, but you must handle yourself the resiliency, backup, patching, high availability, fault tolerance, scaling...
