{"id":1997,"date":"2015-10-28T02:31:44","date_gmt":"2015-10-28T02:31:43","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=1997"},"modified":"2019-03-04T06:13:47","modified_gmt":"2019-03-04T14:13:47","slug":"couchbase-live-new-york-couchbase-mobile-103-building-a-peer-to-peer-app-with-couchbase-mobile","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/couchbase-live-new-york-couchbase-mobile-103-building-a-peer-to-peer-app-with-couchbase-mobile\/","title":{"rendered":"Couchbase LIVE New York: Couchbase Mobile 103 &#8211; Building a Peer-to-Peer App with Couchbase Mobile"},"content":{"rendered":"<p style=\"text-align: center;\"><a href=\"https:\/\/bit.ly\/CBNYC2015\"><img decoding=\"async\" src=\"\/wp-content\/original-assets\/2015\/october\/couchbase-live-new-york-couchbase-mobile-103---building-a-peer-to-peer-app-with-couchbase-mobile\/events.cbliveny.bannerheader.lockup.png\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">From the 103 session in the <a href=\"https:\/\/bit.ly\/couchbaseNYC01\">Couchbase LIVE New York mobile track<\/a>, we went over the feature within Couchbase Lite that would allow us to enable peer-to-peer syncing between two or more devices.\u00a0 From the <a href=\"https:\/\/www.slideshare.net\/Couchbase\/couchbase-mobile-101-couchbase-live-new-york?\">&#8220;Couchbase Mobile 103: <\/a><a href=\"https:\/\/www.slideshare.net\/Couchbase\/couchbase-mobile-103-building-a-peer-topeer-app-with-couchbase-mobile-couchbase-connect-2015?qid=50d65718-e15f-4427-8051-dbb09b56d8c6&amp;v=default&amp;b=&amp;from_search=1\">Building a Peer-to-Peer App with Couchbase Mobile<\/a><a href=\"https:\/\/www.slideshare.net\/Couchbase\/couchbase-mobile-101-couchbase-live-new-york?\">&#8221; slides<\/a>, we explored in depth the code and components that allowed the photo-sharing application to exchange pictures with another client device running Couchbase Lite through the P2P feature.<\/p>\n<p style=\"text-align: justify;\">The P2P PhotoDrop sample application can be found on the GitHub repo for <a href=\"https:\/\/github.com\/couchbaselabs\/photo-drop\/tree\/master\/ios\">iOS<\/a> and <a href=\"https:\/\/github.com\/couchbaselabs\/photo-drop\/tree\/master\/android\">Android<\/a>.\u00a0 In this blog, we will recap at a high level the Couchbase Lite features and APIs that were presented at the Couchbase 103 session as well as some of the code found in the Photo Sharing sample.\u00a0 You may reference the Couchbase Mobile <a href=\"https:\/\/bit.ly\/CBNYC2015_101\">101<\/a> and <a href=\"https:\/\/bit.ly\/CBNYC2015_102\">102<\/a> blogs for guidance on getting started.<\/p>\n<p style=\"text-align: justify;\"><img decoding=\"async\" src=\"\/wp-content\/original-assets\/2015\/october\/couchbase-live-new-york-couchbase-mobile-103---building-a-peer-to-peer-app-with-couchbase-mobile\/photodrop_screens.png\" \/><\/p>\n<p style=\"text-align: justify;\">Here are the story boards of the application where we have three simple ViewControllers where the ViewController is the entry point to the application.\u00a0 The UX flow begins where the sender will be selecting the photos from the phone and then clicking send.\u00a0 The camera will then open to scan the other phone&#8217;s receiving QR code in order to authenticate and initiate the transfer.\u00a0 Let us walk through the core components of the code for the application that enables peer-to-peer feature from <a href=\"https:\/\/developer.couchbase.com\/documentation\/mobile\/1.1.0\/get-started\/couchbase-lite-overview\/index.html\">Couchbase Lite<\/a>.<\/p>\n<p style=\"text-align: justify;\"><strong>[1] Start Listener<\/strong><\/p>\n<p style=\"text-align: justify;\">In the ReceiveViewController, we set the port to be equal to zero so that we will let Couchbase Lite decide what to use.\u00a0 This means that everytime we want to share the photos, the port will be changing everytime it initiates a transfer.\u00a0 We enable the authentication where the authentication is the digest and supported by Couchbase Lite listener by default.\u00a0 After that we have the username and password and we set the username\/password for authentication.\u00a0 Upon which, we are ready to start the listeners.<\/p>\n<p style=\"text-align: justify;\"><strong>iOS<\/strong><\/p>\n<pre><code class=\"language-swift\">listener = CBLListener(manager: CBLManager.sharedInstance(), port: 0)\r\n\r\nlistener.requiresAuth = true\r\nlet username = secureGenerateKey(NSCharacterSet.URLUserAllowedCharacterSet())\r\nlet password = secureGenerateKey(NSCharacterSet.URLPasswordAllowedCharacterSet())\r\nlistener.setPasswords([username : password])\r\n\r\nvar success = listener.start(&amp;error)\r\n\r\nif (success) {\r\n  syncUrl = genearteSyncURL(listener.URL, username: username, password: password, \r\n  dbName: database.name)\r\n\r\n  startObserveDatabaseChange()\r\n}\r\n<\/code><\/pre>\n<p>Once the listener is started, we generate the sync URL of the URL endpoint to the receiver database by using the listener URL with the username\/password and with the database name.\u00a0 We set the URL into the sync URL variable and we use it later when we generate the QR code from which we then start the database change listeners accordingly.<\/p>\n<p style=\"text-align: justify;\"><strong>[2] Observe Database Changes<\/strong><\/p>\n<p>We start the database change listener so that we know when the photo gets sync to the receiver database.\u00a0 When that happens we get the shared photos from the shared documents and accepts them into the device.<\/p>\n<p style=\"text-align: justify;\"><strong>iOS<\/strong><\/p>\n<pre><code class=\"language-swift\">func startObserveDatabaseChange() {\r\n  NSNotificationCenter.defaultCenter().addObserverForName(\r\n  kCBLDatabaseChangeNotification, object: database, queue: nil) { (notification) -&gt; Void in\r\n   if let changes = notification.userInfo![\"changes\"] as? [CBLDatabaseChange] {\r\n      for change in changes {\r\n        dispatch_async(dispatch_get_main_queue(), {\r\n          self.saveImageFromDocument(change.documentID)\r\n        })\r\n      }\r\n   }\r\n  }\r\n}<\/code><\/pre>\n<p><strong>[3] Generate and Display QR Code<\/strong><\/p>\n<p style=\"text-align: justify;\">For the last step of the ReceiveViewController where once we have the Couchbase Lite listeners, we then setup the database shared listeners and then we have the Sync URL.\u00a0 With the Sync URL, we are able to generate the QR code.\u00a0 In order to do that we use the iOS core image filter.\u00a0 The QR code contains the listener port and bundled username\/password for authentication.<\/p>\n<p style=\"text-align: justify;\"><img decoding=\"async\" src=\"\/wp-content\/original-assets\/2015\/october\/couchbase-live-new-york-couchbase-mobile-103---building-a-peer-to-peer-app-with-couchbase-mobile\/qr-code-content.png\" \/><strong>[4] Scan QR Code<\/strong><\/p>\n<p style=\"text-align: justify;\">Now within the SendViewController, we use the iOS class AVCaptureSession, which is part of the AV Foundation framework with the output type AVMetadataObjectTypeQRCode.\u00a0 This will now allow us to step up the QR code scanner and scan the QR code.<\/p>\n<p><strong>[5] Create Documents<\/strong><\/p>\n<p style=\"text-align: justify;\">Now we iterate on the photos that we want to send to the receivers.\u00a0 For each photo, we create a document and then we attach the photo to the document in order to then save to the database.\u00a0 The last snippet, we will save the document IDs into the docIds variable which is a property that will be used in the following step.<\/p>\n<p><strong>iOS<\/strong><\/p>\n<pre><code class=\"language-swift\">var docIds: [String] = []\r\nfor asset in sharedAssets! {\r\n  \/\/...\r\n  var data = NSData(bytesNoCopy: imageBytes, length: buffered, freeWhenDone: true)\r\n\r\n  let doc = database.createDocument()\r\n  let rev = doc.newRevision()\r\n  rev.setAttachmentNamed(\"photo\", withContentType: \"application\/octet-stream\", content: data)\r\n  let saved = rev.save(&amp;error)\r\n\r\n  if saved != nil {\r\n    docIds.append(doc.documentID)\r\n  }\r\n}\r\n<\/code><\/pre>\n<p><strong>[6] Replicate Documents<\/strong><\/p>\n<p style=\"text-align: justify;\">The last step now that we have the sync URL that we got from the QR code is to replicate the documents accordingly.\u00a0 We have the photo documents from the database and we are ready to replicate from the sender client device to the receiver device.\u00a0 Here we create a push replication with the sync URL where we send the document ID to the replicator so letting the replicator push for the documents of the ID.\u00a0 And as an optional step, we set the states for the replication change listeners to capture the current status.<\/p>\n<p><strong>iOS<\/strong><\/p>\n<pre><code class=\"language-swift\">replicator = database.createPushReplication(url)\r\nreplicator.documentIDs = docIds\r\n\r\nNSNotificationCenter.defaultCenter().addObserverForName(kCBLReplicationChangeNotification, object: replicator, queue: nil) { (notification) -&gt; Void in\r\n  if self.replicator.lastError == nil {\r\n    var totalCount = self.replicator.changesCount\r\n    var completedCount = self.replicator.completedChangesCount\r\n    \r\n    if completedCount &gt; 0 &amp;&amp; completedCount == totalCount {\r\n      self.statusLabel.text = \"Sending Completed\u201d\r\n    }\r\n  } else {\r\n      self.statusLabel.text = \"Sending Abort\"\r\n    }\r\n}\r\n\r\nreplicator.start()\r\n\r\n<\/code><\/pre>\n<p><strong>Summary<\/strong><\/p>\n<p style=\"text-align: justify;\">The key implementation points for the Photodrop applications are that it uses the QR code for peer discovery where we generate a one time user name and password for authentication.\u00a0 The core code for sending\/receiving photos is around 100 lines of code and contains no code that is directly involved in network communication.<\/p>\n<p style=\"text-align: justify;\">\n","protected":false},"excerpt":{"rendered":"<p>From the 103 session in the Couchbase LIVE New York mobile track, we went over the feature within Couchbase Lite that would allow us to enable peer-to-peer syncing between two or more devices.\u00a0 From the &#8220;Couchbase Mobile 103: Building a [&hellip;]<\/p>\n","protected":false},"author":30,"featured_media":13873,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1],"tags":[],"ppma_author":[8983],"class_list":["post-1997","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.8 (Yoast SEO v25.8) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Building a Peer-to-Peer App with Couchbase Mobile<\/title>\n<meta name=\"description\" content=\"Check out the feature within Couchbase Lite that would allow us to enable peer-to-peer syncing between two or more devices.\u00a0\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/couchbase-live-new-york-couchbase-mobile-103-building-a-peer-to-peer-app-with-couchbase-mobile\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Couchbase LIVE New York: Couchbase Mobile 103 - Building a Peer-to-Peer App with Couchbase Mobile\" \/>\n<meta property=\"og:description\" content=\"Check out the feature within Couchbase Lite that would allow us to enable peer-to-peer syncing between two or more devices.\u00a0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/couchbase-live-new-york-couchbase-mobile-103-building-a-peer-to-peer-app-with-couchbase-mobile\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2015-10-28T02:31:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-03-04T14:13:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/11\/couchbase-nosql-dbaas.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1800\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"William Hoang, Mobile Developer Advocate, Couchbase\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"William Hoang, Mobile Developer Advocate, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-live-new-york-couchbase-mobile-103-building-a-peer-to-peer-app-with-couchbase-mobile\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-live-new-york-couchbase-mobile-103-building-a-peer-to-peer-app-with-couchbase-mobile\/\"},\"author\":{\"name\":\"William Hoang, Mobile Developer Advocate, Couchbase\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/425717456c198fdf9aaa5d7a6d42ad32\"},\"headline\":\"Couchbase LIVE New York: Couchbase Mobile 103 &#8211; Building a Peer-to-Peer App with Couchbase Mobile\",\"datePublished\":\"2015-10-28T02:31:43+00:00\",\"dateModified\":\"2019-03-04T14:13:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-live-new-york-couchbase-mobile-103-building-a-peer-to-peer-app-with-couchbase-mobile\/\"},\"wordCount\":761,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-live-new-york-couchbase-mobile-103-building-a-peer-to-peer-app-with-couchbase-mobile\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/couchbase-live-new-york-couchbase-mobile-103-building-a-peer-to-peer-app-with-couchbase-mobile\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-live-new-york-couchbase-mobile-103-building-a-peer-to-peer-app-with-couchbase-mobile\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/couchbase-live-new-york-couchbase-mobile-103-building-a-peer-to-peer-app-with-couchbase-mobile\/\",\"name\":\"Building a Peer-to-Peer App with Couchbase Mobile\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-live-new-york-couchbase-mobile-103-building-a-peer-to-peer-app-with-couchbase-mobile\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-live-new-york-couchbase-mobile-103-building-a-peer-to-peer-app-with-couchbase-mobile\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2015-10-28T02:31:43+00:00\",\"dateModified\":\"2019-03-04T14:13:47+00:00\",\"description\":\"Check out the feature within Couchbase Lite that would allow us to enable peer-to-peer syncing between two or more devices.\u00a0\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-live-new-york-couchbase-mobile-103-building-a-peer-to-peer-app-with-couchbase-mobile\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/couchbase-live-new-york-couchbase-mobile-103-building-a-peer-to-peer-app-with-couchbase-mobile\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-live-new-york-couchbase-mobile-103-building-a-peer-to-peer-app-with-couchbase-mobile\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"width\":1800,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-live-new-york-couchbase-mobile-103-building-a-peer-to-peer-app-with-couchbase-mobile\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Couchbase LIVE New York: Couchbase Mobile 103 &#8211; Building a Peer-to-Peer App with Couchbase Mobile\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"width\":218,\"height\":34,\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/425717456c198fdf9aaa5d7a6d42ad32\",\"name\":\"William Hoang, Mobile Developer Advocate, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/650445f1ea30314c4f3555dd680154f5\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b912c9a97568a859697ee195432d0bd7cc3ed67d720ae2e6588b67313fa49e08?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b912c9a97568a859697ee195432d0bd7cc3ed67d720ae2e6588b67313fa49e08?s=96&d=mm&r=g\",\"caption\":\"William Hoang, Mobile Developer Advocate, Couchbase\"},\"description\":\"William was a Developer Advocate on the Mobile Engineering\/Developer Experience team at Couchbase. His love for coffee and code has transcended him into the world of mobile while appreciating the offline in-person experiences. Prior, William worked on the Developer Relations team over at Twitter, BlackBerry, and Microsoft while also having been a Software Embedded GPS engineer at Research In Motion. William graduated from McGill University in Electrical Software Engineering\",\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/william-hoang\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Building a Peer-to-Peer App with Couchbase Mobile","description":"Check out the feature within Couchbase Lite that would allow us to enable peer-to-peer syncing between two or more devices.\u00a0","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/couchbase-live-new-york-couchbase-mobile-103-building-a-peer-to-peer-app-with-couchbase-mobile\/","og_locale":"en_US","og_type":"article","og_title":"Couchbase LIVE New York: Couchbase Mobile 103 - Building a Peer-to-Peer App with Couchbase Mobile","og_description":"Check out the feature within Couchbase Lite that would allow us to enable peer-to-peer syncing between two or more devices.\u00a0","og_url":"https:\/\/www.couchbase.com\/blog\/couchbase-live-new-york-couchbase-mobile-103-building-a-peer-to-peer-app-with-couchbase-mobile\/","og_site_name":"The Couchbase Blog","article_published_time":"2015-10-28T02:31:43+00:00","article_modified_time":"2019-03-04T14:13:47+00:00","og_image":[{"width":1800,"height":630,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/11\/couchbase-nosql-dbaas.png","type":"image\/png"}],"author":"William Hoang, Mobile Developer Advocate, Couchbase","twitter_card":"summary_large_image","twitter_misc":{"Written by":"William Hoang, Mobile Developer Advocate, Couchbase","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/couchbase-live-new-york-couchbase-mobile-103-building-a-peer-to-peer-app-with-couchbase-mobile\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-live-new-york-couchbase-mobile-103-building-a-peer-to-peer-app-with-couchbase-mobile\/"},"author":{"name":"William Hoang, Mobile Developer Advocate, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/425717456c198fdf9aaa5d7a6d42ad32"},"headline":"Couchbase LIVE New York: Couchbase Mobile 103 &#8211; Building a Peer-to-Peer App with Couchbase Mobile","datePublished":"2015-10-28T02:31:43+00:00","dateModified":"2019-03-04T14:13:47+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-live-new-york-couchbase-mobile-103-building-a-peer-to-peer-app-with-couchbase-mobile\/"},"wordCount":761,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-live-new-york-couchbase-mobile-103-building-a-peer-to-peer-app-with-couchbase-mobile\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/couchbase-live-new-york-couchbase-mobile-103-building-a-peer-to-peer-app-with-couchbase-mobile\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/couchbase-live-new-york-couchbase-mobile-103-building-a-peer-to-peer-app-with-couchbase-mobile\/","url":"https:\/\/www.couchbase.com\/blog\/couchbase-live-new-york-couchbase-mobile-103-building-a-peer-to-peer-app-with-couchbase-mobile\/","name":"Building a Peer-to-Peer App with Couchbase Mobile","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-live-new-york-couchbase-mobile-103-building-a-peer-to-peer-app-with-couchbase-mobile\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-live-new-york-couchbase-mobile-103-building-a-peer-to-peer-app-with-couchbase-mobile\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2015-10-28T02:31:43+00:00","dateModified":"2019-03-04T14:13:47+00:00","description":"Check out the feature within Couchbase Lite that would allow us to enable peer-to-peer syncing between two or more devices.\u00a0","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-live-new-york-couchbase-mobile-103-building-a-peer-to-peer-app-with-couchbase-mobile\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/couchbase-live-new-york-couchbase-mobile-103-building-a-peer-to-peer-app-with-couchbase-mobile\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/couchbase-live-new-york-couchbase-mobile-103-building-a-peer-to-peer-app-with-couchbase-mobile\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","width":1800,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/couchbase-live-new-york-couchbase-mobile-103-building-a-peer-to-peer-app-with-couchbase-mobile\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Couchbase LIVE New York: Couchbase Mobile 103 &#8211; Building a Peer-to-Peer App with Couchbase Mobile"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"The Couchbase Blog","description":"Couchbase, the NoSQL Database","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"The Couchbase Blog","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","width":218,"height":34,"caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/425717456c198fdf9aaa5d7a6d42ad32","name":"William Hoang, Mobile Developer Advocate, Couchbase","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/650445f1ea30314c4f3555dd680154f5","url":"https:\/\/secure.gravatar.com\/avatar\/b912c9a97568a859697ee195432d0bd7cc3ed67d720ae2e6588b67313fa49e08?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b912c9a97568a859697ee195432d0bd7cc3ed67d720ae2e6588b67313fa49e08?s=96&d=mm&r=g","caption":"William Hoang, Mobile Developer Advocate, Couchbase"},"description":"William was a Developer Advocate on the Mobile Engineering\/Developer Experience team at Couchbase. His love for coffee and code has transcended him into the world of mobile while appreciating the offline in-person experiences. Prior, William worked on the Developer Relations team over at Twitter, BlackBerry, and Microsoft while also having been a Software Embedded GPS engineer at Research In Motion. William graduated from McGill University in Electrical Software Engineering","url":"https:\/\/www.couchbase.com\/blog\/author\/william-hoang\/"}]}},"authors":[{"term_id":8983,"user_id":30,"is_guest":0,"slug":"william-hoang","display_name":"William Hoang, Mobile Developer Advocate, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/b912c9a97568a859697ee195432d0bd7cc3ed67d720ae2e6588b67313fa49e08?s=96&d=mm&r=g","author_category":"","last_name":"Hoang","first_name":"William","job_title":"","user_url":"","description":"William was a Developer Advocate on the Mobile Engineering\/Developer Experience team at Couchbase. His love for coffee and code has transcended him into the world of mobile while appreciating the offline in-person experiences. Prior, William worked on the Developer Relations team over at Twitter, BlackBerry, and Microsoft while also having been a Software Embedded GPS engineer at Research In Motion. William graduated from McGill University in Electrical Software Engineering"}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/1997","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/users\/30"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=1997"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/1997\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media\/13873"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media?parent=1997"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=1997"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=1997"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=1997"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}