Search code examples
uwpwinjs

How much data can be in a LocalSettings container


In one of my apps, I'm using Dexie (IndexedDb), but it's actually much slower and more troublesome than I expected it to be, and after some experimentation I'm considering switching to using LocalSettings containers

My first dexie table represents Items and it has about 85,000 rows, with columns Description, ItemNo, ItemCode, Category, Price and 'DealPrice'

The second table is for barcodes and it has 98,000 rows with columns BarcodeNo, ItemNo and ItemCode

If I use a LocalSettings container for the items and a container for the barcodes, will that be too much data for LocalSettings to handle?


Solution

  • LocalSettings do not have a specified limit, but they are actually serialized as a file in the application data folder. Hence I would not expect using them would be more performant than an actual database. They are more suited for things like "preferences" or configuration, which is changed or queried infrequently. Actually, I have written about the fact that accessing settings itself has a certain cost and caching is necessary.

    I would suggest considering SQLite or LiteDB. Both should be very efficient as long as the you manipulate the data efficiently.

    Update

    I didn't notice this question was tagged for winjs, not for C#. Both solutions suggested could be used in HTML+JS UWP app as well, but would require another layer of indirection (a C#-based Windows Runtime Component). In this case I would suggest trying to investigate the reason why IndexedDb is slow for you (as 100,000 entries should still be reasonably performant). IndexedDb as a native API should have great performance.