- From: Damian <notifications@github.com>
- Date: Sun, 19 Dec 2021 00:39:37 -0800
- To: w3c/IndexedDB <IndexedDB@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/IndexedDB/issues/369@github.com>
``Hello everyone, my opinion on IndexedDB might be little too harsh but in my eyes indexedDB is very confusing and annoying to work with. Instead of taking the same approach like with SQL or NoSQL databases like MongoDB or in memory lokiJS someone (Ali Alabbas & Joshua Bell) decided to add cursors that are slower than simply getAll() and looping through everything. If this wasn't enough IndexedDB blocks the main thread with it's cursor. I rather use IndexedDB as a simple store to getAll() and throw everything into LokiJS where I'm able to do queries and actually work with the data. I truly want to understand why IndexedDB is how it it, why is it blocking the main thread and not running inside a worker instead or why nothing better than a cursor that looks like a forEach() loop with some extra methods like continue() Why am I opening a transaction to then again specify a store and what I want to add? Yes I understand that I'm able to add into multiple stores with one transaction but this could have been something like Promises and PromiseAll where it could be possible to just throw store "transactions" into a TransactionsAll() ```javascript let addUser = db.objectStore('users', 'readwrite').add({...}) let addPost = db.objectStore('posts', 'readwrite').add({...}) let request = await TransactionsAll([addUser, addPost]) ``` Would be much easier to read and to deal with, each objectStore request would be a separate transaction. IndexedDB could actually be great and take so much load of databases to just sync the IndexedDBs with remote DB clusters, but instead we/i have this weird thing. If I offended anyone, it wasn't my intention to do so and I'm sorry. I'm just little frustrated and confused why IndexedDB is this way. -- Reply to this email directly or view it on GitHub: https://github.com/w3c/IndexedDB/issues/369 You are receiving this because you are subscribed to this thread. Message ID: <w3c/IndexedDB/issues/369@github.com>
Received on Sunday, 19 December 2021 08:39:49 UTC