The goal of this document is to investigate about the PostgreSQL capability to handle Json documents.document storage and how could be used to adjust flexibility of Tosca Service Template Handling
Table of Contents maxLevel 2
Introduction
There are different approaches that could be used to Implement a document storage.
PostgreSQL offers two types for storing JSON data: json
and jsonb. T
he json
data type stores an exact copy of the input text, which processing functions must reparse on each execution; while jsonb
data is stored in a decomposed binary format that makes it slightly slower to input due to added conversion overhead, but significantly faster to process, since no reparsing is needed. jsonb
also supports indexing, which can be a significant advantage.
...
Using PostgreSQL special type as "json" or "jsonb" rather than "text", all applications will lose any compatibility with H2 and MariaDB. They will be mentioned in this document but not recommended.
Type | DataStore | ValidationSupport Query | Index | Preserve Order | |
---|---|---|---|---|---|
longtext | MariaDB | SELECT | Yes | No | Yes |
PostgreSQL | No | No | Yes | ||
H2 | No | No | Yes | ||
json | PostgreSQL | INSERT / UPDATE | Yes | No | Yes |
jsonb | PostgreSQLINSERT / UPDATE | Yes | Yes | No |
Requirements
- Policy types/Policies/Node Types/Node Templates are first order items
- Data Types have a scope of a first order item, so a data type definition only applies in the scope of a policy type or node type definition
- We should keep our current APIs, all changes should be internal
- We must provide an upgrade path to the new data structure and a rollback to the current structure
...