You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/specs/online_store_format.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,6 +59,34 @@ Here's an example of how the entire thing looks like:
59
59
60
60
However, we'll address this issue in future versions of the protocol.
61
61
62
+
## Cloud Firestore Online Store Format
63
+
64
+
[Firebase data model](https://firebase.google.com/docs/firestore/data-model) is a hierarchy of documents that can contain (sub)-collections. This structure can be multiple levels deep; documents and subcollections are alternating in this hierarchy.
65
+
66
+
We use the following structure to store feature data in the Firestore:
67
+
* at the first level, there is a collection for each Feast project
68
+
* second level, in each project-collection, there is a Firebase document for each Feature Table
69
+
* third level, in the document for the Feature Table, there is a subcollection called `values` that contain a document per feature row. That document contains the following fields:
70
+
*`key` contains entity key as serialized `feast.types.EntityKey` proto
71
+
*`value` contains value as serialized `feast.types.Value` proto
72
+
*`event_ts` contains event timestamp (in the native firestore timestamp format)
73
+
*`created_ts` contains write timestamp (in the native firestore timestamp format)
74
+
75
+
Document id for the feature document is computed by hashing entity key using murmurhash3_128 algorithm as follows:
76
+
77
+
1. hash utf8-encoded entity names, sorted in alphanumeric order
78
+
2. hash the entity values in the same order as corresponding entity names, by serializing them to bytes as follows:
79
+
- binary values are hashed as-is
80
+
- string values hashed after serializing them as utf8 string
81
+
- int64 and int32 hashed as little-endian byte representation (8 and 4 bytes respectively)
82
+
- bool hashed as 0 or 1 byte
83
+
84
+
Other types of entity keys are not supported in this version of the specification, when using Cloud Firestore.
0 commit comments