Precise
Precise is just another schema framework enabling to describe data and documents very precisely. It’s programming language agnostic and works via schema validation.
DataLbry is a data-integration specialised firm, which heavily relies on structured data. The main reason for us to drive a custom schema framework forward, is the lack of support for hybrid structures.
Note
|
There are several other schema frameworks out there, such as Apache Avro , Apache Thrift and Protocol Buffers . |
Schemas
Precise heavily relies on Schemas, so every time we are serializing a type to json, we require the schema. Whenever Precise deserializes data, it also requires a Schema.
The Schema holds the information of how the data looks like, which fields it contains and which version it has. To avoid the complexity to always write the Schema manually, Precise provides tools for Schema generation from e.g. Kotlin Data Classes.
Types
Basic Types
Precise supports the following basic data types
-
int:
32-bit signed integer -
long:
64-bit signed integer -
float:
single-precision (32-bit) IEEE 754 floating-point number -
double:
double-precision (64-bit) IEEE 754 floating-point number -
bytes:
sequence of 8-bit unsigned bytes -
string:
unicode character sequence
Complex Types
Precise supports different kind of complex types.
-
document
describes a record which can be identified by a globally unique ID. -
record
describes a record, or a row in SQL. It primarily differs fromdocument
as it may not be globally unique. -
enum
contains a list of predefined string values.
Complex types can be described within a schema.json
Definition
The Definition of complex types can be done right in the schema.json
. A Record definition may contain a list of fields. All fields require a type either described by the a Basic Types or by any definition of Complex Types in the schema. The current only difference between a Record, and a Document is the globally uniqueness of the Document, which can be identified by its ID.
link:docs/schema/complex-type-definition.json[]
License
Copyright 2021 DataLbry.io Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.