Re: [IndexedDB] Proposal for async API changes

On Thu, May 20, 2010 at 7:34 AM, Shawn Wilsher <sdwilsh@mozilla.com> wrote:
>  On 5/20/2010 2:55 AM, Jeremy Orlow wrote:
>>
>> Thanks for taking the time to do this!
>>
>> Can you maybe discuss the pros and cons you found in terms of implementing
>> something in WebSQLDatabase vs. IndexedDB?  I'm mainly interested in
>> seeing
>> if there's any thing we can improve in IndexedDB that WebSQLDatabase
>> already
>> does well.
>
> So far it's really just that joins are painful in IndexedDB.  I'm working on
> a blog post on this very topic though, and I'll be sure to point everyone in
> this thread to it (I figure this is useful stuff to get out to a wider
> audience).

For what it's worth, one of the ideas behind object stores, rather
than rows+column stores, is to reduce the need for joins. I.e. in our
candy store example you could just as well store objects like:

{ id: 1, name: "Adam", sales: [{candyId: 1, date: "2010-01-02"}, ...]}

However we wanted to use joins in our examples as they are a good way
to illustrate more complex queries and are sure to still happen, even
if less often.

/ Jonas

Received on Thursday, 20 May 2010 16:04:10 UTC