couchdb day nyc 2017: replication
TRANSCRIPT
![Page 1: CouchDB Day NYC 2017: Replication](https://reader035.vdocuments.net/reader035/viewer/2022081604/58b897cc1a28ab3e3a8b6f49/html5/thumbnails/1.jpg)
Lab: Replication (30 minutes)
Bradley Holt, Developer AdvocateThursday, February 9, 2017
CouchDB Developer Day
@BradleyHolt
![Page 2: CouchDB Day NYC 2017: Replication](https://reader035.vdocuments.net/reader035/viewer/2022081604/58b897cc1a28ab3e3a8b6f49/html5/thumbnails/2.jpg)
Peer-to-Peer Replication
@BradleyHolt
Cloudant SyncCouchDB PouchDB
CouchDB Replication Protocol
CouchDB
![Page 3: CouchDB Day NYC 2017: Replication](https://reader035.vdocuments.net/reader035/viewer/2022081604/58b897cc1a28ab3e3a8b6f49/html5/thumbnails/3.jpg)
http-console
$ npm install http-console -g
@BradleyHolthttps://github.com/cloudhead/http-console
![Page 4: CouchDB Day NYC 2017: Replication](https://reader035.vdocuments.net/reader035/viewer/2022081604/58b897cc1a28ab3e3a8b6f49/html5/thumbnails/4.jpg)
http-console
$ npm install http-console -g$ http-console 127.0.0.1:5984
@BradleyHolthttps://github.com/cloudhead/http-console
![Page 5: CouchDB Day NYC 2017: Replication](https://reader035.vdocuments.net/reader035/viewer/2022081604/58b897cc1a28ab3e3a8b6f49/html5/thumbnails/5.jpg)
http-console
$ npm install http-console -g$ http-console 127.0.0.1:5984> http-console 0.6.3> Welcome, enter .help if you're lost.> Connecting to 127.0.0.1 on port 5984.
@BradleyHolthttps://github.com/cloudhead/http-console
![Page 7: CouchDB Day NYC 2017: Replication](https://reader035.vdocuments.net/reader035/viewer/2022081604/58b897cc1a28ab3e3a8b6f49/html5/thumbnails/7.jpg)
Connecting to CouchDB 2.0
$ http-console root:[email protected]:5984 --json> http-console 0.6.3> Welcome, enter .help if you're lost.> Connecting to 127.0.0.1 on port 5984.
@BradleyHolt
![Page 8: CouchDB Day NYC 2017: Replication](https://reader035.vdocuments.net/reader035/viewer/2022081604/58b897cc1a28ab3e3a8b6f49/html5/thumbnails/8.jpg)
Connecting to IBM Cloudant
$ http-console https://bradley-holt:[email protected] --json
@BradleyHolt
![Page 9: CouchDB Day NYC 2017: Replication](https://reader035.vdocuments.net/reader035/viewer/2022081604/58b897cc1a28ab3e3a8b6f49/html5/thumbnails/9.jpg)
Connecting to IBM Cloudant
$ http-console https://bradley-holt:[email protected] --json> http-console 0.6.3> Welcome, enter .help if you're lost.> Connecting to bradley-holt.cloudant.com on port 443.
@BradleyHolt
![Page 10: CouchDB Day NYC 2017: Replication](https://reader035.vdocuments.net/reader035/viewer/2022081604/58b897cc1a28ab3e3a8b6f49/html5/thumbnails/10.jpg)
Replication
/>
@BradleyHolt
![Page 11: CouchDB Day NYC 2017: Replication](https://reader035.vdocuments.net/reader035/viewer/2022081604/58b897cc1a28ab3e3a8b6f49/html5/thumbnails/11.jpg)
Replication
/> POST /_replicate
@BradleyHolt
![Page 12: CouchDB Day NYC 2017: Replication](https://reader035.vdocuments.net/reader035/viewer/2022081604/58b897cc1a28ab3e3a8b6f49/html5/thumbnails/12.jpg)
Replication
/> POST /_replicate...
@BradleyHolt
![Page 13: CouchDB Day NYC 2017: Replication](https://reader035.vdocuments.net/reader035/viewer/2022081604/58b897cc1a28ab3e3a8b6f49/html5/thumbnails/13.jpg)
Replication
/> POST /_replicate... { "create_target": true, "source": "https://bradley-holt.cloudant.com/kittens", "target": "kittens" }
@BradleyHolt
![Page 14: CouchDB Day NYC 2017: Replication](https://reader035.vdocuments.net/reader035/viewer/2022081604/58b897cc1a28ab3e3a8b6f49/html5/thumbnails/14.jpg)
Replication
/> POST /_replicate... { "create_target": true, "source": "https://bradley-holt.cloudant.com/kittens", "target": "kittens" }HTTP/1.1 200 OKContent-Type: application/json
{ ok: true, session_id: '9f7bd286a0001ece5bf0bf65dd83c5ab', source_last_seq: '5-g1AAAAFDeJzLYWBgYMlgTmGQT0lKzi9KdUhJMtVLykxPyilN1UvOyS9NScwr0ctLLckBKmRKZEiy____f1YiA6oWQ9xakhyAZFI9SFcGcyJzLpDHbplmZmxkaULYBKIdlscCJBkagBTQov2kuA-i8wBEJ9iNTGA3mhoampmnGBA2JQsA1LtoyA', …}
@BradleyHolt
![Page 15: CouchDB Day NYC 2017: Replication](https://reader035.vdocuments.net/reader035/viewer/2022081604/58b897cc1a28ab3e3a8b6f49/html5/thumbnails/15.jpg)
![Page 16: CouchDB Day NYC 2017: Replication](https://reader035.vdocuments.net/reader035/viewer/2022081604/58b897cc1a28ab3e3a8b6f49/html5/thumbnails/16.jpg)
Try It On Your Own
1. Create database test_1
2. Create database test_2
3. Set up continuous replication from the test_1 database to the test_2 database
4. Create a document in the test_1 database
5. Confirm that the document has been replicated to the test_2 database
6. Delete the test_1 and the test_2 databases
@BradleyHolt
![Page 17: CouchDB Day NYC 2017: Replication](https://reader035.vdocuments.net/reader035/viewer/2022081604/58b897cc1a28ab3e3a8b6f49/html5/thumbnails/17.jpg)
Lab: ReplicationCouchDB Developer Day
@BradleyHolt