Home Help Center

Evictor performance question

xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
I using freeze evictor for persitence of a tree like structure, but same nodes not all can have millon of childs or more.

now i have samething like this
clas BaseItem
{
          string title;
}

dictionary<Ice::Identity,BaseItem*> ItemMap;

class Item extends BaseItem
{
       string content;
}

interface NodeAdmin
{
   BaseItem* add(BaseItem* obj);
   BasetIem* get(Ice::Identity id);
}

class Node extends BaseItem implementes NodeAdmin
{
     ItemMap childs;
}

can evictor and this design have a good performance or is better store childs as a separte FreezeMap for each Node.

And the second option implique have millon of database files because same node can have a millon of child nodes each one with is dedicated FreezeMap and db, i'm not sure if this is a good idea.

i special interesting in performance of get method. is the most invoked all the time system is up.
any help is apreciate thanks

Comments

  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi Jose,

    Ideally the objects (servants) stored in a Freeze Evictor should be of average size. Lots of very small objects waste disk space since the Freeze Evictor adds overhead to each record. With a very large object, like an object holding an Ice dictionary with a million entries, the problem is that each little change in that object will result in the entire object being written to disk.

    So, I'd recommend to use a Freeze dictionary to hold your items, since they can be so numerous. And I don't see why all your nodes can't share the same Freeze dictionary.

    Also this interface:
    interface NodeAdmin
    {
       BaseItem* add(BaseItem* obj);
       BasetIem* get(Ice::Identity id);
    };
    

    does not make much sense, since BaseItem has no operation. Maybe you meant to return BaseItem by value.

    Cheers,
    Bernard
Sign In or Register to comment.