Big round of applause for everything you've done, Dale. I've rarely seen an open-source project that's managed as well as PouchDB, and I definitely wouldn't have gotten so involved in open-source if you hadn't been so supportive and helpful right off the bat.
I think after 5 years of work, we have one of the best-tested, best-documented, and friendliest JS projects out there. The code is so solid that new bugs are almost always user errors, weird environments, plugins, integration (e.g. SQLite Plugin), etc.
I wholeheartedly agree with your post but have a few things to add; see responses below.
1. Implement purge - I kept saying "almost" finished, I think this is the last feature to "finish" PouchDB, its tricky to get right, but important for mobile users. I would like to get some working version of purge done without a groundup rewrite.
Yep, this is pretty much the last big feature before we're "feature complete."
2. Close all bugs - I have been categorising things as 'bugs' and 'enhancements', I would really like to get to the point where we are releasing PouchDB with no known bugs. (defining what exact is a pouchdb bug is not going to be a perfect process as far as I can tell)
Yep.
3. Cleanup - With PouchDB being 'almost finished', I think now is a great time to comb through the code base and refactor any not so great code code, if there is magical code that isnt clear how it works (changes code! most of constructor etc) it should be made simpler as well as make api's more consistent (adapter.js etc)
The replication code is also stateful and hairy as all getout. :P
4. Promote - At least I have always still been cagey about promoting PouchDB and making it totally inviting for users, stuff like try-pouchdb, pouch.host / pouchbase, paste.pouchdb.com, can become better integrated parts of the project more tutorials and better visibility of the ones that exist I'm going to be on the JavaScript Jabber podcast next week to talk about PouchDB. I also definitely think there need to be more blog posts and tutorials out there. Patricia Garcia's talk at JSConf EU (
https://www.youtube.com/watch?v=1sLjWlWvCsc) highlighted this; she said something like "this is cutting-edge tech, so there aren't 50 tutorials out there explaining what to do." PouchDB *needs* those 50 tutorials, especially if it's going to attract the attention of junior devs and early coders.
5. pouchdb-find - Map reduce queries have long been a source of suffering for CouchDB users, lets see what capabilities are missing from pouchdb-find (skip / limit?) and get this merged into core
pouchdb-find will probably hit 1.0 within a month, thanks mostly to Garren's work.
6. Fully streaming replication, _bulk_get is a vast improvement, however if we follow on from https://github.com/nolanlawson/pouchdb-replication-stream and see if we can get our default replication to be a straight stream, its going to perform much better and open up more features for users Yup, I think this is part of a larger discussion that needs to happen with the CouchDB folks. Jan said he liked my pouchdb-replication-stream, but didn't like how it handles attachments (base64, yeah, binary is better). You pointed out that it could be even more efficient by diffing. Both of those are great ideas; I'd love to see an implementation :).
7. Along with pouchdb-find one of the major sources of fustration is per document validation, per user databases are nice for a very specific use cases but any other use case is currently prohibitively complicated, this is going to need a lot of experimentation mostly done out of pouchdb core, but I think as we promote pouchdb to more users, this is a story that will and needs to be fleshed out
To me, this is pretty much the biggest failing of CouchDB's authentication system. I think it's silly that you can *almost* implement a full authentication system with pure CouchDB, but then you're stuck if you want per-user read/write permissions, which is like 95% of everybody's use case.
But IMO it's mostly fixed once couch-per-user is in core. The only improvement would be couch-per-role (also much needed for many use cases). It also could be solved by external projects like Hoodie, pouch.host, superlogin, etc.
8. idb-next - Our underlying storage model is vastly unsuited to how we handle data, it makes all reads / writes much slower and secondary indexes an order of magnitude slower, I am experimenting a new ground up indexeddb adapter that will hopefully work across safari, be less code and make secondary indexes super fast
Much needed, would love an overhaul of IndexedDB that *actually* works cross-browser. Keep an eye on the WebKit commit log; Brady Eidson has actually been doing a lot of work on IDB in the last few weeks, e.g.
http://trac.webkit.org/changeset/191210. So if we're lucky, Apple will fix most of their glaring issues and we don't have to write a ton of workarounds.
9. Conflict free replication - This is how most other sync solutions work, the replicator is required to resolve the conflict before writing, it would vastly simplify storage requirements (we would only ever need to store current rev) and potentially be far easier for users to comprehend (nobody handles conflicts), we can write a pouchdb replicator that works like that.
This can be solved in plugin land IMO. We need better automated conflict resolution; pouch-resolve-conflicts is a good start, but we need something *way* simpler:
https://github.com/jo/pouch-resolve-conflicts. And yes, we can write a custom replicator and distribute that as a plugin; see pouchdb-full-sync for an example of one:
https://github.com/nolanlawson/pouchdb-full-syncI agree that most users don't want to think about conflicts, but to me it is a virtue of PouchDB that we strive to educate users about the reality of distributed systems, and at least give them the *option* to handle conflicts.
What are your goals and plans for PouchDB
My list:
1) Performance
I'm really unsatisfied with secondary indexes right now. I still think that ideally it needs to be solved before purge() is solved; otherwise we're going to have to write something very complicated that deals with dependentDbs and weird message passing between DBs; I would prefer if adapters just had some kind of low-level _createIndex() API or something that let you store basic key/values and then iterate over them, or modified the doc-store to have secondary keys other than the _id. This could be implemented in abstract-mapreduce, and then shared between pouchdb-find and mapreduce.
2) Plugins, plugins, plugins
As usual I have plenty of ideas for cool plugins. Some random ones off the top of my head:
pouchdb-webrtc (successor to PeerPouch, but based on worker-pouch/socket-pouch)
pouchdb-graphql (GraphQL/Relay/Flux is all the hype right now; I think we could do something ala ember-pouch to integrate with this)
pouchdb-progress-indicator (sync progress is hard, 'nuff said)
3) More user-friendly sugar APIs
I've always felt that both Pouch and Couch's API is way too complicated for beginners (they have a *really* hard time grokking 409s and _revs). It's also not well-suited to be the whole kit-n-kaboodle for a BaaS, which makes it hard for PouchDB to compete with the likes of closed-source centralized systems like Firebase and Parse (who I see as our primary competition, frankly).
I think Hoodie has the best handle on how to solve this problem, so if I have time and motivation I would probably start contributing to Hoodie more, and help build up a nice suite of user-friendly tools around that.
4) More outreach
As I mentioned above, the biggest thing the PouchDB community is missing right now, is tutorials, blog posts, videos, "try PouchDB," etc.
One of the reasons CouchDB "lost" to Mongo is that it was just way easier to get started with Mongo. Developers like to believe that they base their opinions on carefully studied research, but in fact mostly they base it off of 1) hype, 2) name recognition, and 3) how easily they can get started and feel empowered. #3 tends to feed into #1 and #2, because developers don't have time to try everything, so they briefly test-drive some tool and then sing its praises to their friends and coworkers.
PouchDB needs help in all three, and we're at a deficit because we are a community-driven, unfinanced open-source project. Meteor, Firebase, and Parse can all afford to write a blog post per week and promote themselves on social media; we have to go the community route and rely on word-of-mouth and groundswell. No biggie; that's how jQuery, lodash, and other heavy-hitters got started.
Anyway, congrats again to everyone on an awesome project. Dale, Calvin, Nick, Marten, Tomasz, and everybody else who contributed: amazing work, you are all some of my favorite people to work with, and let's keep it up. :)
- Nolan