polygene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kent SĂžlvsten <kent.soelvs...@gmail.com>
Subject Inconsistency between indexers and stores?
Date Sun, 13 Dec 2015 10:11:51 GMT
Hi

We seem to have som inconsistencies between indexers and entitystores.

When we get() an entity, it is fetched from the EntityStore that is
"closest" to the corresponding EntityModel.
When we save an entity, it is persisted in the EntityStore that is
"closest" to the corresponding EntityModel.

but ...

The EntityStore propagates state to all indexers that are visible *from
the store*
When we query, we use the EntityFinder (indexer) that are "closest" to
*the caller* to ifnd EntityReferences - which are then converted to
entities.

I believe this inconsistency should be fixed to a more consistent tale.
Even today it leads to some confusion in multi-module projects - and it
will get even worse, when we
(which is the goal for 3.0) add more persistent types.

What I suggest (details should possibly be fleshed out):

When we get() an entity, it is fetched from the EntityStore that is
"closest" to the corresponding EntityModel.
When we save an entity, it is persisted in the EntityStore that is
"closest" to the corresponding EntityModel.
When we save an entity, the EntityStore notifies the indexer that is
"closest" to the corresponding EntityModel.
When we query for entities, we find all model implementing that entity
type and perform the query against the indexers that are closest to each
type.
 - that is, if a type is implemented by more entities, these might not
all be in the same indexer.

Thoughts?

I know this will not be backwards compatible in all cases - but still
think we should go for it.

/Kent






Mime
View raw message