Model which stores data in a non-SQL DB

Hi all experts,

do anybody know how to ideally work with models storing their data partly in a SQLite DB and partly elsewhere?

We are currently using a non-SQL DB (RDDTool) to store regularly arriving measurements. This allows easy navigation through old values and ranges.

And further on there are some data ideally stored in a SQL database, because they change very rarely. From a logical point of view, these data belongs together, one is the value read from a sensor, the other is the configuration of the sensor and correction used to process thar values.

So how to deal with this?

Should I create two model classes, one deriving CActiveRecord handling the SQL data and another handling the non-SQL data? And what is the parent class of this non-SQL model?

Or shall I deal with both data together in one class? This have to be a child of CActiveRecord extended by some attributes dealing with the non-SQL data as well???

Thanks for any hint in advance


Two model classes solutions looks good to me. Parent for noSQL models is CModel.

So, logically the data belongs together, the data in the SQL-DB and the noSQL data are from the same physical element. Therefore I would like to prevent to double all model elements and prefer to put all data handling in one model-class…

In your case there are exactly two models:

  • SensorData — data we’ve got from sensor.

  • SensorConfig — sensor settings.

Don’t know about other cases you have.