Looking for cross-platform syncing solution. Windows?

2014-10-22 Thread adam wilson


I'm looking for a cross-platform data syncing solution and Couchbase Lite 
looks like a winner atm, with Sync Gateway handling restriction of data 
between users. 
I am currently developing an iOS and Android app, but also looking to build 
a desktop app that will share / use the same data. OSX is covered with 
Couchbase Lite iOS version, however I want to know that I can also build 
something for Windows and possibly also Linux. 

I am building the app using JUCE C++ framework, and so most of the code 
will be shared across platforms apart from platform-specific stuff. I am 
not sure if the C# or Java versions would be better to include in a Windows 
project? 

Any chance of a C/C++ port of Couchbase Lite? 

-- 
You received this message because you are subscribed to the Google Groups 
Couchbase Mobile group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mobile-couchbase+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/151cf2fc-12d8-4239-b1eb-0de476ebaea9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Looking for cross-platform syncing solution. Windows?

2014-10-25 Thread adam wilson
Thanks Jens. Yes, probably C# best for Windows, although from what Zachary 
says below it seems worth investigating the use of the .NET port for other 
platforms too.. 

I hear you about C++ - although JUCE is a great framework, after working 
with C#, Ruby and Javascript, the complexity of C++ can really bog things 
down. Although some of the new features of C++11 are nice. The reason I am 
using C++ is that I'm working on cross-platform audio software. 

I'm also really interested in Rust, it looks really promising, I actually 
posted about it a few weeks ago on the JUCE forum but got no response. I 
guess its all about how widely it gets adopted. 

And - Apple open-sourcing Swift, would be great! Have a feeling they would 
prefer to keep the gates locked on their walled garden...   

On Thursday, 23 October 2014 05:23:02 UTC+1, Jens Alfke wrote:


 On Oct 22, 2014, at 3:03 PM, adam wilson adam.el...@gmail.com 
 javascript: wrote:

 I am building the app using JUCE C++ framework, and so most of the code 
 will be shared across platforms apart from platform-specific stuff. I am 
 not sure if the C# or Java versions would be better to include in a Windows 
 project? 


 I'm guessing C# would be better on Windows, since the runtime and class 
 libraries are already installed, vs. Java where you'd have to have users 
 install a JRE download.

 Any chance of a C/C++ port of Couchbase Lite? 


 Nope :) To be honest, I went through this decision when I started writing 
 the original code back in 2011, and I immediately ruled out C++ because my 
 previous experience developing in it told me that it would bog down in 
 complexity and confusing compiler errors. (And yes, I have developed large 
 C++ projects before.)

 Currently my big hope for cross-platform client development is that Apple 
 will open-source Swift and it'll be ported to other OSs. Or that Mozilla's 
 Rust language will finally be finished and work as well as it promises to.

 —Jens


-- 
You received this message because you are subscribed to the Google Groups 
Couchbase Mobile group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mobile-couchbase+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/ffe054b1-5be1-4c0e-b0b0-de746637d0b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Looking for cross-platform syncing solution. Windows?

2014-10-25 Thread adam wilson
Cheers Zack, I've looked at Xamarin before, and it certainly looks worth
trying out. One question, I saw Couchbase-Lite in the Components section
of the website, and one of the reviews from July says:
Still waiting for a working replication solution (iOS at least).
That was for version 0.9 - can you confirm if this is fixed on the latest
version? Might be worth adding a comment if thats possible to make other
potential users aware.


On 25 October 2014 18:26, Zack Gramana z...@couchbase.com wrote:

  You can write native C# iOS and Android apps using Xamarin:
 http://www.xamarin.com/.

  (I actually started work on CBL.NET when I was working at Xamarin a year
 ago, in the interest of full disclosure.)

 Interestingly, one of the more well known .NET community members, Frank
 Krueger, has already started implementing Swift on .NET (
 https://github.com/praeclarum/SwiftSharp).

  On Oct 25, 2014, at 1:08 AM, adam wilson adam.elemen...@gmail.com
 wrote:

   Thanks Zachary, that sounds promising. I've not seen examples of
 including C# in C++ projects, at least not within Xcode, my current
 development environment. I've used Mono in the past, so I guess its
 possible. It would be nice not to have to write wrappers for each platform.
 I will have a look, although if you have any links to examples that would
 be greatly appreciated.


 On Thursday, 23 October 2014 05:30:23 UTC+1, Zachary Gramana wrote:

  Well, being the .NET guy on the team, I'll mention that you have the
 benefit of using Couchbase Lite for .NET on iOS, Android, Windows, OS X,
 and Linux. If that's what you're looking for, then you immediately reuse
 your C# or F# code across all of the above platforms.



 On Oct 22, 2014, at 3:06 PM, adam wilson adam.el...@gmail.com wrote:



 I'm looking for a cross-platform data syncing solution and Couchbase Lite
 looks like a winner atm, with Sync Gateway handling restriction of data
 between users.
 I am currently developing an iOS and Android app, but also looking to
 build a desktop app that will share / use the same data. OSX is covered
 with Couchbase Lite iOS version, however I want to know that I can also
 build something for Windows and possibly also Linux.

  I am building the app using JUCE C++ framework, and so most of the code
 will be shared across platforms apart from platform-specific stuff. I am
 not sure if the C# or Java versions would be better to include in a Windows
 project?

  Any chance of a C/C++ port of Couchbase Lite?

 --
 You received this message because you are subscribed to the Google Groups
 Couchbase Mobile group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to mobile-couchba...@googlegroups.com.
 To view this discussion on the web visit https://groups.google.com/d/
 msgid/mobile-couchbase/151cf2fc-12d8-4239-b1eb-
 0de476ebaea9%40googlegroups.com
 https://groups.google.com/d/msgid/mobile-couchbase/151cf2fc-12d8-4239-b1eb-0de476ebaea9%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.

--
 You received this message because you are subscribed to the Google Groups
 Couchbase Mobile group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to mobile-couchbase+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/mobile-couchbase/bb6e8868-ec0b-4f49-ae8f-e6b041a6442d%40googlegroups.com
 https://groups.google.com/d/msgid/mobile-couchbase/bb6e8868-ec0b-4f49-ae8f-e6b041a6442d%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.

  --
 You received this message because you are subscribed to a topic in the
 Google Groups Couchbase Mobile group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/mobile-couchbase/Mo2qhdCg8gQ/unsubscribe
 .
 To unsubscribe from this group and all its topics, send an email to
 mobile-couchbase+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/mobile-couchbase/A701FF62-7502-484D-BACD-DE389B309B27%40couchbase.com
 https://groups.google.com/d/msgid/mobile-couchbase/A701FF62-7502-484D-BACD-DE389B309B27%40couchbase.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Couchbase Mobile group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mobile-couchbase+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/CABxX_HKmYAahw_S0eiEKYdZkgnQPD6FmwhABzBK-sSE1HM9E_Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: propertynameItemClass in swift

2015-09-16 Thread adam wilson
Thanks, I found the latest release 1.1.1-18 and its working fine now. Also 
heped to look at this project <https://github.com/24601/CBL-Bug-Demo>.


On Wednesday, 16 September 2015 05:41:57 UTC+1, Jens Alfke wrote:
>
>
> On Sep 15, 2015, at 3:30 PM, adam wilson <adam.el...@gmail.com 
> > wrote:
>
> Has there been any progress on this? I'm in the process of building an iOS 
> CBLite app with Swift and hit this issue with CBLModel and @dynamic 
> properties... 
>
>
> Yes, I think this was resolved; I did some work on CBLModel and its base 
> class MYDynamicObject a few months ago to make them work better with Swift. 
> (See issue #648 
> <https://github.com/couchbase/couchbase-lite-ios/issues/648>.) It looks 
> as though this got merged into the 1.1.1 branch, which should be showing up 
> as a release in the next few days.
>
> —Jens
>

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mobile-couchbase+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/38ba3d3f-e839-4c10-baf3-8df2346cf90b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: propertynameItemClass in swift

2015-09-15 Thread adam wilson
Has there been any progress on this? I'm in the process of building an iOS 
CBLite app with Swift and hit this issue with CBLModel and @dynamic 
properties... 
Or do the model classes still need to be Objective-C?

On Tuesday, 4 November 2014 05:48:43 UTC, Jens Alfke wrote:
>
> Thanks for the test case, Julian. You may be in *terra incognita* here — 
> I haven't had a chance to get too far into Swift coding yet and haven't 
> looked into how it interacts with CBLModel. I think my colleague Pasin is 
> starting to investigate (he's the one who added the Swift code samples to 
> the documentation recently.)
>
> If you're building CBL from source and can step through its code, the next 
> step is probably to set a breakpoint in 
> +[CBLModel impForGetterOfProperty:ofClass:]. This will get called once for 
> every dynamic property, so when it's called for itemArray you can step 
> through it and see what goes wrong.
>
> —Jens
>

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mobile-couchbase+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/0a4fe9e2-35f4-4392-bada-4bbdc15b486a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Number of documents replicated less than those reported by Sync Gateway

2017-12-08 Thread Adam Wilson
Thanks, thats a good idea to diff for the missing ones. I just wondered if 
its behaviour thats been seen before. 
The sync function:

function(doc) { 
  if (doc.category == "free") channel("free")
  channel(doc.wordlist);  // This is the part that I expect to replicate 
the same docs as the SG view.
}

To answer your other question, the number of missing docs *seems* to be 
different each time. More investigation needed.. 


On Thursday, 7 December 2017 21:38:51 UTC, Traun Leyden wrote:
>
>
> It's hard to speculate without knowing more about your setup.  For 
> example, depending on your sync function, certain docs might not replicate 
> down to the device, but still be available via the SG view.
>
> Does it appear sporadic or is it the same behavior each time?
>
> Also, you might try getting the doc id's, sorting them, and then diffing 
> them to find the "missing" docs, which might provide some clues.
>
>
> On Wednesday, December 6, 2017 at 2:31:08 PM UTC-8, Adam Wilson wrote:
>>
>> Following on from 
>> https://forums.couchbase.com/t/sync-replication-progress/14987
>>
>> I have a view on Sync Gateway that counts the number of documents in a 
>> view. This view is basically the same as a channel I have defined. I have 
>> also defined the same view in Couchbase Lite (iOS, v1.4). I am monitoring 
>> progress of very large pull replications by first calling the SG view, and 
>> then calling the same view on CBL whenever there is a pull event, to update 
>> a progress meter. 
>>
>> I am seeing slight differences in the amount of documents reported by SG 
>> and those reported when the replication completes. e.g. 36711 from SG 
>> and 36691 from CBL, another example: 36700 reported by SG, 36697 by CBL. 
>> It seems to be slightly different each time. 
>>
>> I'm wondering if this is an issue with the replicator not getting all the 
>> documents? Or maybe the SG view counting deleted documents? 
>>
>> The view:
>> "wordlist_count": {
>>   "map": "function(doc) { if (doc.wordlist)  emit(doc.wordlist, 
>> null) }",
>>   "reduce" : "_count"
>> }
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mobile-couchbase+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/95c7b09a-1610-4f8b-9633-1facaf5d8945%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Updating document via Sync Gateway removes attachments

2017-12-07 Thread Adam Wilson
I've found that I need to re-insert attachments after a document update 
(via PUT). Is this normal? 
I'm sure the docs say that attachments are not affected by updates.


-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mobile-couchbase+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/439099de-c3d2-4625-b814-67f4ac0c4362%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Number of documents replicated less than those reported by Sync Gateway

2017-12-06 Thread Adam Wilson
Following on 
from https://forums.couchbase.com/t/sync-replication-progress/14987

I have a view on Sync Gateway that counts the number of documents in a 
view. This view is basically the same as a channel I have defined. I have 
also defined the same view in Couchbase Lite (iOS, v1.4). I am monitoring 
progress of very large pull replications by first calling the SG view, and 
then calling the same view on CBL whenever there is a pull event, to update 
a progress meter. 

I am seeing slight differences in the amount of documents reported by SG 
and those reported when the replication completes. e.g. 36711 from SG 
and 36691 from CBL, another example: 36700 reported by SG, 36697 by CBL. It 
seems to be slightly different each time. 

I'm wondering if this is an issue with the replicator not getting all the 
documents? Or maybe the SG view counting deleted documents? 

The view:
"wordlist_count": {
  "map": "function(doc) { if (doc.wordlist)  emit(doc.wordlist, null) }"
,
  "reduce" : "_count"
}

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mobile-couchbase+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/97670898-e6d2-4f5a-9d44-d3c207690187%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


LiteCore and IPFS

2017-10-20 Thread Adam Wilson
Continuing on 
from https://github.com/couchbase/couchbase-lite-core/issues/274

I have been thinking about this, and I think it would be a great asset to 
be able to use IPFS and its "Merkle DAG" storage as a remote data store for 
LiteCore. I have been reading around, and to answer your previous questions 
Jens:
"how does it manage mutable data?" - you can use IPNS to store mutable 
data, as a "peer ID". This would be equivalent to a document ID. 
 "Does it have a notion of a revision ID? Or I guess the hash of the data 
may form the revision ID, in which case there's a different identifier for 
the document itself?" - As far as I can tell, the hash is the link to 
the immutable data, so similar to the revision ID in CouchDB. In terms of 
the "document itself", I think that can be referenced with a CRDT structure 
and/or IPNS (I'm still wrapping my head round all this stuff). 

There are a few projects building LevelDB compatible layers on top of IPFS, 
so a CouchDB / LiteCore compatible layer should be feasible. (Most of the 
projects are written in Javascript, or Go).

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mobile-couchbase+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/acea2e3f-9c88-4d3a-95d8-689959df6003%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 'c4Internal::Database' has protected destructor

2018-05-27 Thread Adam Wilson
Looking into the library code a bit more, I realised I just need to use the 
C4Database subclass. 
 
On Sunday, 27 May 2018 10:07:55 UTC+1, Adam Wilson wrote:
>
> I'm using LiteCoreStatic lib in a C++ project, and hit this compilation 
> error: 
>
> 'c4Internal::Database' has protected destructor
>
> My sample code:
>
> #include "Database.hh"
>
> static const C4DatabaseConfig kDBConfig = {
> .flags = (kC4DB_Create | kC4DB_AutoCompact | kC4DB_SharedKeys),
> .storageEngine = kC4SQLiteStorageEngine,
> .versioning = kC4RevisionTrees,
> };
>
>
>
> //==
> int main (int argc, char* argv[])
> {
> Database db ("./c4db/db", kDBConfig);
>
> db.putRawDocument("test", slice("myKey"), slice(""), 
> slice("goldenRatio") );
>
> Record record = db.getRawDocument("test", slice("myKey"));
> std::cout << record.key().asString() << ":" << 
> record.body().asString();
> }
>
> Should I be instantiating the Database class differently?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mobile-couchbase+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/fef372e4-87c6-4055-bd68-48c559261047%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


'c4Internal::Database' has protected destructor

2018-05-27 Thread Adam Wilson
I'm using LiteCoreStatic lib in a C++ project, and hit this compilation 
error: 

'c4Internal::Database' has protected destructor

My sample code:

#include "Database.hh"

static const C4DatabaseConfig kDBConfig = {
.flags = (kC4DB_Create | kC4DB_AutoCompact | kC4DB_SharedKeys),
.storageEngine = kC4SQLiteStorageEngine,
.versioning = kC4RevisionTrees,
};


//==
int main (int argc, char* argv[])
{
Database db ("./c4db/db", kDBConfig);

db.putRawDocument("test", slice("myKey"), slice(""), 
slice("goldenRatio") );

Record record = db.getRawDocument("test", slice("myKey"));
std::cout << record.key().asString() << ":" << record.body().asString();
}

Should I be instantiating the Database class differently?

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mobile-couchbase+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/2013e469-2e7d-435a-9851-bd4606e63d4c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Getting notifications when run on background thread

2017-12-29 Thread Adam Wilson


I've added an option to a library 
 I'm using to replicate 
on a background thread.  

The relevant code:

[manager backgroundTellDatabaseNamed:databaseLocal to:^(CBLDatabase *bgdb)
{
 NSLog(@"Starting pull on background thread...");
 // Inside this block we can't use `db`; instead use the instance given (`bgdb`)
 [self startPull:bgdb
 withRemoteUrl:remoteUrl
 withRemoteUser:remoteUser
 withRemotePassword:remotePassword
 withEvents:events
 withOptions:options];

 // Required in order to listen to events
 [[NSRunLoop currentRunLoop] run];
}];

`startPull` contains:


CBLReplication* pull = [db createPullReplication: url];//...
[pulls setObject:pull forKey:db.name];
// Add the events handler.
if (events) {
 [[NSNotificationCenter defaultCenter] addObserver:self 
selector:@selector(handleReplicationEvent:) 
name:kCBLReplicationChangeNotification object:pull];
}
[pull start];


(Full code is here 
)


The notifications work fine when the method is called from outside the 
backgroundTellDatabaseNamed block. I add the `[[NSRunLoop currentRunLoop] run]` 
line but that does not seem to have got it working. 


Anything I've missed or need to consider to get notifications when replicating 
in the backgroundTellDatabaseNamed block?


-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mobile-couchbase+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/0765bddd-d087-48de-81a6-15f0f1683519%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: LiteCore and IPFS

2018-02-13 Thread Adam Wilson


Bringing this topic back up here. 

I'm thinking about a custom replicator that would talk to IPFS instead of 
Sync Gateway/CouchDB.

What would be needed for this to be implemented? Ideally in a way that 
could be read in from a web app also. I've been following developments at 
OrbitDB <https://github.com/orbitdb/orbit-db/issues/4> to get some ideas, 
most recently a plugin that replicates from OrbitDB (IPFS based DB) to 
PouchDB: https://github.com/garbados/pouchdb-orbit

My understanding of replication is its simply reading in and applying the 
changes feed and then, dealing with conflicts (the complicated part I 
guess).


Any pointers would be much appreciated, thanks. 

On Saturday, 21 October 2017 00:46:48 UTC+1, Adam Wilson wrote:
>
> Continuing on from 
> https://github.com/couchbase/couchbase-lite-core/issues/274
>
> I have been thinking about this, and I think it would be a great asset to 
> be able to use IPFS and its "Merkle DAG" storage as a remote data store for 
> LiteCore. I have been reading around, and to answer your previous questions 
> Jens:
> "how does it manage mutable data?" - you can use IPNS to store mutable 
> data, as a "peer ID". This would be equivalent to a document ID. 
>  "Does it have a notion of a revision ID? Or I guess the hash of the data 
> may form the revision ID, in which case there's a different identifier for 
> the document itself?" - As far as I can tell, the hash is the link to 
> the immutable data, so similar to the revision ID in CouchDB. In terms of 
> the "document itself", I think that can be referenced with a CRDT structure 
> and/or IPNS (I'm still wrapping my head round all this stuff). 
>
> There are a few projects building LevelDB compatible layers on top of 
> IPFS, so a CouchDB / LiteCore compatible layer should be feasible. (Most of 
> the projects are written in Javascript, or Go).
>

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mobile-couchbase+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/eb377b75-9df5-4b3a-b147-056a9b31b89d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


LiteCore as server?

2018-02-14 Thread Adam Wilson
After a little clarfification in this thread on peer to peer replication 
, 
I have some questions regarding the use of LiteCore as a "server":


   1. Would it still be possible to authenticate a user and only replicate 
   "their" documents when doing a pull replication?
   2. Would there be any disadvantages of doing it this way rather than 
   using SG 2.0 and Couchbase Server?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mobile-couchbase+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/46394357-3844-4700-9d09-44080c48e132%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Getting notifications when run on background thread

2018-01-02 Thread Adam Wilson
Thanks Jens,

Good to know. The issue I have is that the UI is getting blocked during 
very large replications (iOS). 30,000 documents each with a small binary 
attachment. The UI freezes/slows even on the simulator. Is there a way 
around this? Can the replication run on a lower priority thread? 


On Tuesday, 2 January 2018 17:52:37 UTC, Jens Alfke wrote:
>
>
>
> On Dec 29, 2017, at 7:40 AM, Adam Wilson <adam.el...@gmail.com 
> > wrote:
>
> I've added an option to a library 
> <https://github.com/adamski/react-native-couchbase> I'm using to 
> replicate on a background thread.  
>
>
> This isn’t necessary: replication already runs on a background thread. The 
> CBLReplication class just sends messages to the background replicator and 
> relays notifications from it, so all CBLReplication methods return 
> immediately.
>
> TL;DR: Just use CBLReplication on the main database; it’s asynchronous and 
> won’t block your main thread.
>
> There are a couple problems with the code you showed.
>
>- Using CBLReplication inside the background block probably won’t 
>work, basically because the background database (`bgdb`) is itself the 
>database instance that runs the real replicator work. Trying to predict 
>what would happen is making my head hurt; simpler just to say Don’t do 
> that.
>- The call to `[[NSRunLoop currentRunLoop] run]` will block forever, 
>preventing the background database from handling any more requests. Don’t 
>do that either :)
>
>
> —Jens
>

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mobile-couchbase+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/dd9d0eeb-d600-4a8b-bdd6-152697ffc322%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Getting notifications when run on background thread

2018-01-02 Thread adam wilson
Thanks, that makes sense, I do have observers running, and they are sending
messages across the JS/native border in a React Native app, which is
notoriously expensive. I'll take a look.

On 2 January 2018 at 22:47, Jens Alfke <j...@couchbase.com> wrote:

>
>
> On Jan 2, 2018, at 1:14 PM, Adam Wilson <adam.elemen...@gmail.com> wrote:
>
> Good to know. The issue I have is that the UI is getting blocked during
> very large replications (iOS). 30,000 documents each with a small binary
> attachment. The UI freezes/slows even on the simulator. Is there a way
> around this? Can the replication run on a lower priority thread?
>
>
> The problem is probably that you have database observers registered that
> are firing for every document received, and the observers are doing
> something expensive enough to cause trouble. Try using Instruments to
> profile the app.
>
> —Jens
>
> Jens Alfke — Mobile Architect — Couchbase, Inc.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Couchbase Mobile" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/mobile-couchbase/0MikI5KM9g4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> mobile-couchbase+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/mobile-couchbase/E7D9D692-CF38-460F-9C3C-
> B94404DBF430%40couchbase.com
> <https://groups.google.com/d/msgid/mobile-couchbase/E7D9D692-CF38-460F-9C3C-B94404DBF430%40couchbase.com?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mobile-couchbase+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/CABxX_H%2BLZqcAUPfPP5iVjnhThOfmcFsn3HkKnrghyrpb_QaVNg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


LiteCore and CouchDB replication

2018-09-01 Thread Adam Wilson

I'm trying to replicate from CouchDB using LiteCore (from C++). I'm linking 
to the static libraries, and using C4CivetWebSocketFactory. 

It looks like its trying to connect via WebSocket and receiving an HTTP 
response. Since CouchDB does not currently support WebSockets, how can I 
get it to fall back to HTTP? (If that is the issue)

Console output below:

01:19:41.614057| [DB]: Opening database ../../../../c4db/db/db.sqlite3
01:19:41.618855| [Sync]: {Repl#1}==> litecore::repl::Replicator 
../../../../c4db/db/ ->http://:5984/mydb
01:19:41.618917| [Sync]: {Repl#1} Push=passive, Pull=one-shot, Options={{}}
01:19:41.628659| [Sync]: {Repl#1} No local checkpoint 
'cp-HdL43k4ltUI/79YYeGCRxvY6KsM='
01:19:41.691422| [WS] WARNING: {C4SocketImpl#1}==> 
litecore::repl::C4SocketImpl http://:5984/mydb
01:19:41.691502| [WS] WARNING: {C4SocketImpl#1} WebSocket closed abnormally 
with status 200
01:19:41.691727| [Sync]: {Repl#1} Connection closed with WebSocket status 
200: "Unexpected response status 200 OK" (state=1)
01:19:41.691790| [Sync] ERROR: {Repl#1} Got LiteCore error: Unexpected 
response status 200 OK (6/200)
01:19:41.691832| [Sync]: {Repl#1} now stopped
01:19:41.692051| [DB]: Closing database ../../../../c4db/db/db.sqlite3


-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mobile-couchbase+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/a77292cd-f166-4126-8a90-25910cef9720%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: LiteCore and CouchDB replication

2018-09-02 Thread Adam Wilson
Yes, looking through the code again, it looks like you might be right. The 
following line in the documentation led me to believe HTTP was also 
supported:
 

>  The WebSocket protocol starts off as an HTTP(s) connection and switches 
> over to Websockets if the remote host supports it.


My question now is, will Couchbase support replication with CouchDB? I do 
not want to have to install Couchbase Server and Sync Gateway on my server. 
It requires a lot of memory (i.e., expensive to run) and is more complex to 
manage than CouchDB. 

If not, I'd like some guidelines on implementing a CouchDB Replicator. 

Another possible option might be to run Sync Gateway with an external 
store, 
https://docs.couchbase.com/sync-gateway/2.1/integrating-external-stores.html
However this requires lots of setting up and is not a clean solution like 
CouchDB. 


On Sunday, 2 September 2018 04:45:27 UTC+1, Brendan Duddridge wrote:
>
> It would be great to be able to sync from CouchbaseLite 2.x to CouchDB. 
> But I don't think they support that.
>
> It's what's keeping me from upgrading to 2.x.
>
> Brendan
>
> On Saturday, September 1, 2018 at 6:32:33 PM UTC-6, Adam Wilson wrote:
>>
>>
>> I'm trying to replicate from CouchDB using LiteCore (from C++). I'm 
>> linking to the static libraries, and using C4CivetWebSocketFactory. 
>>
>> It looks like its trying to connect via WebSocket and receiving an HTTP 
>> response. Since CouchDB does not currently support WebSockets, how can I 
>> get it to fall back to HTTP? (If that is the issue)
>>
>> Console output below:
>>
>> 01:19:41.614057| [DB]: Opening database ../../../../c4db/db/db.sqlite3
>> 01:19:41.618855| [Sync]: {Repl#1}==> litecore::repl::Replicator 
>> ../../../../c4db/db/ ->http://:5984/mydb
>> 01:19:41.618917| [Sync]: {Repl#1} Push=passive, Pull=one-shot, 
>> Options={{}}
>> 01:19:41.628659| [Sync]: {Repl#1} No local checkpoint 
>> 'cp-HdL43k4ltUI/79YYeGCRxvY6KsM='
>> 01:19:41.691422| [WS] WARNING: {C4SocketImpl#1}==> 
>> litecore::repl::C4SocketImpl http://:5984/mydb
>> 01:19:41.691502| [WS] WARNING: {C4SocketImpl#1} WebSocket closed 
>> abnormally with status 200
>> 01:19:41.691727| [Sync]: {Repl#1} Connection closed with WebSocket 
>> status 200: "Unexpected response status 200 OK" (state=1)
>> 01:19:41.691790| [Sync] ERROR: {Repl#1} Got LiteCore error: Unexpected 
>> response status 200 OK (6/200)
>> 01:19:41.691832| [Sync]: {Repl#1} now stopped
>> 01:19:41.692051| [DB]: Closing database ../../../../c4db/db/db.sqlite3
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mobile-couchbase+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/5dcec91f-edb9-4111-8b0d-17e06e6e2246%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: LiteCore and CouchDB replication

2018-09-05 Thread Adam Wilson
Thanks for the information Jens. I understand what you're saying, but for 
some of us the need to run the beast that is Couchbase Server alongside 
Sync Gateway is quite a barrier. Running both services requires at least 
8GB of memory to run reliably, ideally 16GB. A 16GB server costs over $100 
a month to run. For my current project this is simply not feasible. Looks 
like its time to look at alternative options.

On Tuesday, 4 September 2018 19:10:03 UTC+1, Jens Alfke wrote:
>
>
>
> On Sep 2, 2018, at 2:24 AM, Adam Wilson  > wrote:
>
> My question now is, will Couchbase support replication with CouchDB?
>
>
> No, sorry. We used to use the CouchDB protocol mainly for historical 
> reasons. Interop with CouchDB was nice, but it also caused support problems 
> when CouchDB implemented replicator features in ways that were incompatible 
> with ours [and poorly documented…]
>
> In 2.0 we needed to improve replication performance and reliability, and 
> reduce code complexity; and the use of HTTP/REST was a big obstacle to 
> that. WebSockets work a lot better for this purpose.
>
> —Jens
> Privacy Policy <https://www.couchbase.com/privacy-policy> | Update 
> Marketing Preferences 
> <https://info.couchbase.com/unsubscribe-or-manage-preferences> 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mobile-couchbase+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/39284d18-d0aa-4712-8d69-677c47a9f4bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.