HI Mark,

I am intrigued by your way of saving only whats changed and also when
you say save to disk after arrayencoded. Do you meanas a simple  save
as a binfile or in an sqlite BLOB?

I would really like to see some exampleish code on saving to disk - if
it's other than a single array in a single binfile - I think even I
can do that. But your other ideas sound brilliant.

Regards Lagi

On 8 March 2018 at 18:38, Mark Talluto via use-livecode
<use-livecode@lists.runrev.com> wrote:
>> On Mar 8, 2018, at 9:03 AM, Lagi Pittas via use-livecode 
>> <use-livecode@lists.runrev.com> wrote:
>>
>> In the first version of the system I save the arrays which held all
>> the Clerks orders/totals etc and items into an external stack every
>> time they added an item.
>
> I too use arrays as a data store. You could save the arrays to disk directly 
> with arrayEncode(). To save time and not store the entire array to disk, you 
> could store only the portions that have been updated on every update. This 
> will keep the data store safe and fast. It will also remove the occasional 
> issue of stack corruption…since you will not store the data inside of stacks 
> any longer.
>
> All creates/reads/update/writes would be done to memory. Those calls that 
> modify data will simply do a follow-up write to disk for that particular 
> record. To defeat OS inode limitations, you could group your arrays logically 
> into files. Thus, you would have anywhere from 1 to a 100 sub arrays grouped 
> together. The loading and storing of arrays is very fast. Even with databases 
> in the 100s of thousands to low millions of records counts.
>
> Performance is amazing. The best part is you are speaking to your database 
> using LiveCode commands and functions. The only limitation is the amount of 
> RAM on a given device. Should you outgrow that limitation then you could move 
> the data to the cloud. Or you could load/unload data accordingly from disk. 
> This would also be a nice indicator that your business is growing. Of course, 
> it could just be that you are storing a lot of data. :)
>
> If you need any help or ideas, let me know.
>
> Best regards,
>
> Mark Talluto
> livecloud.io <http://livecloud.io/>
> nursenotes.net <http://nursenotes.net/>
> canelasoftware.com <http://www.canelasoftware.com/>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to