Skip to content
Data models

JSON Data

Real-time JSON database with SQL simplicity.

CrateDB is a high performance JSON database built for real time analytics on semi structured and rapidly evolving data. It stores and indexes JSON documents at scale while giving teams the power of full SQL for querying, filtering, and aggregating nested fields with millisecond level response times.

With a distributed architecture, automatic indexing, and flexible schema handling, CrateDB lets you ingest complex JSON payloads at high speed and run analytics on structured and unstructured data in one unified system.

 

Instant JSON data querying with SQL

Hyper-fast. Queries in milliseconds.

        

INSERT INTO community_areas(areanumber, name, details) VALUES (
   35,
   'DOUGLAS',
   '{
      "description": "The Douglas community area stretches...",
      "population": 20291,
      "zipcodes": [ "60609", "60616", "60653" ],
      "notableresident": {
         "name": "Ida B. Wells",
         "bio": "An American investigative journalist, educator and..."
      }
   }'::OBJECT
)
        
        
        
        
 
/* Retrieve fields from objects and slice arrays. */
SELECT name, 
       array_slice(details['zipcodes'], 1, 1) as first_zip, 
       details['population'] AS population, 
       details['notableresident']['name'] AS famous_resident 
FROM community_areas 
WHERE areanumber = 35;

        

+---------+-----------+------------+-----------------+
| name    | first_zip | population | famous_resident |
+---------+-----------+------------+-----------------+
| DOUGLAS | ["60609"] |      20291 | Ida B. Wells    |
+---------+-----------+------------+-----------------+

 

        
 
/* Insert documents for two Chicago community areas.  Dynamic 
   object schemas allow these two documents to have different
   structures. */
INSERT INTO community_areas(areanumber, name, details) VALUES 
  (
    35,
    'DOUGLAS',
    '{
      "description": "The Douglas community area stretches...",
      "population": 20291,
      "zipcodes": [ "60609", "60616", "60653" ],
      "notableresident": {
        "name": "Ida B. Wells",
        "bio": "An American investigative journalist, educator and..."
      }
    }'::OBJECT
  ),
  (
    41,
    'HYDE PARK',
    '{
      "description": "This community area is home to the Museum of Science...",
      "population": 29456,
      "notableresident": {
        "name": "Muhammad Ali",
        "born": 1942
      }
    }'::OBJECT    
  );
        
        
        

Built for JSON at Scale

Flexible schema handling

CrateDB supports dynamic JSON objects, nested structures, and arrays, allowing you to store changing payloads without rigid schemas or costly migrations. You can model only the fields you need as typed columns and keep the rest flexible.
cr-quote-image

SQL on nested JSON

Query JSON fields directly using familiar SQL. Access nested keys, filter on dynamic attributes, and run aggregations without custom query languages or pipelines.

Example:
SELECT payload['device']['temperature']
FROM readings
WHERE payload['status'] = 'active';

cr-quote-image

Automatic indexing

CrateDB’s indexing engine, built on Apache Lucene, automatically indexes every JSON attribute, with no manual setup required.
This ensures lightning-fast queries, regardless of nesting depth, and allows you to filter, search, and aggregate on any property instantly.

With parallel ingestion and distributed indexing, CrateDB makes JSON data immediately available for analysis and AI pipelines, eliminating delays caused by batch updates.

cr-quote-image

Real time query readiness

Incoming JSON documents are query ready within milliseconds, enabling dashboards, alerting systems, and automation pipelines to react instantly.

Distributed and resilient

CrateDB distributes JSON documents across nodes for parallel processing and high availability. Performance stays stable as the dataset grows.
cr-quote-image

Advanced JSON Querying

Nested field access

Query multi level keys with bracket notation. Combine relational joins, SQL functions, and JSON expressions in one query.
cr-quote-image

Rich filtering and analytics

Run aggregations, grouping, statistics, and full text search on JSON fields at interactive speeds.

cr-quote-image

Combine JSON with other data types

Mix JSON documents with time series metrics, geospatial coordinates, vectors, and relational tables inside a single SQL query. This removes the need for separate specialized databases.

cr-quote-image

Evolving data models

Support unpredictable or device driven payloads without downtime or schema redesign.

Demo: Ingesting and querying nested JSON documents with SQL

Demo: Ingesting and querying nested JSON documents with SQL

Watch the tutorial by Georg Traar, Director of Product Management Cloud Organisation, as he shows how to unleash the power of nested data with CrateDB.

Curious to learn more?

Additional resources on JSON data

FAQ

A JSON value can be one of several types: an object, array, number, string, Boolean (true or false), or null. Objects within JSON are collections of key-value pairs, and these keys can contain values of any type, including nested objects or arrays. In CrateDB, JSON objects are treated as container data types, allowing for flexible and efficient data storage.

Storing document/JSON data efficiently requires a flexible database that can handle various attributes and nesting levels. Databases typically define objects as strict, dynamic, or ignored, depending on whether you want to enforce schemas strictly or allow for dynamic schema updates. This flexibility is crucial for managing complex data structures that involve arrays of objects and different nesting levels. In CrateDB, JSON objects can be stored in OBJECT columns, providing the versatility needed for multi-model data storage while maintaining efficient handling and query performance.

When choosing a database for document/JSON data, consider its ability to efficiently store and query JSON documents, indexing capabilities, and support for dynamic schemas. Databases like CrateDB, MongoDB, Couchbase, and ArangoDB excel in these areas, providing flexibility and efficient querying. CrateDB combines traditional SQL strengths with NoSQL's dynamic properties, treating JSON objects as first-class citizens and allowing for full indexing and aggregation of object properties, regardless of their depth and nested structure. Learn more >

Document/JSON data is highly versatile and used across various industries for web applications, APIs, configuration files, data storage, and logging. This format supports flexible, schema-less structures, making it ideal for rapidly changing datasets and complex data models. In CrateDB, JSON data is efficiently stored, indexed, and queried, providing seamless integration with PostgreSQL clients and robust search capabilities.