Re:Show HN: PouchDB - The JavaScript database that syncs
by napoleond on Monday July 15, 2013 @10:37AM
(#6045784)
I've been keeping an eye on PouchDB for a while; it looks like a lot of fun. How does authentication with the Couch server work, though? I don't see anything on the FAQ or after a brief perusal. CouchDB's apparently lax attitude toward security years ago was what kept me away, but I've always hoped/assumed that it improved since then. Has it?
Re:Show HN: PouchDB - The JavaScript database that syncs
by daleharvey on Monday July 15, 2013 @10:49AM
(#6045877)
CouchDB had some quirks related to user accounts as it has the added burden of trying to be an application server as well as a database server.
With PouchDB a lot of the application server logic doesnt apply and you can use CouchDB as a private data server that requires any connection to be authenticated, in the example we use basic auth but other methods are available and none of the security quirks with 'couchapps' apply.
Re:Show HN: PouchDB - The JavaScript database that syncs
by etrepum on Tuesday July 16, 2013 @08:04PM
(#6055482)
Sadly it's not possible to have CouchDB make that happen for you! You can very easily allow unauthenticated requests to create users, but there's no way to create those per-user databases without writing some trusted code that runs separately from CouchDB.
Re:Show HN: PouchDB - The JavaScript database that syncs
by daleharvey on Monday July 15, 2013 @07:29AM
(#6044898)
I just put up this website, its ugly but working on the content, in particular I want it very easy to understand wtf it is and get started, would love to hear your feedback.
Re:Show HN: PouchDB - The JavaScript database that syncs
by alessioalex on Monday July 15, 2013 @08:21AM
(#6045046)
I especially like PouchDB-Server as a mini CouchDB replacement ( https://github.com/nick-thompson/pouchdb-server ). Congrats for implementing LevelDB into PouchDB so we can use it in Node.
Re:Show HN: PouchDB - The JavaScript database that syncs
by daleharvey on Monday July 15, 2013 @08:32AM
(#6045081)
The congratulations goes to https://twitter.com/chesles who implemented most of the levelDB adapter and Nick Thompson for the router + server implementation.
The server is really exciting, we mostly built it so we can reuse CouchDBs test suite however with it being so easy to install its becoming pretty invaluable
Re:Show HN: PouchDB - The JavaScript database that syncs
by ollysb on Monday July 15, 2013 @08:47AM
(#6045147)
The website is mostly very clear but I wasn't sure what the db on the backend would be, it sounds like it expects to work with couchdb but an adaptor could potentially be made to work with anything server side?
Re:Show HN: PouchDB - The JavaScript database that syncs
by daleharvey on Monday July 15, 2013 @09:00AM
(#6045217)
Thats useful, I really should explain this a bit more on the site.
In the browser PouchDB will store its data in IndexedDB or WebSQL, in node its LevelDB, with the HTTP adapter you can use any product that implements the CouchDB HTTP Api protocol, currently this is CouchDB, Cloudant, PouchDB-Server and Couchbase Lite (previously TouchDB)
The important part is that it can only sync with a backend that implements the same replication protocol.
Re:Show HN: PouchDB - The JavaScript database that syncs
by rismay on Monday July 15, 2013 @08:10AM
(#6045010)
Dale - I've been really interested in this project since I work with CouchbaseLite. Hope you get good feedback. I'm particularly interested in setting this up with Sync_gateway. https://github.com/couchbaselabs/sync_gateway
Re:Show HN: PouchDB - The JavaScript database that syncs
by daleharvey on Monday July 15, 2013 @08:40AM
(#6045114)
I mostly just wanted to highlight the key features with 'real' code in the order you would come across them, you are right though might be worth switching that, thanks
Re:Show HN: PouchDB - The JavaScript database that syncs
by amitdugar on Monday July 15, 2013 @08:37AM
(#6045103)
Is it possible to do something like this for a MySQL (innodb with relational keys) database ? I am about to begin work on a project that might be used in countries where we don't have constant connectivity (internet and electricity) .. and we don't want to lose or corrupt data due to connectivity ...
Re:Show HN: PouchDB - The JavaScript database that syncs
by daleharvey on Monday July 15, 2013 @08:41AM
(#6045123)
I mention this in the FAQ
Can PouchDB sync with MySQL / my current non CouchDB database?
No, the data model of your application has a lot of impact on its ability to sync, relational data with the existence of transactions make this harder. It may be possible given some tradeoffs but right now we are focussing on making PouchDB <-> (PouchDB / CouchDB) sync as reliable and easy to use as possible.
Re:Show HN: PouchDB - The JavaScript database that syncs
by akrymski on Monday July 15, 2013 @10:35AM
(#6045772)
I'm not too familiar with Couch, but as I understand it caches views and updates them. Does Pouch do something similar, or does the query function filter all the documents in the database?
Re:Show HN: PouchDB - The JavaScript database that syncs
by daleharvey on Monday July 15, 2013 @02:41PM
(#6047664)
Somewhere between IE support not being a hugely requested feature and that the limitations and speed of localStorage wouldnt make a very useful database. I think support will likely pop up at some point, it isnt very hard to write a new adapter, but right now I would rather focus on making it work very well in modern browsers.
Re:Show HN: PouchDB - The JavaScript database that syncs
by tracker1 on Monday July 15, 2013 @05:22PM
(#6048617)
I'm not sure how well localStorage would even work to be honest... as a key/value store though... prefixing "pouchdb_" + KEYNAME as the localstorage key would probably work. Notifications would probably be the biggest issue, I don't know pouch very well.
I just know that IE8 will probably be pretty relevant for another 2-3 years or so, and IE9 for a couple years after that. I don't like it any more than anyone else, but that's the world we live in.
Re:Show HN: PouchDB - The JavaScript database that syncs
by daleharvey on Monday July 15, 2013 @06:05PM
(#6048852)
Actually we do use localStorage for one thing, they support notifications :) IndexedDB (nor webSQL) have change notifications so we also do writes to a localStorage flag to make sure change notifications go through tabs.
Re:Show HN: PouchDB - The JavaScript database that syncs
by daleharvey on Monday July 15, 2013 @09:32AM
(#6045367)
Its not really like cassandra, which has functionality aimed towards managing and querying huge volumes of data. The main feature here is the syncing, which is reasonably unique to the CouchDB world
Re:Show HN: PouchDB - The JavaScript database that syncs
by hcho on Monday July 15, 2013 @11:06AM
(#6046010)
So you are on your iPad on a train. Your train goes into tunnel, you lose connection. The application still works because your data is saved in PouchDB.
You exit the tunnel, you gain connectivity PouchDB syncs your data to the CouchDB on the server. Other devices can now sync from the server.
Re:Show HN: PouchDB - The JavaScript database that syncs
by tmanx on Monday July 15, 2013 @10:59AM
(#6045954)
so what you're saying is, say you're working on your tablet/mobile/pc with an intermittent connection, it will continue working and update the db when a connection becomes available? is this the main benefit compared to the solution mentioned earlier?
Some beginning tutorials/intros to pouchdb: http://pouchdb.com/getting-started.html http://briantoth.github.io/Tutorial/2013/03/19/pouchdb-intro... http://mattgwwalker.wordpress.com/2013/04/08/pouchdb-2/
Todo Tutorial using AngularJS and PouchDb http://twilson63.github.io/ngTodoPouch/
Building Offline Applications With AngularJS and PouchDB http://mircozeiss.com/building-offline-applications-with-ang...
Other Apps Using PouchDB https://github.com/daleharvey/pouchdb/wiki/Who-or-What-Is-Us...
including this offline conference app https://github.com/axemclion/conference
PouchVision - inspect and interact w/pouch instances http://brudolph.pouchvision.jit.su/
Puton - bookmarklet for inspecting/editing pouch dbs http://puton.jit.su/
PeerPouch (PouchDB-over-WebRTC) - in development at one point https://github.com/natevw/pouchdb
Thanks
With PouchDB a lot of the application server logic doesnt apply and you can use CouchDB as a private data server that requires any connection to be authenticated, in the example we use basic auth but other methods are available and none of the security quirks with 'couchapps' apply.
And yes it is a lot of fun :)
How do I keep one user from accessing another user's data?
The server is really exciting, we mostly built it so we can reuse CouchDBs test suite however with it being so easy to install its becoming pretty invaluable
https://vimeo.com/56632201
In the browser PouchDB will store its data in IndexedDB or WebSQL, in node its LevelDB, with the HTTP adapter you can use any product that implements the CouchDB HTTP Api protocol, currently this is CouchDB, Cloudant, PouchDB-Server and Couchbase Lite (previously TouchDB)
The important part is that it can only sync with a backend that implements the same replication protocol.
Can PouchDB sync with MySQL / my current non CouchDB database?
No, the data model of your application has a lot of impact on its ability to sync, relational data with the existence of transactions make this harder. It may be possible given some tradeoffs but right now we are focussing on making PouchDB <-> (PouchDB / CouchDB) sync as reliable and easy to use as possible.
I just know that IE8 will probably be pretty relevant for another 2-3 years or so, and IE9 for a couple years after that. I don't like it any more than anyone else, but that's the world we live in.
Writing custom code to do that on a mysql stack is very hard.
You exit the tunnel, you gain connectivity PouchDB syncs your data to the CouchDB on the server. Other devices can now sync from the server.
The ability to sync is to let you use the same data across various devices.