3
3
4
4
# Document Store
5
5
6
- ::::{grid}
6
+ ::::: {grid}
7
7
:padding: 0
8
- :class-row: rubric-slim
9
8
10
- :::{grid-item}
9
+ ::::{grid-item}
10
+ :class: rubric-slimmer
11
11
:columns: 9
12
12
13
+
14
+ :::{rubric} Overview
15
+ :::
13
16
Learn how to efficiently store JSON documents or other structured data, also
14
- nested, using CrateDB's ` OBJECT ` and ` ARRAY ` container data types, and how to
17
+ nested, using CrateDB's OBJECT and ARRAY container data types, and how to
15
18
query this data with ease.
16
19
20
+ CrateDB combines the advantages of typical SQL databases and strict
21
+ schemas with the dynamic properties of NoSQL databases. While traditional
22
+ object-relational databases allow you to store and process JSON data only
23
+ opaquely, CrateDB handles objects as first-level citizens.
24
+
25
+ :::{rubric} About
26
+ :::
27
+ This feature allows users to access object properties in the same manner as
28
+ columns in a table, including {ref}` full-text indexing <fulltext> ` and
29
+ {ref}` aggregation <aggregation> ` capabilities.
30
+
17
31
Even when using dynamic objects, i.e. when working without a strict object
18
32
schema, all attributes are indexed by default, and can be queried efficiently.
19
33
20
34
Storing documents in CrateDB provides the same convenience like the
21
35
document-oriented storage layers of Lotus Notes / Domino, CouchDB,
22
- MongoDB, or PostgreSQL's ` JSON(B) ` types.
36
+ MongoDB, or PostgreSQL's JSON(B) types.
23
37
24
- With CrateDB, compatible to PostgreSQL, you can do all of that using plain SQL.
25
- Other than integrating well with commodity systems using standard database
26
- access interfaces like ODBC or JDBC, it provides a proprietary HTTP interface
27
- on top.
38
+ :::{rubric} Details
28
39
:::
29
40
30
- :::{grid-item}
41
+ CrateDB uses Lucene as a storage layer, so it inherits its concepts
42
+ about storage entities and units, in the same spirit as Elasticsearch.
43
+
44
+ :Document:
45
+ In Lucene, the ** Document** is a fundamental entity, as it is the unit of
46
+ search and index. An index consists of one or more Documents.
47
+
48
+ :Field:
49
+ A Document consists of one or more Fields. A Field is simply a name-value pair.
50
+
51
+ While Elasticsearch uses a [ query DSL based on JSON] , in CrateDB, you can work
52
+ with Lucene Documents using SQL.
53
+ ::::
54
+
55
+
56
+ ::::{grid-item}
57
+ :class: rubric-slim
31
58
:columns: 3
32
59
33
60
``` {rubric} Reference Manual
34
61
```
35
- - [ ] ( inv: crate-reference# data-types-container)
36
- - [ Querying] ( inv:crate-reference#sql_dql_container )
37
- - [ ] ( inv: crate-reference# scalar-objects)
38
- - [ ] ( inv: crate-reference# scalar-arrays)
39
- - [ ] ( inv: crate-reference# sql_dql_array_comparisons)
62
+ - {ref} ` crate-reference: data-types-container `
63
+ - [ Querying containers ] ( inv:crate-reference#sql_dql_container )
64
+ - {ref} ` crate-reference: scalar-objects `
65
+ - {ref} ` crate-reference: scalar-arrays `
66
+ - {ref} ` crate-reference: sql_dql_array_comparisons `
40
67
- [ Non-existing keys] ( inv:crate-reference#conf-session-error_on_unknown_object_key )
41
68
42
69
``` {rubric} Related
43
70
```
44
- - [ ] ( #fulltext )
45
- - [ ] ( #geospatial )
46
- - [ ] ( #machine-learning )
47
- - [ ] ( #analytics )
71
+ - {ref}` sql `
72
+ - {ref}` connect `
73
+ - {ref}` fulltext `
74
+ - {ref}` query `
75
+ - {ref}` geospatial `
76
+ - {ref}` machine-learning `
77
+ - {ref}` analytics `
48
78
49
79
{tags-primary}` JSON `
50
80
{tags-primary}` Container `
@@ -53,25 +83,10 @@ on top.
53
83
{tags-primary}` Array `
54
84
{tags-primary}` Nested `
55
85
{tags-primary}` Indexed `
56
- :::
57
-
58
86
::::
59
87
88
+ :::::
60
89
61
- ## About
62
-
63
- CrateDB uses Lucene as a storage layer, so it inherits its concepts
64
- about storage entities and units, in the same spirit as Elasticsearch.
65
-
66
- :Document:
67
- In Lucene, the ** Document** is a fundamental entity, as it is the unit of
68
- search and index. An index consists of one or more Documents.
69
-
70
- :Field:
71
- A Document consists of one or more Fields. A Field is simply a name-value pair.
72
-
73
- While Elasticsearch uses a [ query DSL based on JSON] , in CrateDB, you can work
74
- with Lucene Documents using SQL.
75
90
76
91
77
92
## Synopsis
@@ -155,7 +170,7 @@ Working with structured data and container data types in CrateDB.
155
170
```
156
171
For columns of type OBJECT, CrateDB supports different policies about the
157
172
behaviour with undefined attributes, namely STRICT, DYNAMIC, and IGNORED,
158
- see [ ] ( inv: crate-reference# type-object-column-policy) .
173
+ see {ref} ` crate-reference: type-object-column-policy ` .
159
174
160
175
:STRICT:
161
176
Reject any sub-column that is not defined upfront.
@@ -175,9 +190,9 @@ see [](inv:crate-reference#type-object-column-policy).
175
190
```
176
191
To support querying DYNAMIC OBJECTs using SQL, where keys may not exist within
177
192
an OBJECT, CrateDB provides the [ error_on_unknown_object_key] session setting.
178
- It controls the behaviour of querying unknown object keys to dynamic objects.
193
+ It controls the behaviour when querying unknown object keys to dynamic objects.
179
194
180
- By default, CrateDB will throw an error if any of the queried object keys are
195
+ By default, CrateDB will raise an error if any of the queried object keys are
181
196
unknown. When adjusting this setting to ` false ` , it will return ` NULL ` as the
182
197
value of the corresponding key.
183
198
@@ -217,13 +232,7 @@ container data types.
217
232
:::{grid-item} ** Blog: Handling Dynamic Objects in CrateDB**
218
233
:columns: 9
219
234
220
- CrateDB combines the advantages of typical SQL databases and strict
221
- schemas with the dynamic properties of NoSQL databases. While traditional
222
- object-relational databases allow you to store and process JSON data only
223
- opaquely, CrateDB handles objects as first-level citizens.
224
-
225
- This allows users to access object properties in the same manner as columns
226
- in a table, including full-text indexing and aggregation capabilities.
235
+ Learn fundamentals about CrateDB's OBJECT data type.
227
236
:::
228
237
229
238
:::{grid-item}
@@ -232,6 +241,7 @@ in a table, including full-text indexing and aggregation capabilities.
232
241
[ Handling Dynamic Objects in CrateDB]
233
242
234
243
{tags-primary}` Fundamentals ` \
244
+ {tags-secondary}` OBJECT `
235
245
{tags-secondary}` SQL `
236
246
:::
237
247
@@ -252,8 +262,9 @@ as video [Getting Started with CrateDB Objects].
252
262
253
263
[ Objects in CrateDB]
254
264
255
- {tags-primary}` Fundamentals ` \
256
- {tags-secondary}` Docker `
265
+ {tags-primary}` Fundamentals `
266
+ {tags-primary}` Docker ` \
267
+ {tags-secondary}` OBJECT `
257
268
{tags-secondary}` SQL `
258
269
:::
259
270
@@ -265,7 +276,8 @@ as video [Getting Started with CrateDB Objects].
265
276
:::{grid-item} ** Querying Nested Structured Data**
266
277
:columns: 9
267
278
268
- Today's data management tasks need to handle multi-structured data from
279
+ Today's data management tasks need to handle multi-structured and
280
+ {ref}` nested <crate-reference:sql_dql_nested> ` data from
269
281
different data sources. CrateDB's dynamic OBJECT data type allows you to
270
282
store and analyze complex and nested data efficiently.
271
283
@@ -277,10 +289,11 @@ URLs.
277
289
:::{grid-item}
278
290
:columns: 3
279
291
280
- [ ] ( inv: cloud# object)
292
+ {ref} ` cloud: object `
281
293
282
- {tags-primary}` Fundamentals ` \
283
- {tags-secondary}` CrateDB Cloud `
294
+ {tags-primary}` Fundamentals `
295
+ {tags-primary}` CrateDB Cloud ` \
296
+ {tags-secondary}` OBJECT `
284
297
{tags-secondary}` SQL `
285
298
:::
286
299
@@ -317,9 +330,10 @@ data types.
317
330
<iframe width =" 240 " src =" https://www.youtube-nocookie.com/embed/aQi9MXs2irU?si=J0w5yG56Ld4fIXfm " title =" YouTube video player " frameborder =" 0 " allow =" accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share " allowfullscreen ></iframe >
318
331
319
332
** Date:** 10 Aug 2022 \
320
- ** Speakers :** Rafaela Sant'ana
333
+ ** Speaker :** Rafaela Sant'ana
321
334
322
335
{tags-primary}` Fundamentals ` \
336
+ {tags-secondary}` OBJECT `
323
337
{tags-secondary}` SQL `
324
338
:::
325
339
@@ -346,35 +360,70 @@ nested data.
346
360
<iframe width =" 240 " src =" https://www.youtube-nocookie.com/embed/S_RHmdz2IQM?si=J0w5yG56Ld4fIXfm " title =" YouTube video player " frameborder =" 0 " allow =" accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share " allowfullscreen ></iframe >
347
361
348
362
** Date:** 15 May 2023 \
349
- ** Speakers :** Georg Traar
363
+ ** Speaker :** Georg Traar
350
364
351
365
{tags-primary}` Fundamentals ` \
366
+ {tags-secondary}` OBJECT `
352
367
{tags-secondary}` SQL `
353
368
:::
354
369
355
370
::::
356
371
357
372
373
+ ::::{info-card}
374
+
375
+ :::{grid-item} ** Dynamic Schemas and Indexing Objects**
376
+ :columns: 8
377
+
378
+ Learn more about OBJECTs from the perspective of dynamic schema evolution
379
+ and about OBJECT indexing.
380
+
381
+ - [ Dynamic Schemas and Indexing Objects]
382
+
383
+ :::
384
+
385
+ :::{grid-item}
386
+ :columns: 4
387
+
388
+ <iframe width =" 240 " src =" https://www.youtube-nocookie.com/embed/lp51GphV9vo?start=495&si=J0w5yG56Ld4fIXfm " title =" YouTube video player " frameborder =" 0 " allow =" accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share " allowfullscreen ></iframe >
389
+
390
+ ** Date:** 20 Mar 2023 \
391
+ ** Speaker:** Marija Selakovic
392
+
393
+ {tags-primary}` Fundamentals ` \
394
+ {tags-secondary}` OBJECT `
395
+ {tags-secondary}` SCHEMA `
396
+ :::
397
+
398
+ ::::
399
+
400
+
401
+
358
402
:::{seealso} ** Product:**
359
403
[ Multi-model Database] •
360
404
[ JSON Database] •
361
405
[ Dynamic Database Schemas] •
362
- [ Nested Data Structure]
406
+ [ Nested Data Structure] •
407
+ [ Relational Database]
363
408
:::
364
409
365
410
366
- ``` {include} /_include/styles.html
367
- ```
368
-
369
411
370
- [ Dynamic Database Schemas ] : https://cratedb.com/product/features/dynamic-schemas
412
+ [ Dynamic Schemas and Indexing Objects ] : https://youtu.be/lp51GphV9vo?t=495s&feature=shared
371
413
[ error_on_unknown_object_key ] : inv:crate-reference#conf-session-error_on_unknown_object_key
372
414
[ generated columns ] : #generated-columns
373
415
[ Getting Started with CrateDB Objects ] : https://youtu.be/aQi9MXs2irU?feature=shared
374
416
[ Handling Dynamic Objects in CrateDB ] : https://cratedb.com/blog/handling-dynamic-objects-in-cratedb
375
- [ JSON Database ] : https://cratedb.com/solutions/json-database
376
- [ Multi-model Database ] : https://cratedb.com/solutions/multi-model-database
377
- [ Nested Data Structure ] : https://cratedb.com/product/features/nested-data-structure
378
417
[ Objects in CrateDB ] : https://community.cratedb.com/t/objects-in-cratedb/1188
379
418
[ query DSL based on JSON ] : https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html
380
419
[ Unleashing the Power of Nested Data: Ingesting and Querying JSON Documents with SQL ] : https://youtu.be/S_RHmdz2IQM?feature=shared
420
+
421
+ <!-- shared -->
422
+ [ Dynamic Database Schemas ] : https://cratedb.com/product/features/dynamic-schemas
423
+ [ JSON Database ] : https://cratedb.com/solutions/json-database
424
+ [ Multi-model Database ] : https://cratedb.com/solutions/multi-model-database
425
+ [ Nested Data Structure ] : https://cratedb.com/product/features/nested-data-structure
426
+ [ Relational Database ] : https://cratedb.com/solutions/relational-database
427
+
428
+ ``` {include} /_include/styles.html
429
+ ```
0 commit comments