# Database

A database is an organized collection of data stored and accessed electronically. Databases are managed by database management systems (DBMS) that provide mechanisms for defining, creating, querying, updating, and administering data. The two primary categories are relational databases (such as PostgreSQL, MySQL, and SQL Server) and non-relational databases (such as MongoDB, DynamoDB, and Redis).

Relational databases organize data into tables with defined schemas and use SQL for queries. Non-relational (NoSQL) databases offer more flexible data models including document, key-value, column-family, and graph structures. The choice depends on the application's data access patterns, consistency requirements, and scalability needs.

APIs commonly serve as the interface layer between clients and databases. Rather than exposing database queries directly, APIs provide controlled access through defined endpoints. An API gateway adds security and governance by authenticating requests and enforcing rate limits before they reach the database-backed service, protecting against unauthorized access and query overload.


---

# Agent Instructions: 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:

```
GET https://docs.serverlessapigateway.com/glossary/d/database.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
