I think I just wet myself.
My needs are *very* modest for my current iOS project. I'm eager to see that fever continue and have this to work with!
You go Jens!
Cheers,
Aaron.
On Dec 19, 8:14 pm, Jens Alfke <j...@couchbase.com> wrote:
> TouchDB<https://github.com/couchbaselabs/TouchDB-iOS/> is a project I’ve been feverishly working on for a few weeks. It’s an investigation into the feasibility of a CouchDB-compatible database rewritten from the ground up for mobile apps. The comparison I like to make is that “if CouchDB is MySQL, then TouchDB is SQLite”. In fact, it uses SQLite as its underlying storage engine. You can read a longer justification for it<https://github.com/couchbaselabs/TouchDB-iOS/wiki/Why-TouchDB?> on its wiki, as well as an FAQ<https://github.com/couchbaselabs/TouchDB-iOS/wiki/FAQ> and design document<https://github.com/couchbaselabs/TouchDB-iOS/wiki/Object-Design-And-S...>.
>
> — It speaks CouchDB’s replication protocol. I’m pretty serious about that; I’m even documenting the protocol<https://github.com/couchbaselabs/TouchDB-iOS/wiki/Replication-Algorithm>.
> — It also understands a large subset of the REST API, enough so that it works with CouchCocoa. I’ve got a clone of Grocery Sync working as one of the demo apps in the project.
> — The current implementation is for iOS. Marty is hoping to start on an Android version soon.
>
> TouchDB is certainly not ready for prime-time yet, but here are some current statistics to whet your appetite:
>
> • Code size of an ‘empty’ iOS app with nothing in it but TouchDB: ~150k
> • Time to initialize TouchDB and open a database, on iPad 2: ~100ms (cold) or ~60ms (warm)
> • Size of source code: ~4000 lines of Obj-C (plus another ~2500 lines from some existing utility libraries)
>
> What’s left to do? Probably a lot — that infamous “second 90%”. Prominently:
> • Attachments
> • Reduce functions and grouping
> • Filters for views and replication
> • Performance tuning
> See the issue tracker<https://github.com/couchbaselabs/TouchDB-iOS/issues> for more.
Get the following message:
ARC forbids Objective-C objects in Structs ... used
_strong_nonretained to get around it...
On linking the app, get the following messages
"_OBJC_CLASS_$_FMDatabase", referenced from:
objc-class-ref in TouchDB(TDDatabase.o)
"_OBJC_CLASS_$_CouchbaseMobile", referenced from:
objc-class-ref in CouchCocoa(CouchEmbeddedServer.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
Not sure how to make this work
/** Standard query options for views. */
typedef struct TDQueryOptions
{
NSString* startKey;
NSString* endKey;
int skip;
int limit;
BOOL descending;
BOOL includeDocs;
BOOL updateSeq;
} TDQueryOptions;
On Dec 20, 6:14 am, Jens Alfke <j...@couchbase.com> wrote:
> TouchDB<https://github.com/couchbaselabs/TouchDB-iOS/> is a project I’ve been feverishly working on for a few weeks. It’s an investigation into the feasibility of a CouchDB-compatible database rewritten from the ground up for mobile apps. The comparison I like to make is that “if CouchDB is MySQL, then TouchDB is SQLite”. In fact, it uses SQLite as its underlying storage engine. You can read a longer justification for it<https://github.com/couchbaselabs/TouchDB-iOS/wiki/Why-TouchDB?> on its wiki, as well as an FAQ<https://github.com/couchbaselabs/TouchDB-iOS/wiki/FAQ> and design document<https://github.com/couchbaselabs/TouchDB-iOS/wiki/Object-Design-And-S...>.
>
> — It speaks CouchDB’s replication protocol. I’m pretty serious about that; I’m even documenting the protocol<https://github.com/couchbaselabs/TouchDB-iOS/wiki/Replication-Algorithm>.
> — It also understands a large subset of the REST API, enough so that it works with CouchCocoa. I’ve got a clone of Grocery Sync working as one of the demo apps in the project.
> — The current implementation is for iOS. Marty is hoping to start on an Android version soon.
>
> TouchDB is certainly not ready for prime-time yet, but here are some current statistics to whet your appetite:
>
> • Code size of an ‘empty’ iOS app with nothing in it but TouchDB: ~150k
> • Time to initialize TouchDB and open a database, on iPad 2: ~100ms (cold) or ~60ms (warm)
> • Size of source code: ~4000 lines of Obj-C (plus another ~2500 lines from some existing utility libraries)
>
> What’s left to do? Probably a lot — that infamous “second 90%”. Prominently:
> • Attachments
> • Reduce functions and grouping
> • Filters for views and replication
> • Performance tuning
> See the issue tracker<https://github.com/couchbaselabs/TouchDB-iOS/issues> for more.
The errors I received on building are:
On linking the app, get the following messages
"_OBJC_CLASS_$_FMDatabase", referenced from:
objc-class-ref in TouchDB(TDDatabase.o)
"_OBJC_CLASS_$_CouchbaseMobile", referenced from:
objc-class-ref in CouchCocoa(CouchEmbeddedServer.o)
Also, CouchEmbeddedServer doesn't work with TDb yet. Look at the iOS demo's app delegate to see how it sets up the 'server'.
--Jens [via iPhone]
Hi Jens,
this is really exciting, and the name is cool too.
I'd always thought that CouchDB needed an RFC-like approach for JSON
sync, to enable as many diverse implementations as possible. I'll be
keen to work with you on documenting the replicator as well.
A+
Dave
Portable views are
elegant - with Couchbase Mobile we are able to architect our database
structure and underlying views in a completely platform-agnostic
fashion.
And the lack of HTTP API means no direct interaction between
UIWebView and the database - and no CouchApp - which is a major loss.
Not referencing couchembeddedserver at all. But still in couchcocoa ... not sure where to go from here...