Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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
maxLevel2

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. The 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.

Validation
TypeDataStoreSupport QueryIndexPreserve Order


longtext

MariaDBSELECTYesNoYes
PostgreSQLNoNoYes
H2NoNoYes
jsonPostgreSQLINSERT / UPDATEYesNoYes
jsonbPostgreSQLINSERT / UPDATEYesYesNo

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

...