What Is a NoSQL Database and When Should You Use One
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
- Game backends: Player profiles, inventory, scores, and session state all have different structures and change constantly. A key-value store lets you save any data for any player without designing tables first.
- Mobile and web apps: User preferences, settings, and activity logs are natural fits for key-value storage. Each user can have different fields without breaking anything.
- IoT and sensor data: Devices send readings with varying fields at high volume. NoSQL handles the write speed and schema flexibility that IoT requires.
- Session and cache storage: Temporary data that needs fast access and automatic expiration works perfectly with key-value databases that support TTL (time to live).
- Custom app data: When you build a custom app on the platform, the NoSQL database is the simplest way to store and retrieve your app's data without setting up an external database.
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.
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