[REBOL] Re: Database Compactness?
From: ingo:2b1 at: 21-May-2002 23:49
Hi Mark,
[Robbo1Mark--aol--com] wrote:
> This is one for the guru's or Rt staff,
>
> Which of the following provides a more compact and secure representation for a database?
>
> an object!
>
> db1: context [ group1: [#1 "A Value"] ]
>
> or a block!
>
> db2: reduce [ 'group1 [#1 "A Value"] ]
I don't know about the security aspect, but think they'd be equal.
Comparing creation time / space efficency, blocks clearly win
I'd _guess_ that objects are faster for lookups, but I don't know.
(And using hashes instead of blocks is the worst for creation time /
space, but I don't know how it works for lookups.)
> They both allow path retrieval ie.
>
>>>db1/group1/#1
>>
> == "A Value"
<..>
> As well as insertions / removals
>
>>>append db1/group1 [#2 "A Thing"]
>>
> == [#1 "A Value" #2 "A Thing"]
<..>
But there would be a problem when it comes to adding a new group to the
object! case, I don't know if this might pose a problem in this specific
case, though.
I hope that helps,
Ingo