PouchDB 3.0.0 will be up to 77% faster than 2.2.3 for secondary index creation. Gains were made across all adapters, with the most improved being IndexedDB in Chrome.
Database | Known to pass at 100% | Comments | Issue |
---|---|---|---|
LevelDOWN | ✓ | Very stable | |
MemDOWN | ✓ | Somewhat stable, seems to have intermittents, can't find them now for some reason | |
RiakDOWN | X | Seems stable-ish, but needs to implement destroy() |
here |
SqlDOWN | X | failing at test.design_docs.js-http Concurrent queries |
here |
MysqlDOWN | X | Doesn't seem stable | |
RedisDOWN | X | Fails at test.all_docs.js-http Testing conflicts | here and here |
There are a ton related to performance, which you can probably skip for now. Those should be reviewed with a fine-toothed comb, since most performance fixes make the code harder to read, unfortunately.
This one is kind of a big deal for pouchdb-server. Basically I wanted to set it up so that when we test against pouchdb-server, we don't cram all the files in the root directory (annoying during development), and in the process I discovered a bug in how the db was reporting its name in db.info. This fix makes sure that the name is the same everywhere (on('destory'), on('create'), db.info()) and is something sensible, regardless of the prefix.
More pouchdb-server stuff. I think it makes sense to go ahead and merge this, even though it's failing. Gives us an excuse to make more improvements to MemDOWN.
// I want to write this: | |
public class WebViewFragment extends Fragment { | |
int mHtmlResource; | |
public WebViewFragment(int htmlResource) { | |
mHtmlResource = htmlResource; | |
} | |
var getID = function (result) { | |
return result.id; | |
}; | |
var db = new PouchDB('test'); | |
return db.post({things: [1, 2, 3]}) | |
.then(getID) | |
.then(function (id) { | |
return db.get(id); | |
}); |
The new Cloudant query API is pretty awesome. It basically looks like Mongo, which makes for much more readable and user-friendly queries than what you can get with standard map/reduce.
Index the field foo
:
cinnabar:~ nolan$ acurl -X POST https://pouch.cloudant.com/mydb/_index -d '{
> "index": {
> "fields": ["foo"]
> },
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> | |
<style> | |
.sidebyside { | |
display:inline-block; | |
max-width: 200px; | |
margin: 0 30px 20px 30px; |
Quick post-mortem on this, since I think it's interesting. :)
The idea itself was excellent. By hooking into the Level* ecosystem, we got a number of different backends for free*: in-memory (both client and server), localStorage, RiakDOWN, SqlDOWN, etc.
We never did replace the IndexedDB and WebSQL adapters, though. Part of that was probably a self-fulfilling prophesy on my part, because I went to extreme lengths to get both adapters passing on Safari, IE, Android, iOS, PhantomJS, and now even the Cordova SQLite Plugin on both iOS and back to Android 2.3. Then I performance-tuned the hell out of them.
So now I think we're invested enough in idb.js and websql.js, and the performance is tuned so tightly to those specific APIs, that switching to level.js/WebDOWN/SqlDOWN would be too big a cost to bear in terms of performance (level.js is currently 2x slower). And we'd get little gain in developer efficiency, since our implementations are pretty rock-solid by now. In fact I think PouchDB may be at the forefro
<html> | |
<body> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/pouchdb/2.2.3/pouchdb.min.js"></script> | |
<script src="index.js"></script> | |
</body> | |
</html> |