Live data from Hacker News

Show HN: Doculite – Use SQLite as a Document Database

npmjs.com

41–50 of 61 posts

Re: Show HN: Doculite – Use SQLite as a Document Database

#41
That is an interesting approach.

> 6) SQLite is a proven, stable, and well-liked standard.

How does adding this adapter on top affect the stability?

Have you looked at SurrealDB? - https://surrealdb.com/

Seems like it would provide you with what you need.

Re: Show HN: Doculite – Use SQLite as a Document Database

#42

Earlier quoted context omitted.

Incrementing is only one possible use case. Any time you read data and then write back based on that data, you need to ensure that nobody wrote to the document in the interim. RDBMS do this with transactions. Consider the case where a user is submitting an e-commerce order. You want to mark their order as processed and submit it for fulfillment. If you read the order to check if it's already submitted, two requests t…

Thank you for the feedback. Seems this is important.

I’m sorry to be this frank, but if you weren’t even aware of the importance of transactional safety for read-modify-write operations, you shouldn’t be in the business of creating such a library and advertising it. This is really basic database stuff, so you are only at the beginning of the learning curve regarding database topics.

Re: Show HN: Doculite – Use SQLite as a Document Database

#43
post #42

Earlier quoted context omitted.

Thank you for the feedback. Seems this is important.

I’m sorry to be this frank, but if you weren’t even aware of the importance of transactional safety for read-modify-write operations, you shouldn’t be in the business of creating such a library and advertising it. This is really basic database stuff, so you are only at the beginning of the learning curve regarding database topics.

If we allow ignorance to be the gatekeeper of progress, we will stifle the growth of every individual around us.

No one person can know everything. Teaching how to solve these problems will produce better software and better people too.

https://xkcd.com/1053/

Re: Show HN: Doculite – Use SQLite as a Document Database

#44
post #42

Earlier quoted context omitted.

I’m sorry to be this frank, but if you weren’t even aware of the importance of transactional safety for read-modify-write operations, you shouldn’t be in the business of creating such a library and advertising it. This is really basic database stuff, so you are only at the beginning of the learning curve regarding database topics.

If we allow ignorance to be the gatekeeper of progress, we will stifle the growth of every individual around us. No one person can know everything. Teaching how to solve these problems will produce better software and better people too. https://xkcd.com/1053/

I have no issues with the OP having that library as a side project and learning experience. But at their experience level it’s not suitable to be promoted publicly. To be fair, they only asked for opinions on it.

Re: Show HN: Doculite – Use SQLite as a Document Database

#45
post #4

Kind of nifty... Just curious if this is using the JSON functions/operators for SQLite under the covers? https://www.sqlite.org/json1.html Edit: where is the database file stored? A parameter for the Database() constructor seems obvious, but not seeing it in the basic sample.

Yes – I'm using JSON_extract and generated virtual columns https://www.sqlite.org/json1.html#jex Edit: the database is stored in a sqlite.db file in the cwd

Cool, might be worth taking an optional input for the path or "::memory::" for an in-memory database.

Re: Show HN: Doculite – Use SQLite as a Document Database

#46

The one feature that I'd want out of this is atomic writes. If I have a document and want to increment the value of a field in it by one, I'm not sure that's possible with Doculite today: if two requests read the same document at the same time and both write an incremented value, the value is incremented by one, not two. The way _I_ would expect to do this is something like this: const ref = db.collection('page').doc…

What about FieldValue.increment()? https://cloud.google.com/firestore/docs/samples/firestore-da...

That's just sugar on top of atomic writes

Re: Show HN: Doculite – Use SQLite as a Document Database

#47
post #12

I'd see if you can easily port the on top of browser based sqlite in wasm, that's expand your user base and lead to some of the "holy Grail" in the offline first/sync systems

Why not just use IndexedDB in the browser if you don’t want an SQL database?

The same reasons you wouldn’t use IndexedDB on the server?

Modern offline-first applications include a local backend every bit as complex and demanding as a server-based backend.

Re: Show HN: Doculite – Use SQLite as a Document Database

#48
post #44

Earlier quoted context omitted.

If we allow ignorance to be the gatekeeper of progress, we will stifle the growth of every individual around us. No one person can know everything. Teaching how to solve these problems will produce better software and better people too. https://xkcd.com/1053/

I have no issues with the OP having that library as a side project and learning experience. But at their experience level it’s not suitable to be promoted publicly. To be fair, they only asked for opinions on it.

If I had a time machine, I'd use it to identify who in my life gave me this same "advice" and gift them a copy of their obituary from the future.

For a commercial product, yours is honest feedback.

But this isn't that. You popped into a literal show-and-tell to heckle some kid proud of his macaroni art. You didn't even critique the product, just insulted its maker. What the hell is wrong with you to think this is appropriate, or even helpful?

Re: Show HN: Doculite – Use SQLite as a Document Database

#49
If you are serious about transactionality, data consistency, and isolation levels, this sounds different from how you want to go. Both Firestore and Realm have shortcomings here. Fauna (where I work at, btw) and Surreal with FoundationDB on the backend, and Spanner are the only ones that can guarantee strict serializability in a distributed environment. I could argue that Fauna is the most turnkey (least pain to try, test, implement). With those "strict serializable" db's it is much easier to avoid data anomalies, as the ones mentioned in this thread.
Post reply on HN