lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


* Roberto Ierusalimschy <roberto@inf.puc-rio.br> [15/04/14 18:59]:
> I am not sure I understood your problem. You say "the data model we
> adopted." So, either you can change that data model to better match
> Lua values, or else you explicitly want that specific data model for
> whatever reason, and then you could simply outlaw Lua values that
> do not fit your model (e.g., raise an error if a function returns more
> than one value or if a table mixes numeric and non-numeric keys).

The data model has to be both easy to use and space-efficient.

We settled on a list of values to promote usage which is close to
one in relational databases but not as strict - list values can 
be objects, and there may be many values in a list (compare to
more rigid relational table row, which can only contain a fixed
number of scalars).

We decided to not use a document/object model since then people
tend to store fat & repetitive data in the database, i.e. not
only values, but keys, which are mostly identical.

So it's a compromise, and yes, I agree, we could outlaw 
cases which don't fit well, which we did at first. But people
prefer to have it work in some way, rather than give an error,
especially first-time users, and so we are trying to create 
a conversion scheme. 

-- 
http://tarantool.org - a NoSQL database in a Lua script