Comment 0 for bug 1425584

Revision history for this message
gordon chung (chungg) wrote :

currently mongodb stores each trait as:

{'trait_name': trait.name, 'trait_type': trait.dtype, 'trait_value': trait.value}

https://github.com/openstack/ceilometer/blob/master/ceilometer/event/storage/pymongo_base.py#L60-L64

this is really inefficient and slightly dangerous as a trait is a key-value pair and could be stored as {trait.name: trait.value} but currently the mongodb stores the data exactly as the same way as data model. this can make updates to model difficult to fix in mongodb and it can dramatically increase the side of each event ie. instead of a trait being k:v, it's now 3 times the size)