Home » AI Databases » What Is NoSQL

What Is a NoSQL Database and When Should You Use One

A NoSQL database stores data without the rigid table structure of traditional SQL databases. Instead of rows and columns, NoSQL databases use flexible formats like key-value pairs, documents, or graphs. You should use NoSQL when your data does not fit neatly into tables, when you need very fast reads and writes at scale, or when your data structure changes frequently, such as game state, user profiles, IoT sensor readings, or session storage.

How NoSQL Differs From SQL Databases

SQL databases like MySQL and PostgreSQL organize data into tables with fixed columns. Every row in a table has the same structure, and you write SQL queries to find, filter, and join data across tables. This works well for structured business data like orders, invoices, and customer records where the fields are predictable.

NoSQL databases skip the table structure entirely. In a key-value store (the most common type for application backends), each record is identified by a key, and the value can be any data you want: a JSON object, a string, a number, or a complex nested structure. Different records can have completely different fields. You do not need to define a schema upfront, and you never write SQL.

This flexibility makes NoSQL ideal for applications where the data shape varies between records, where you need to add new fields without altering a schema, or where you need sub-millisecond response times on simple lookups.

When NoSQL Is the Right Choice

When SQL Is Still Better

SQL databases are the better choice when you need complex queries that join multiple tables, when your data has strong relationships (like orders that reference customers that reference addresses), or when you need transactions that guarantee data consistency across multiple operations. If you regularly need to ask questions like "show me all customers who ordered product X in the last 30 days and also have an active support ticket," a relational database handles that naturally while NoSQL would require multiple separate lookups.

For a detailed comparison, see SQL Databases vs NoSQL: When to Use Each.

The Platform's Built-In NoSQL Database

The AI Apps API platform includes a built-in NoSQL key-value store powered by DynamoDB. You do not need to set up servers, manage connections, or pay for hosting. The database is ready to use the moment you install the NoSQL app.

Data is organized with two keys: a partition key that groups related records (like a player ID or company ID) and a sort key that identifies individual records within that group (like a game session ID or timestamp). This two-key design handles most application patterns naturally.

Every read and write operation costs 1-2 credits, which makes it one of the most affordable database options available. There are no monthly fees, no storage charges, and no minimum commitments. You pay only for the operations you use.

Cost comparison: At 1-2 credits per operation (roughly $0.001-0.002), a game that makes 10,000 database calls per day would cost about $10-20 per month. A typical managed DynamoDB instance with similar usage would cost $25-50 per month, plus you would need to manage it yourself.

Getting Started With NoSQL

If NoSQL sounds like the right fit for your project, the key-value database setup guide walks you through creating your first records. For game-specific use cases, see How to Build a Game Backend With NoSQL or How to Store Player Profiles and Leaderboards.

Start using a NoSQL database for your app or game with zero setup. Just install the app and start storing data.

Get Started Free