Saving data/settings

Mark Talluto mark at canelasoftware.com
Wed Dec 7 12:22:46 EST 2016


> On Dec 7, 2016, at 7:14 AM, pink <nabble at mad.pink> wrote:
> 
> I've experimented a little bit with local database files. In particular I've
> tried Andre Garzia's database library, and Livecloud's local database, both
> of which are pretty nice.
> 
> I'm curious what everyone else uses, and what do you think are the pros and
> cons of different methods?

*Quick disclosure: I work on the CassiaDB/LiveCloud project.

For most of our local data storage we use CassiaDB (database that powers LiveCloud). Databases are nice for a number of reasons. They manage all the gory details for robust storage. Performance is better as a norm due to optimizations in the way data is managed. Query is a big plus. Updating data is easy. Reading specific data is useful. Keep in mind that you can store both text and binary data in a database. This would include LiveCode controls. I dare say, "Databases are cool". Bet you do not hear that often. :)

Sometimes JSON documents are useful. This would be for interoperability with other technologies. MergJSON works really well and allows arrays to be preserved to disk. Plus this gives one an in with other databases like MongoDB and CouchDB ;). We use JSON for our config file in CassiaDB.

LSON is the format used by CassiaDB when data is cached to disk. It is a performant format as it is native to LiveCode.

In the past it was common for us to use XML. Text file storage is human readable and builds confidence when just starting out with a new project. Testing what you save to the file can be verified easily with a text editor pointing to said file.

I would agree with the others that learning to use a database will be worth the effort in the end. There are many options available to LiveCode developers. Here are a few off the top of my head *that have LiveCode friendly APIs available*:  Valentina, SQLite, CouchDB (thanks to Pink), various SQLs, and CassiaDB.

Best regards,

Mark Talluto
livecloud.io <http://www.livecloud.io/>
canelasoftware.com <http://www.canelasoftware.com/>






More information about the use-livecode mailing list