[erlang-questions] Knowledge base in Erlang

Sean Hinde <>
Sat Jan 6 18:14:20 CET 2007


On 6 Jan 2007, at 14:57, Joel Reymont wrote:

> Folks,
>
> I'm tasked with rewriting a project from Lisp to Erlang. The project
> has a frames system where "objects" are represented as collections of
> properties. The "schemas" are kept separate from the data and schemas
> can inherit from other schemas.
>
> The complication in my case is that updates are versioned. Each
> update is time-stamped and old data is pushed away. This makes it
> easy to see the state of the system at any given point in time.
>
> I'm thinking of using a table per object property and indexing it on
> {object id, timestamp}. I know that I can use ordered_set but I'm
> wondering about the order. Can I retrieve the data matching the
> highest index value which in my case would be the last value pushed?
> What about the lowest index value?

mnesia:dirty_first/last/1

>
> How many tables can you keep in Mnesia? Would it make more sense to
> have a table per property _and_ object instance, i.e. call the table
> property_object_id and keep the index just on timestamp? This would,
> of course, exponentially increase the number of tables in the system.

probably not a good idea (depending on the size of the system). You  
can have about as many tables as there are available ets tables in  
the system.

Sean






More information about the erlang-questions mailing list