Design and Performance¶
Database Design¶
-
class
tycho.db.event.
Event
(collection)¶ Tycho stores events in a MongoDB database, with indices against tags, time created, and update time.
The cardinality of the keys is not a concern, as regardless of the key value, the index will include the raw value. To ensure that the keys and values themselves are not too large (which would impact record size), there is a 100 character limit.
Queries that span both a key:value with a larger number of records, and a long time frame, will result in a scanning query, as MongoDB cannot build a compound index that includes both the tags and the update time. As such it is best to restrict time ranges to as short of a range as possible, and filter to a specific tag.