TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Offline-First Database Comparison

415 点作者 typingmonkey超过 3 年前

23 条评论

karmelapple超过 3 年前
So glad to see PouchDB included. We use it and have generally had a great experience! We use it with CouchDB on the backend, and Couch seems like a fantastic way to go for use cases involving syncing data between devices with an offline mode and syncing between clients. It was built from the ground up with replication in mind.<p>Biggest bummer of CouchDB? If you’re not hosting it yourself, there’s only one major player in the market that I know of: IBM Cloudant. They contribute much to Apache CouchDB though, and hosting it yourself doesn’t seem too difficult, especially for small, simple use cases.<p>Anyone else using CouchDB?
评论 #28995470 未加载
评论 #28996223 未加载
评论 #28998176 未加载
评论 #28996206 未加载
评论 #28995885 未加载
评论 #29001203 未加载
评论 #29016100 未加载
评论 #28998022 未加载
LAC-Tech超过 3 年前
Last write wins is not a strategy for conflict resolution, it&#x27;s a surrender.<p>So I&#x27;m glad to hear something else apart from Pouch actually handles it. Anyone familiar with rxdb and can chime in on how they do it?
评论 #28997257 未加载
nyanpasu64超过 3 年前
Not directly related to the post (which is focused on which database to host for your app), but I&#x27;m writing desktop apps (think DAWs) in C++ and Rust (not JS), and want to synchronize settings through a Dropbox or Google Drive (so I don&#x27;t have to host my own cloud sync servers). What&#x27;s a good library or schema to achieve this?<p>Personally I usually don&#x27;t have multiple instances of the same app open on multiple machines, but other people might open the same or different files on their desktop and laptop.<p>- Not all settings should be synchronized (don&#x27;t include machine-specific &quot;recent files&quot; paths).<p>- How should settings be stored locally (if I may have multiple instances of my app open on a single machine)? Registry (Windows-only)? INI with atomic saving (requires care and locking to prevent multiple instances from trampling or racing with each other)? SQLite?<p>IMO Stylus is a pretty good implementation of offline-first cloud settings sync over Dropbox&#x2F;etc. It&#x27;s currently based around one JSON file per CSS file (Dropbox&#x2F;Apps&#x2F;Stylus - Userstyles Manager&#x2F;docs&#x2F;uuid.json), and what appears to be a transaction log (Dropbox&#x2F;Apps&#x2F;Stylus - Userstyles Manager&#x2F;changes&#x2F;number.json). Cloud sync has been 100% reliable in my experience, though I do notice temporary file lock errors when switching between different machines in my dual-boot setup (but sync seems to be eventually consistent nonetheless).<p>uBlock Origin is worse. Instead of merging settings, it expects the user to upload and download the entire settings blob at once (and pulling an old blob can erase changes you&#x27;ve made locally). And in the past it&#x27;s entirely failed to sync because the blob was too big to upload to Mozilla&#x27;s servers. (Right now it &quot;works&quot; but takes several minutes for one computer to see a config uploaded from another computer.)
评论 #29000179 未加载
评论 #29000013 未加载
评论 #29005177 未加载
dvdhnt超过 3 年前
I really enjoy examples like this, thanks, I’ll be exploring it.<p>As an aside… I would truly love to explore a collection of interesting ways to use SQLite. It’s such an impressive piece of technology that I’d like to use more often. Please share if you have something similar!
评论 #28996077 未加载
评论 #29002690 未加载
评论 #28999089 未加载
评论 #28999937 未加载
shoo超过 3 年前
From the perspective of someone less familiar with this kind of thing, this comparison would be easier to understand with a bit of an introductory explanation about what job we&#x27;re trying to do or problem we&#x27;re trying to solve, and the assumed context or constraints.
评论 #28998031 未加载
评论 #28995982 未加载
throwaway743超过 3 年前
Am I wrong to think that pouchdb uses indexeddb?<p>Over the last 8 months, I&#x27;ve been working on a react&#x2F;capacitor based android app (potentially ios later on) and was originally using idb-keyval, which uses indexeddb for key val storage, and things were great since it&#x27;s a local storage solution compatible with react&#x2F;capacitor, and one of my goals is to not rely on a remote data storage solution.<p>As said, things were going great, but then a couple weeks ago things went to shit when all the data that was stored in the prototype on my android device was wiped. Apparently, both android and ios tend to wipe browser&#x2F;web-view local storage at random&#x2F;when space is needed(?).<p>Dug around since looking for an alternative solution (would love a capacitor compatible mongodb solution), came across pouchdb via rxdb, but could&#x27;ve sworn there was mention that it relies on indexeddb. So just to be safe switched to sqlite and been rewriting components since.<p>Lesson of the story, even if it isn&#x27;t dependent on indexeddb, if you&#x27;re looking for a local storage option for a mobile app and happen to be using a js framework with capacitor or anything that utilizes a web-view, stay away from anything that uses indexeddb. If a wipe like this were to happen post release, the chance that your app succeeds afterwards would be near 0%<p>Edit: so yeah, just double checked&#x2F;was reading through the readme of this project, and pouchdb via rxdb is reliant on indexeddb
评论 #28995691 未加载
评论 #28998319 未加载
评论 #28996922 未加载
评论 #29016253 未加载
y4mi超过 3 年前
My biggest gripe with offline-first capability of PWAs is <i>speed</i>. a network roundtrip is generally faster then fetching the same information from indexeddb, and you still have to sync first because indexeddb tends to get wiped at inopportune times.<p>its great if you&#x27;re writing a traditional app though, but really unfortunate wrt to the PWAs
评论 #28998272 未加载
评论 #28997411 未加载
评论 #28997707 未加载
评论 #28997393 未加载
评论 #29003071 未加载
wanderingmind超过 3 年前
Any information on how scalable are these databases compared to traditional SQL databases? Or specifically, when should you use this (in prototyping or production)
评论 #28999741 未加载
评论 #29001253 未加载
peterthehacker超过 3 年前
What kind of consistency models [0] do Offline-first databases like RxDB and PouchDB have?<p>I was thinking read uncommitted, but they might allow dirty writes. Maybe there’s some CRDTs under the hood… I can’t find any documentation on consistency though, anyone here know?<p>[0] <a href="https:&#x2F;&#x2F;jepsen.io&#x2F;consistency" rel="nofollow">https:&#x2F;&#x2F;jepsen.io&#x2F;consistency</a>
评论 #29001206 未加载
评论 #28998045 未加载
spankalee超过 3 年前
Wait, this is benchmarking the Firestore emulator. How is that relevant?
评论 #28998670 未加载
FractalHQ超过 3 年前
I imagine that Supabase would be a perfect candidate for this project! I would love to get the authors opinion on it too.
评论 #28995412 未加载
评论 #28995505 未加载
carabiner超过 3 年前
Some charts for that table would be so awesome.
评论 #28997067 未加载
globular-toast超过 3 年前
I&#x27;ve used watermelondb and found it quite nice to use. I mainly chose it because it has observable queries. I can live without conflict resolution and transactions on the client side because it&#x27;s an electron app. Having a sqlite backend (via the electron process) would overcome some of the shortcoming wrt to the in memory database (and still allow in memory via sqlite if speed is desired). I wrote a backend sync for it which was quite easy although I haven&#x27;t fully implemented support for everything because I don&#x27;t need it (notably deletes).
oblib超过 3 年前
For offline-first use PouchDB can connect directly to a CouchDB installed on your desktop PC as opposed to storing user data in your browser&#x27;s built-in IndexedDB and syncing that with a Cloud based CouchDB.<p>Syncing that local CouchDB to your web based CouchDB is very fast and it&#x27;s done in the background so it doesn&#x27;t affect the performance of actually using the app. You can click &quot;Save&quot; and move on with no waiting at all.<p>So in this scenerio the speed of the DB is not necessarily a reflection of the speed of the app for the user.
评论 #29004173 未加载
jdc超过 3 年前
See also Google&#x27;s <i>Lovefield</i> SQL browser database:<p><a href="https:&#x2F;&#x2F;google.github.io&#x2F;lovefield" rel="nofollow">https:&#x2F;&#x2F;google.github.io&#x2F;lovefield</a>
评论 #28997487 未加载
评论 #28996747 未加载
dSebastien超过 3 年前
I&#x27;ve used CouchDB and PouchDB on a previous project, and it was a blast. The built-in features like replication and HTTP API are great. My only regret is the limited support (at the time) for full text search and complex queries. I suppose I like joins a bit too much.. :)<p>I deployed CouchDB in a Kubernetes cluster (not with HA as I didn&#x27;t have high availability requirements), and it was working great.
评论 #29001212 未加载
chadcmulligan超过 3 年前
I often feel I&#x27;m on another planet when I see timings for browser things people are recommending - Insert one message - best 9ms, insert 20 messages - best 33ms, worse - &gt;8 Seconds! Why bother? just write a native client.
评论 #29000797 未加载
评论 #29000742 未加载
redwood超过 3 年前
Surprised not to see Realm included (www.realm.io)
joshxyz超过 3 年前
I wonder why multitab isnt supported on watermelon, crosstab updates thru localstorage api works great
评论 #28999969 未加载
评论 #28999886 未加载
RobertRoberts超过 3 年前
What is the advantages of using one of these client side databases vs using indexeddb directly?
评论 #29000689 未加载
评论 #29000909 未加载
ofrzeta超过 3 年前
I never see Mozilla&#x27;s Kinto mentioned.
porcc超过 3 年前
gunjs?
评论 #28997285 未加载
sushsjsuauahab超过 3 年前
How far the world has fallen from Linux, MySQL, SpringBoot, and HTML&#x2F;CSS&#x2F;JS
评论 #28997756 未加载
评论 #28997078 未加载