2013-12-12 07:21:56 |
Lianhao Lu |
description |
Currently, we see different user experience on different DB backend when creating alarms.
On sqlalchemy, due to the foreign key constraints, an alarm can only be created if the corresponding user_id and project_id are existed in the DB, which means the alarm can NOT be created until a metering sample with the same user_id and project_id has been recorded in the DB.
However, on mongoDB, there is no such restriction. The alarm can be created whenever the user wants.
We should make different DB backends behave the same way.
The question here is: which way we prefer for alarm creation, the sqlalchemy way or mongoDB way? |
Currently, we see different user experience on different DB backend when creating alarms.
On sqlalchemy, due to the foreign key constraints, an alarm can only be created if the corresponding user_id and project_id are existed in the DB, which means the alarm can NOT be created until a metering sample with the same user_id and project_id has been recorded in the DB.
However, on mongoDB, there is no such restriction. The alarm can be created whenever the user wants.
We should make different DB backends behave the same way.
method 1: drop sql foreign key constraints
method 2: in sqlalchemy implementation of alarm creation, create new user_id/project_id, just like what we does now in record_metering_data. |
|