locked
Roaming indexeddb information

    Question

  • Hi all,

    I'm building a Metro Style App with HTML5/Javascript. This application, like most of them, stores information introduced by the user. In this case the information is about tasks the user wants to do.

    I have been using IndexedDB to store this information, because although it is not a lot of data, I wanted to store it in a structured way and being able to query it without loading all the information into memory. At the end, most "complex" application cannot handle all its information in memory. Besides that, if we take into account that tables have limited resources, it makes more sense to try to take advantage of "client databases" like IndexedDB.

    However, we are getting lots of messages from Microsoft about roaming the information and keeping the same application and same experience across all devices. I get it clearly with small data like settings and alike.

    But what happen with big data like the one that we will usually store in IndexedDB databases and similar technologies that may come in the near future? How are we supposed to synch this info so, when I open the application in a different device, I don't need to introduce all the tasks (in this case) again?

    Is there any built-in solution or are we developers expected to build custom mechanisms and services?

    Thanks for the information.


    Si la respuesta es correcta, por favor márcala como correcta. También puedes votarla como útil si te lo ha sido.

    Sunday, April 22, 2012 7:21 PM

Answers

  • You would have to serialize the data from the db to the roaming store and then de-serialize to get it back.  You may be better off (since this is a small amount of data) to simply use JSON to store your information in an object.

    -Jeff


    Jeff Sanders (MSFT)

    Tuesday, April 24, 2012 6:31 PM
    Moderator

All replies

  • Hi Javier,

    You should look to Azure or some other web service to store a lot of data accessible to your app across different devices.

    http://www.windowsazure.com/en-us/

    -Jeff


    Jeff Sanders (MSFT)

    Monday, April 23, 2012 12:17 PM
    Moderator
  • Hi Jeff,

    Thanks for the answer.

    It is not a lot of data, it is just data that I want to query in a structured way. I don't want lots of pairs in memory that should iterate over and over when I'm looking for something. I don't think that is the appropriate way to handle data in an application, as soon as it is more than a "Hello World".

    Azure suggestion is fine, but as far as I know, it won't be free, even if it is short amount of data. Besides that, I suppose I would need to synchronize by myself, right?

    Is there anything in Skydrive that could help with this scenario?

    Thanks again.


    Si la respuesta es correcta, por favor márcala como correcta. También puedes votarla como útil si te lo ha sido.

    Monday, April 23, 2012 3:35 PM
  • I don't understand your question then, could you elaborate?  You just said it is not a lot of data but in your original post you asked: "But what happen with big data like the one that we will usually store in IndexedDB databases and similar technologies that may come in the near future? "

    Can you eloborate on what is your question?

    -Jeff


    Jeff Sanders (MSFT)

    Tuesday, April 24, 2012 1:18 PM
    Moderator
  • Hi Jeff,

    Sorry I'm mixing two scenarios: my concrete scenario (small amount of data stored in indexedDB for "structure" purpose) vs typical scenario (where you store large amount of data in indexedDB).

    Right now I'm concern about my concrete scenario, because that is what happens in the app I'm developing. It is not a large amount of registries.

    But I would like to know the answer to the other scenario too, just in case I may face it in the short term.

    Anyway, getting back to today, I'm storing small pieces of data, but I'm doing it in IndexedDB because I want the info to be structured and queryable. I don't want to load it to memory each time and iterate over all registries.

    Thanks for your help.


    Si la respuesta es correcta, por favor márcala como correcta. También puedes votarla como útil si te lo ha sido.

    Tuesday, April 24, 2012 1:24 PM
  • Hi Javier,

    Oh ok!  So yes, use roaming for small amounts of data (in general we recommend application settings etc...).  For data stores however you will need to store it someplace else (up to you where you put this).  You could use Live SDK apis to store documents for example.

    -Jeff


    Jeff Sanders (MSFT)

    Tuesday, April 24, 2012 1:26 PM
    Moderator
  • Hi Jeff,

    Yes, I have clear that roaming is only for small pieces of data (I read that no more than 50 KB, not sure if that's true).

    So my question would be, how can I roam my indexeddb database? Would it happen automatically for me? As far as I know, it won't. And I don't know where the file or whatever store system is used for indexeddb, will be place so I could upload it manually to any roaming service, like Live SDK.

    Thanks.


    Si la respuesta es correcta, por favor márcala como correcta. También puedes votarla como útil si te lo ha sido.

    Tuesday, April 24, 2012 1:41 PM
  • You would have to serialize the data from the db to the roaming store and then de-serialize to get it back.  You may be better off (since this is a small amount of data) to simply use JSON to store your information in an object.

    -Jeff


    Jeff Sanders (MSFT)

    Tuesday, April 24, 2012 6:31 PM
    Moderator
  • Hi Jeff,

    Thanks for the suggestion.

    I will take it into account.


    Si la respuesta es correcta, por favor márcala como correcta. También puedes votarla como útil si te lo ha sido.

    Tuesday, April 24, 2012 6:47 PM