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: common/persistence/nosql/nosqlplugin/interfaces.go
+44-23
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,14 @@ type (
38
38
tableCRUD
39
39
}
40
40
// tableCRUD defines the API for interacting with the database tables
41
-
// NOTE: All SELECT interfaces require strong consistency. Using eventual consistency will not work.
41
+
// NOTE 1: All SELECT interfaces require strong consistency (eventual consistency will not work) unless specify in the method.
42
+
//
43
+
// NOTE 2: About schema: only the columns that need to be partition key, range key or index key are considered 'significant',
44
+
// which required to be in the schema. All other non 'significant' columns are opaque for implementation.
45
+
// Therefore, it's recommended to use a data blob to store all the other columns, so that adding new
46
+
// column will not require schema changes. This approach has been proved very successful in MySQL/Postgres implementation of SQL interfaces.
47
+
// Cassandra implementation cannot do it due to backward-compatibility. Any other NoSQL implementation should use datablob for non-significant columns.
48
+
// Follow the comment for each tableCRUD for what are 'significant' columns.
42
49
tableCRUDinterface {
43
50
historyEventsCRUD
44
51
messageQueueCRUD
@@ -58,16 +65,15 @@ type (
58
65
IsThrottlingError(error) bool
59
66
}
60
67
61
-
// historyEventsCRUD is for History events storage system
68
+
/**
69
+
* historyEventsCRUD is for History events storage system
70
+
* Recommendation: use two tables: history_tree for branch records and history_node for node records
71
+
* if a single update query can operate on two tables.
72
+
* Significant columns:
73
+
* history_tree partition key: (shardID, treeID), range key: (branchID)
0 commit comments