GBKF Patterns
Introduction
To understand the two main patters that you can use for structuring your data with the GBKF format, it is first necessary to understand its core design. The GBKF format will store the data, with keyed values, instance or group ids, and arrays of typed values.
In the binary file we can imagine the following representation:
KEY-A | Instance 0 | Value A.1.1, Value A.1.2, Value A.1.3, Value A.1.n, ... KEY-A | Instance 1 | Value A.2.1, Value A.2.2, Value A.1.n, ... KEY-B | Instance 0 | Value B.1.1, Value B.1.2, Value B.1.3, Value B.1.n, ... etc...
And in the code it will approximatively1 translate as the following:
{"KEY-A":[ (0, [Value A.1.1, Value A.1.2, Value A.1.3, Value A.1.n, ...]), (1, [Value A.2.1, Value A.2.2, Value A.1.n, ...]), ], {"KEY-B":[ (0, [Value B.1.1, Value B.1.2, Value B.1.3, Value B.1.n, ...]), ], }
This design, makes much simpler to structure the data and associate it to instances.
1 In the code, it's implemented with objects or structures. Check the code implementation of your language to know how to exactly access.
Multi-Instance pattern - DataBase Like
This pattern is like transposing the DataBase columns, one by one into the file.
CID | DAY | MONTH | YEAR ------------------------- 0 | 5 | 10 | 1992 1 | 10 | 3 | 1994 2 | 8 | 2 | 2025 3 | 30 | 12 | 2025
When using this pattern, the GBKF instance id will not really be used, and all the instance will share the same row. The previous example would be written as the following:
CID__ | 0 | 0, 1, 2, 3 DAY__ | 0 | 5, 10, 8, 30 MONTH | 0 | 10, 3, 2, 12 YEAR_ | 0 | 1992, 1994, 2025, 2025
Important: Note on nullable fields.
Single-Instance pattern
...