deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michal Fojtik <>
Subject Re: POC: DataMapper support for CIMI attributes
Date Wed, 28 Nov 2012 12:18:27 GMT
On 11/20, David Lutterkort wrote:

> The reason I want to store stuff at the entity level is that it greatly
> reduces the amount of rows in the DB, number of queries etc. Since we do
> not need to do anything fancy with the data in the DB for now, there's
> no need for the more granular data model of one row per property.

I see. I sent another patch and recorded set 156. I replaced EntityProperty
with 'Entity' and moved provider/driver specific data to 'Provider'.
I removed 'user' from provider after discussion with Dies, since there is
no need to store any credentials (entity id's are usually not recycled and
even if they will, the code in new patch will handle that by updating
existing record.

> > Yes, this is an excellent point. I would love to make this work in way
> > where we first try to use real provider and as a fallback we store attrs
> > in database. But I'm afraid from using 'drivers' for this. I think we should
> > keep this DB stuff out of Deltacloud drivers, we just need to figure out how to
> > do it :)
> We can do all this at the level of the CIMI frontend (collections):
> _always_ store CIMI relevant data in the DB. When retrieving an entity,
> prepopulate it with data from the DB, then overwrite with what we get
> back from the driver - the overwriting would either happen with model
> objects, or with the hashes we pass into the model object controllers.
> That way, we always have CIMI relevant data, and use the 'real' backend
> data when it is available.

I tried to do this for instance name. Problem is that we always set the
name of the instance even if the 'user_name' feature is not available for

The current patch also simplify the way how we store data to database in
CIMI models. I created helper in base_model class so now storing data is
just one-liner. Also the current patch support properties, so any user
specified properties are stored in DB and then properly returned to client.

I found one problem with the JSON gem under MRI 1.9.3p286 [DTACLOUD-382],
but this one seems not related to the DataMapper patches.

Let me know what do you think about the current patch and once we will
generally happy with that code, I will implement this for all CIMI models.

  -- Michal

Michal Fojtik <>
Deltacloud API, CloudForms

View raw message