lua-users home
lua-l archive

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


Have you thought about LuaSQLite ? With some simple wrappers in Lua (metatables), you can use table syntax to read and update your data:

device = db:device('device name')
-- read db
print(device.name)
-- update db
device.name = xxx

If you really need to be able to hand edit the result, YAML is a very good choice. JSON (or Lua tables) tend to become unreadable.

Gaspard

On Wed, Feb 2, 2011 at 5:06 PM, Jerome Vuarand <jerome.vuarand@gmail.com> wrote:
2011/2/2 Peter Cawley <lua@corsix.org>:
> On Wed, Feb 2, 2011 at 1:54 PM, Axel Kittenberger <axkibe@gmail.com> wrote:
>> You'll hit the ceiling with this method if:
>> * all of your data doesnt fit in memory at once.
>> * you have more than one process wanting to read/write data at the same time.
>> * you want to effectively change only parts of your data.
> Add to that:
>  * you have more than 2^18 constants within a single chunk / function

You can overcome that limitation by splitting data into several
functions that will be run by the loading "dofile" call.

The other limitations are harder to circumvent easily. I personnally
used such a scheme for a project of mine, and switched to CouchDB when
my data grew too big. Document-based databases like CouchDB can let
you implement very easy to use and almost transparent backends for big
Lua structures.