{"id":13102,"date":"2022-04-21T12:03:56","date_gmt":"2022-04-21T19:03:56","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=13102"},"modified":"2023-05-22T08:04:40","modified_gmt":"2023-05-22T15:04:40","slug":"building-a-mobile-application-with-couchbase-part-3","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-3\/","title":{"rendered":"Building a Mobile Application with Couchbase \u2013 Part 3"},"content":{"rendered":"<h2><span style=\"font-weight: 400\">Part 3: Adding sync functionality to a centralized server<\/span><\/h2>\n<p><span style=\"font-weight: 400\">This multipart blog will help the reader build an end-to-end mobile application using the industry-leading features of Couchbase Lite.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">A state of the art, end-to-end, scalable and production grade application should include the following features:<\/span><\/p>\n<ol>\n<li style=\"list-style-type: none\">\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">An embedded database to store data locally on-device to reduce network trips to a centralized database for every activity. This goes a long way in improving user experience.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Perform full text searching on the device.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Sync with peer mobile devices and a centralized server.<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><span style=\"font-weight: 400\">This blog post series is divided into four parts:<\/span><\/p>\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\"><a href=\"https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-1\/\" target=\"_blank\" rel=\"noopener\">Part 1<\/a> showcases the process for building a mobile application that leverages CB Lite and uses it as an embedded database to store data.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\"><a href=\"https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-2\/\" target=\"_blank\" rel=\"noopener\">Part 2<\/a> shows how to run Full Text Search (FTS) on the device.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Part 3 introduces syncing with a centralized Couchbase server from edge devices.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Part 4 will demonstrate peer-to-peer syncing between devices.<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">We are building this app on top of <em>Couchbase Server<\/em> and with <em>Couchbase Mobile<\/em> used on the device and for sync management.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Couchbase is an award-winning distributed NoSQL cloud database. It delivers unmatched versatility, performance, scalability, and financial value across cloud, on-premises, hybrid, distributed cloud, and edge computing deployments.<\/span><\/p>\n<p><span style=\"font-weight: 400\">The <strong>Couchbase Mobile<\/strong> portfolio includes:<\/span><\/p>\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">An embedded database for edge devices.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">A high performance Sync Gateway that provides peer-to-peer and centralized server sync features.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Edge datacenters powered by Couchbase Server that can be deployed on the cloud, on-prem or locally.<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3 style=\"margin-bottom: 53.1386px\"><span><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-13103\" style=\"color: #333333;font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size: 19px\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/04\/image1-2-1024x667.png\" alt=\"Diagram of the Couchbase Mobile portfolio\" width=\"900\" height=\"586\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image1-2-1024x667.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image1-2-300x195.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image1-2-768x500.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image1-2-20x13.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image1-2.png 1225w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/span><\/h3>\n<h2><span style=\"font-weight: 400\">Adding the Sync functionality<\/span><\/h2>\n<p><span style=\"font-weight: 400\">The code for this tutorial is available in <\/span><a href=\"https:\/\/github.com\/sandykris123\/couchbasemobile\"><span style=\"font-weight: 400\">my <\/span><i><span style=\"font-weight: 400\">couchbasemobile<\/span><\/i><span style=\"font-weight: 400\"> GitHub repository<\/span><\/a><span style=\"font-weight: 400\">. We are working with the <em>RateIt<\/em> application that is part of the Rateit.zip file, extract its files to a local folder.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Alternatively, you can follow the instructions in this blog series to build the app from scratch.<\/span><\/p>\n<p><span style=\"font-weight: 400\">The app&#8217;s functionality is divided into three parts:<\/span><\/p>\n<ol>\n<li style=\"list-style-type: none\">\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">sending requests<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">receiving requests from others<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">viewing the request you\u2019ve sent<\/span><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<h3><span style=\"font-weight: 400\">Send rating requests<\/span><\/h3>\n<p><span style=\"font-weight: 400\">The app that we build in this tutorial will allow users to send a topical rating request to a person and receive any responses.<\/span><\/p>\n<p><span style=\"font-weight: 400\">A <\/span><i><span style=\"font-weight: 400\">SEND TO<\/span><\/i><span style=\"font-weight: 400\"> field indicates the phone number of the person to whom you want to send the request.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">The <\/span><i><span style=\"font-weight: 400\">Message<\/span><\/i><span style=\"font-weight: 400\"> field indicates what you want them to do with it. In this case, since it is a rating request, I have a predefined message of: \u201cRate 1-5\u201d \u2013 indicating they need to supply a rating when they send the request back.<\/span><\/p>\n<p><span style=\"font-weight: 400\">The <\/span><i><span style=\"font-weight: 400\">Subject<\/span><\/i><span style=\"font-weight: 400\"> field indicates any topic on which you want a rating, for example, it can just be a word or phrase like:<\/span><\/p>\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Actor: Chris Hemsworth<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Book: Pride and Prejudice<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">www.google.com<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">There are not any strict input validations on the fields, but that is something you would do for a production-grade mobile app.<\/span><\/p>\n<p><span style=\"font-weight: 400\">When you click <strong>SEND<\/strong>, a request is sent to the target person.<\/span><\/p>\n<h3><span style=\"font-weight: 400\">Software prerequisites<\/span><\/h3>\n<p><span style=\"font-weight: 400\">In this part of the blog, we require the following software to be installed on a desktop or server that your mobile app will access.<\/span><\/p>\n<p><span style=\"font-weight: 400\"><strong>Couchbase Server<\/strong> \u2013 Install a version on your local laptop or server using <\/span><a href=\"https:\/\/www.couchbase.com\/downloads\/\"><span style=\"font-weight: 400\">this free download link<\/span><\/a><span style=\"font-weight: 400\">. <\/span><span style=\"font-weight: 400\">Once successfully installed you should be able to access the Couchbase console from your browser at <\/span><a href=\"https:\/\/localhost:8091\"><i><span style=\"font-weight: 400\">https:\/\/localhost:8091<\/span><\/i><\/a><span style=\"font-weight: 400\">.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-13105\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/04\/image3-1-1024x583.png\" alt=\"Couchbase Server download page\" width=\"900\" height=\"512\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image3-1-1024x583.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image3-1-300x171.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image3-1-768x437.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image3-1-20x11.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image3-1-1320x752.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image3-1.png 1431w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<p><span style=\"font-weight: 400\"><strong>Sync Gateway Server<\/strong> \u2013 This can be on the same dev machine as Couchbase Server. <\/span><a href=\"https:\/\/www.couchbase.com\/downloads\/\"><span style=\"font-weight: 400\">Download Sync Gateway here<\/span><\/a><span style=\"font-weight: 400\"> and review the <\/span><a href=\"https:\/\/docs.couchbase.com\/sync-gateway\/current\/introduction.html\"><span style=\"font-weight: 400\">documentation here<\/span><\/a><span style=\"font-weight: 400\">. <\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-13104\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/04\/image2-2-1024x561.png\" alt=\"Couchbase Mobile Sync Gateway download page\" width=\"900\" height=\"493\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image2-2-1024x561.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image2-2-300x164.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image2-2-768x421.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image2-2-20x11.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image2-2-1320x724.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image2-2.png 1432w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<p><span style=\"font-weight: 400\">Follow all of the <em>Start Here!<\/em> steps from the documentation, highlighted here in green.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-13116\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/04\/image_2022-04-21_114356367-1024x546.png\" alt=\"Couchbase Sync Gateway setup docs\" width=\"900\" height=\"480\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image_2022-04-21_114356367-1024x546.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image_2022-04-21_114356367-300x160.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image_2022-04-21_114356367-768x409.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image_2022-04-21_114356367-20x11.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image_2022-04-21_114356367.png 1266w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<p><span style=\"font-weight: 400\">To get started, do the following:<\/span><\/p>\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Start Sync Gateway on your laptop.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Complete all steps in the verification section.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Give the user access to all channels with this curl statement:<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre class=\"decode-attributes:false lang:default decode:true\">curl --location --request PUT 'https:\/\/127.0.0.1:4985\/rateit\/_user\/sgwuser1' \\ \r\n  --header 'Authorization: Basic c3luY19nYXRld2F5OnBhc3N3b3Jk' \\\r\n  --header 'Content-Type: application\/json' \\\r\n  --data-raw '{ \"name\": \"sgwuser1\", \"roles\": [\"stdrole\"] ,\"admin_channels\": [\"*\"]}'<\/pre>\n<p>&nbsp;<\/p>\n<h2><span style=\"font-weight: 400\">Introducing the RateIt Mobile Application<\/span><\/h2>\n<p><span style=\"font-weight: 400\">As shown in the previous posts, the main page of the app has three buttons:<\/span><\/p>\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">CLICK TO SEND RATING REQUEST<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">RECEIVED RATING REQUESTS<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">INCOMING RATING REQUESTS<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">We will be adding UI components to let you switch sync on and off, as well as providing a text input for users to identify themselves.<\/span><\/p>\n<p><span style=\"font-weight: 400\">The code files we will be manipulating are <\/span><i><span style=\"font-weight: 400\">mainactivity.java <\/span><\/i><span style=\"font-weight: 400\">and <\/span><i><span style=\"font-weight: 400\">activity_main.xml<\/span><\/i><span style=\"font-weight: 400\">.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Syncing from the mobile device to the centralized server is for apps that need to constantly update a centralized server with any changes from the handheld devices. This syncing will apply those changes to other devices if they also share the same application and centralized database connection.<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><span style=\"font-weight: 400\">Reviewing the server sync code<\/span><\/h2>\n<p><span style=\"font-weight: 400\">Add the following code to <\/span><b>activity_main.xml<\/b><span style=\"font-weight: 400\"> to incorporate the <\/span><i><span style=\"font-weight: 400\">sync <\/span><\/i><span style=\"font-weight: 400\">switch. It is an on\/off switch that lets the user decide when to enable sync.<\/span><\/p>\n<pre class=\"decode-attributes:false lang:xhtml decode:true\">&lt;Switch\r\n\u00a0 \u00a0 android:id=\"@+id\/switch1\"\r\n\u00a0 \u00a0 android:layout_width=\"158dp\"\r\n\u00a0 \u00a0 android:layout_height=\"38dp\"\r\n\u00a0 \u00a0 android:layout_marginStart=\"2dp\"\r\n\u00a0 \u00a0 android:layout_marginTop=\"8dp\"\r\n\u00a0 \u00a0 android:layout_marginEnd=\"2dp\"\r\n\u00a0 \u00a0 android:layout_marginBottom=\"8dp\"\r\n\u00a0 \u00a0 android:background=\"#F44336\"\r\n\u00a0 \u00a0 android:backgroundTint=\"#F44336\"\r\n\u00a0 \u00a0 android:checked=\"false\"\r\n\u00a0 \u00a0 android:switchMinWidth=\"50dp\"\r\n\u00a0 \u00a0 android:switchTextAppearance=\"@style\/TextAppearance.AppCompat.Body2\"\r\n\u00a0 \u00a0 android:text=\"SYNC ON\/OFF\"\r\n\u00a0 \u00a0 android:textColor=\"@color\/black\"\r\n\u00a0 \u00a0 android:textOff=\"OFF\"\r\n\u00a0 \u00a0 android:textOn=\"ON\"\r\n\u00a0 \u00a0 android:textSize=\"16sp\"\r\n\u00a0 \u00a0 android:textStyle=\"bold\"\r\n\u00a0 \u00a0 android:visibility=\"visible\"\r\n\u00a0 \u00a0 app:layout_constraintBottom_toTopOf=\"@+id\/send\"\r\n\u00a0 \u00a0 app:layout_constraintEnd_toEndOf=\"parent\"\r\n\u00a0 \u00a0 app:layout_constraintHorizontal_bias=\"0.0\"\r\n\u00a0 \u00a0 app:layout_constraintStart_toStartOf=\"parent\"\r\n\u00a0 \u00a0 app:layout_constraintTop_toBottomOf=\"@+id\/textView\" \/&gt;<\/pre>\n<p><span style=\"font-weight: 400\">The following XML snippet takes the <\/span><i><span style=\"font-weight: 400\">username <\/span><\/i><span style=\"font-weight: 400\">as input from the user and has a label associated to make it user friendly.<\/span><\/p>\n<pre class=\"decode-attributes:false lang:xhtml decode:true\">&lt;TextView\r\n\u00a0 \u00a0 android:id=\"@+id\/textView5\"\r\n\u00a0 \u00a0 android:layout_width=\"51dp\"\r\n\u00a0 \u00a0 android:layout_height=\"35dp\"\r\n\u00a0 \u00a0 android:layout_marginStart=\"16dp\"\r\n\u00a0 \u00a0 android:layout_marginTop=\"8dp\"\r\n\u00a0 \u00a0 android:background=\"#2196F3\"\r\n\u00a0 \u00a0 android:gravity=\"center\"\r\n\u00a0 \u00a0 android:text=\"USER\"\r\n\u00a0 \u00a0 android:textStyle=\"bold\"\r\n\u00a0 \u00a0 app:layout_constraintStart_toEndOf=\"@+id\/switch1\"\r\n\u00a0 \u00a0 app:layout_constraintTop_toBottomOf=\"@+id\/textView\" \/&gt;\r\n\r\n&lt;EditText\r\n\u00a0 \u00a0 android:id=\"@+id\/username\"\r\n\u00a0 \u00a0 android:layout_width=\"154dp\"\r\n\u00a0 \u00a0 android:layout_height=\"35dp\"\r\n\u00a0 \u00a0 android:layout_marginStart=\"67dp\"\r\n\u00a0 \u00a0 android:layout_marginTop=\"8dp\"\r\n\u00a0 \u00a0 android:background=\"@color\/white\"\r\n\u00a0 \u00a0 android:backgroundTint=\"@color\/white\"\r\n\u00a0 \u00a0 android:ems=\"10\"\r\n\u00a0 \u00a0 android:inputType=\"textPersonName\"\r\n\u00a0 \u00a0 android:text=\"Name\"\r\n\u00a0 \u00a0 app:layout_constraintStart_toStartOf=\"@+id\/textView5\"\r\n\u00a0 \u00a0 app:layout_constraintTop_toBottomOf=\"@+id\/textView\" \/&gt;<\/pre>\n<p><span style=\"font-weight: 400\">The app frontpage will now look like this, note the new components on the top row:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-13108\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/04\/image6-501x1024.png\" alt=\"Couchbase Mobile app with new UI components\" width=\"280\" height=\"573\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image6-501x1024.png 501w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image6-147x300.png 147w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image6-300x613.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image6-10x20.png 10w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image6.png 574w\" sizes=\"auto, (max-width: 280px) 100vw, 280px\" \/><\/p>\n<p><span style=\"font-weight: 400\">We&#8217;ll now update <\/span><b>Mainactivity.java<\/b><span style=\"font-weight: 400\"> in the <\/span><i><span style=\"font-weight: 400\">Java \u2192 com.example.rateit<\/span><\/i><span style=\"font-weight: 400\"> folder with these changes:<\/span><\/p>\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Add code that checks if the <\/span><b>sync <\/b><span style=\"font-weight: 400\">button needs to be toggled.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Also add code to get the input from the <\/span><b>user <\/b><span style=\"font-weight: 400\">input field<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre class=\"decode-attributes:false lang:java decode:true\">Switch toggleBtn = (Switch) findViewById(R.id.switch1);\r\nEditText userid = (EditText) findViewById(R.id.username);\r\nString username = userid.getText().toString();<\/pre>\n<p>&nbsp;<\/p>\n<p><b>\u00a0<\/b><span style=\"font-weight: 400\">Add a listener for the <\/span><b>sync <\/b><span style=\"font-weight: 400\">toggle button that does the following:<\/span><\/p>\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">When the toggle button is changed from <\/span><i><span style=\"font-weight: 400\">ON <\/span><\/i><span style=\"font-weight: 400\">to <\/span><i><span style=\"font-weight: 400\">OFF<\/span><\/i><span style=\"font-weight: 400\">,<\/span> <span style=\"font-weight: 400\">or vice versa, it will listen and act on these changes.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">When the button is turned <\/span><i><span style=\"font-weight: 400\">OFF<\/span><\/i><span style=\"font-weight: 400\">, the replication will stop.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">When the button is set to the <\/span><i><span style=\"font-weight: 400\">ON <\/span><\/i><span style=\"font-weight: 400\">position, replication will start.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">When replication is enabled, we instantiate the replicator config with the local database and provide centralized database details to indicate the source and target for push\/pull replications.<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre class=\"decode-attributes:false lang:java decode:true\">toggleBtn.setOnCheckedChangeListener(newCompoundButton.OnCheckedChangeListener(){\r\n@Override\r\n\u00a0 \u00a0 \u00a0 \u00a0 public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Replicator replicator = null;\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 if(isChecked) {\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 DatabaseConfiguration config = new DatabaseConfiguration();\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 File dbFile = new File(context.getFilesDir() , \"rateitdb\");\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 config.setDirectory(context.getFilesDir().getAbsolutePath());\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Database database = null;\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 try { database = new Database(\"rateitdb\", config); } catch (CouchbaseLiteException e) { e.printStackTrace(); }\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 URI url = null;\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 try {\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 url = new URI(String.format(\"%s\/%s\", \"ws:\/\/10.0.2.2:4984\", \"rateit\"));\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 } catch (URISyntaxException e) {\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 e.printStackTrace();\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }\r\n\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Query query = null;\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 CouchbaseLite.init(context);\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ReplicatorConfiguration replconfig = new ReplicatorConfiguration(database, new URLEndpoint(url));\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 replconfig.setType(ReplicatorType.PUSH_AND_PULL);\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 replconfig.setContinuous(true);\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 replconfig.setAuthenticator(new BasicAuthenticator(\"sgwuser1\", \"password\".toCharArray()));\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 replicator = new Replicator(replconfig);\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 setRepEventMonitor(replicator);\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 replicator.start();\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Log.i(LogDomain.REPLICATOR.name(),\"Enabled replication\");\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 } else {\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 replicator.stop();\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Log.i(LogDomain.REPLICATOR.name(),\"Disabled replication\");\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }\r\n\u00a0 \u00a0 \u00a0 \u00a0 }\r\n\u00a0 \u00a0 });\r\n\u00a0 \u00a0 CouchbaseLite.init(context);\r\n}<\/pre>\n<p><span style=\"font-weight: 400\">Set up the event monitor for replication events:<\/span><\/p>\n<pre class=\"decode-attributes:false lang:java decode:true\">public void setRepEventMonitor(Replicator replicator)\r\n{\r\n\u00a0 \u00a0 ListenerToken token = replicator.addDocumentReplicationListener(replication -&gt; {\r\n\u00a0 \u00a0 \u00a0 \u00a0 for (ReplicatedDocument document : replication.getDocuments()) {\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Log.i(TAG, \"Doc ID: \" + document.getID());\r\n\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 CouchbaseLiteException err = document.getError();\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 if (err != null) {\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \/\/There was an error\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Log.e(TAG, \"Error replicating document: \", err);\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return;\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }\r\n\u00a0 \u00a0 \u00a0 \u00a0 }\r\n\u00a0 \u00a0 });\r\n}<\/pre>\n<p><span style=\"font-weight: 400\">In <\/span><b>Mainactivity.java <\/b><span style=\"font-weight: 400\">we also remove a lot of hardcoded values from the requests records, so we can showcase the records as they would look like for different users.<\/span><\/p>\n<p><span style=\"font-weight: 400\">In the <\/span><i><span style=\"font-weight: 400\">SENDDATA <\/span><\/i><span style=\"font-weight: 400\">function, observe how hardcoded values are replaced by relevant input fields:<\/span><\/p>\n<pre class=\"decode-attributes:false lang:java decode:true \">MutableDocument mutableDoc = new MutableDocument();\r\nmutableDoc.setString(\"type\", \"send\");\r\nmutableDoc.setString(\"sendto\", String.valueOf(sendto));\r\nmutableDoc.setString(\"from\", username);\r\nmutableDoc.setString(\"to\", sendto);\r\nmutableDoc.setString(\"URL\", String.valueOf(URLlink));\r\nmutableDoc.setString(\"rating\", String.valueOf(rating));\r\nmutableDoc.setDate(\"createdAt\", new Date());<\/pre>\n<p><span style=\"font-weight: 400\">In the <\/span><i><span style=\"font-weight: 400\">RECEIVEDATA <\/span><\/i><span style=\"font-weight: 400\">function, we remove the extra write that previously emulated getting a rating request. This is defunct now that we added the <\/span><i><span style=\"font-weight: 400\">USER <\/span><\/i><span style=\"font-weight: 400\">input field that allows us to get the rating\/requests back for the specific user.<\/span><\/p>\n<pre class=\"decode-attributes:false lang:java decode:true \">SearchView search = (SearchView) findViewById(R.id.searchView);\r\nExpression searchExp = FullTextExpression.index(\"descFTSIndex\").match(String.valueOf(search.getQuery())) ;\r\nQuery query = null;\r\nif (search.getQuery().toString().trim().isEmpty()) {\r\n\u00a0 \u00a0 query = (Query) QueryBuilder.select(SelectResult.all()).from(DataSource.database(database))\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 .where(Expression.property(\"to\").equalTo(Expression.string(username))\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 .and(Expression.property(\"type\").equalTo(Expression.string(\"send\"))));\r\n\r\n} else {\r\n\u00a0 \u00a0 query = (Query) QueryBuilder.select(SelectResult.all()).from(DataSource.database(database))\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 .where(Expression.property(\"to\").equalTo(Expression.string(username))\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 .and(Expression.property(\"type\").equalTo(Expression.string(\"send\")))\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 .and(searchExp));\r\n}\r\n\r\nint numrows = query.execute().allResults().size();\r\nToast.makeText(getApplicationContext(), \"num rows:::\"+ numrows , Toast.LENGTH_LONG).show();\r\n\r\ntry {\r\n\u00a0 \u00a0 query.execute().allResults().forEach(result -&gt; {\r\n\u00a0 \u00a0 \u00a0 \u00a0 Dictionary thisDocsProps = result.getDictionary(0);\r\n\u00a0 \u00a0 \u00a0 \u00a0 String from = thisDocsProps.getString(\"from\").trim();\r\n\u00a0 \u00a0 \u00a0 \u00a0 String to = thisDocsProps.getString(\"to\").trim();\r\n\u00a0 \u00a0 \u00a0 \u00a0 String sendto = thisDocsProps.getString(\"sendto\").trim();\r\n\u00a0 \u00a0 \u00a0 \u00a0 String URL = thisDocsProps.getString(\"URL\").trim();\r\n\u00a0 \u00a0 \u00a0 \u00a0 String rating = thisDocsProps.getString(\"rating\").trim();\r\n\u00a0 \u00a0 \u00a0 \u00a0 float ratingstars = thisDocsProps.getFloat(\"ratingstars\");\r\n\u00a0 \u00a0 \u00a0 \u00a0 int stars = (int) ratingstars;\r\n\u00a0 \u00a0 \u00a0 \u00a0 rating = String.valueOf(thisDocsProps.getFloat(\"ratingstars\"));\r\n\r\n\u00a0 \u00a0 \u00a0 \u00a0 userArray.add(new User(username,from, sendto, URL, rating,ratingstars));\r\n\u00a0 \u00a0 });\r\n} catch (CouchbaseLiteException e) {\r\n\u00a0 \u00a0 e.printStackTrace();\r\n}<\/pre>\n<p><span style=\"font-weight: 400\">In the <\/span><i><span style=\"font-weight: 400\">INCOMINGRATINGS <\/span><\/i><span style=\"font-weight: 400\">function, trim the code down to get requests based on <\/span><i><span style=\"font-weight: 400\">username<\/span><\/i><span style=\"font-weight: 400\">:<\/span><\/p>\n<pre class=\"decode-attributes:false lang:java decode:true\">Query query = (Query) QueryBuilder.select(SelectResult.all()).from(DataSource.database(database))\r\n\u00a0 \u00a0 \u00a0 \u00a0 .where(Expression.property(\"from\").equalTo(Expression.string(username))\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 .and(Expression.property(\"type\").equalTo(Expression.string(\"rated\"))));\r\nint numrows = query.execute().allResults().size();\r\nToast.makeText(getApplicationContext(), \"num rows:::\"+ numrows , Toast.LENGTH_LONG).show();\r\n\r\ntry {\r\n\u00a0 \u00a0 query.execute().allResults().forEach(result -&gt; {\r\n\u00a0 \u00a0 \u00a0 \u00a0 Dictionary thisDocsProps = result.getDictionary(0);\r\n\u00a0 \u00a0 \u00a0 \u00a0 String sendto = thisDocsProps.getString(\"sendto\").trim();\r\n\u00a0 \u00a0 \u00a0 \u00a0 String URL = thisDocsProps.getString(\"URL\").trim();\r\n\u00a0 \u00a0 \u00a0 \u00a0 String rating = thisDocsProps.getString(\"rating\").trim();\r\n\u00a0 \u00a0 \u00a0 \u00a0 float ratingstars = thisDocsProps.getFloat(\"ratingstars\");\r\n\u00a0 \u00a0 \u00a0 \u00a0 int stars = (int) ratingstars;\r\n\u00a0 \u00a0 \u00a0 \u00a0 rating = String.valueOf(thisDocsProps.getFloat(\"ratingstars\"));\r\n\u00a0 \u00a0 \u00a0 \u00a0 RatedArray.add(new Rated(sendto, URL, rating));\r\n\u00a0 \u00a0 });\r\n} catch (CouchbaseLiteException e) {\r\n\u00a0 \u00a0 e.printStackTrace();\r\n}<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400\">A few updates are made to the <\/span><b>UserCustomAdapter.java<\/b><span style=\"font-weight: 400\"> and RatedCustomerAdapter.java files as well. For this iteration, we will remove a lot of hardcoded <\/span><i><span style=\"font-weight: 400\">FROM<\/span><\/i><span style=\"font-weight: 400\"> and <\/span><i><span style=\"font-weight: 400\">TO<\/span><\/i><span style=\"font-weight: 400\"> values because we want to showcase the app for two different users. This helps show how the bi-directional sync between the app and the server works.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Similar changes were made to remove hardcoded names and we carry forward the <\/span><i><span style=\"font-weight: 400\">username <\/span><\/i><span style=\"font-weight: 400\">and <\/span><i><span style=\"font-weight: 400\">request <\/span><\/i><span style=\"font-weight: 400\">details from the mainpage of the app.<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><span style=\"font-weight: 400\">Compiling the mobile application code\u00a0<\/span><\/h2>\n<p><span style=\"font-weight: 400\">Once all the code has been updated, click on <\/span><i><span style=\"font-weight: 400\">Build \u2192 ReBuild Project<\/span><\/i><span style=\"font-weight: 400\">, then <\/span><i><span style=\"font-weight: 400\">Build \u2192 Run <\/span><\/i><span style=\"font-weight: 400\">when the rebuild is complete.<\/span><\/p>\n<p><span style=\"font-weight: 400\">You will be asked to choose the emulator the first time you run the app. I created the NEXUS 5X API 25 device and chose that when asked.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">Once the run is complete the main page will look like this:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-13108\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/04\/image6-501x1024.png\" alt=\"Couchbase Mobile app with new UI components\" width=\"501\" height=\"1024\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image6-501x1024.png 501w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image6-147x300.png 147w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image6-300x613.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image6-10x20.png 10w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image6.png 574w\" sizes=\"auto, (max-width: 501px) 100vw, 501px\" \/><\/p>\n<p><span style=\"font-weight: 400\">You have now successfully deployed the code into the emulator of your choice.<\/span><\/p>\n<h3><b>A Quick Test\u00a0<\/b><\/h3>\n<p><span style=\"font-weight: 400\">Let\u2019s create a rating request following these steps:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Turn the <\/span><b>SYNC<\/b><span style=\"font-weight: 400\"> switch on.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Enter the rating request details (target user, message, subject).<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Click on <\/span><i><span style=\"font-weight: 400\">CLICK TO SEND RATING REQUEST<\/span><\/i><span style=\"font-weight: 400\">.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Go the Couchbase Server instance. In my case, it\u2019s my local instance web console. Navigate to <\/span><i><span style=\"font-weight: 400\">Buckets <\/span><\/i><span style=\"font-weight: 400\">and <\/span><i><span style=\"font-weight: 400\">Documents <\/span><\/i><span style=\"font-weight: 400\">and you should see the rating request created on server.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Now put in the user name <\/span><i><span style=\"font-weight: 400\">AlPacino <\/span><\/i><span style=\"font-weight: 400\">and click on <\/span><i><span style=\"font-weight: 400\">RECEIVED RATING REQUESTS<\/span><\/i><span style=\"font-weight: 400\">\u2013you should see the rating request in the <\/span><i><span style=\"font-weight: 400\">RECEIVED <\/span><\/i><span style=\"font-weight: 400\">section ready to be rated. Rate this request.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">When you check the console you will see two JSON documents as shown below.<\/span><\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-13110\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/04\/image8-516x1024.png\" alt=\"Updated mobile app UI\" width=\"250\" height=\"496\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image8-516x1024.png 516w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image8-151x300.png 151w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image8-300x595.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image8-10x20.png 10w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image8.png 604w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-13109\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/04\/image7-1024x744.png\" alt=\"\" width=\"932\" height=\"677\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image7-1024x744.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image7-300x218.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image7-768x558.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image7-20x15.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image7-1320x959.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image7.png 1500w\" sizes=\"auto, (max-width: 932px) 100vw, 932px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-13111\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/04\/image9-509x1024.png\" alt=\"\" width=\"247\" height=\"498\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image9-509x1024.png 509w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image9-149x300.png 149w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image9-300x604.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image9-10x20.png 10w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image9.png 595w\" sizes=\"auto, (max-width: 247px) 100vw, 247px\" \/><\/p>\n<p><span style=\"font-weight: 400\">Observe the two records in the console.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-13112\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/04\/image10-1024x336.png\" alt=\"Coucbase Server console showing JSON documents\" width=\"900\" height=\"295\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image10-1024x336.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image10-300x99.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image10-768x252.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image10-20x7.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image10-1320x434.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image10.png 1431w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><br \/>\n<span style=\"font-weight: 400\">Now let&#8217;s make a change to the rated request by <\/span><i><span style=\"font-weight: 400\">AlPacino <\/span><\/i><span style=\"font-weight: 400\">and change number of stars to <\/span><i><span style=\"font-weight: 400\">2 <\/span><\/i><span style=\"font-weight: 400\">and see if the changes trickle down to the device.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-13114\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/04\/image12-1024x348.png\" alt=\"Couchbase web console for viewing JSON document changes\" width=\"900\" height=\"306\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image12-1024x348.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image12-300x102.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image12-768x261.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image12-20x7.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image12-1320x449.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image12.png 1431w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<p><span style=\"font-weight: 400\">Run the app and pull up <\/span><i><span style=\"font-weight: 400\">INCOMING RATED REQUESTS <\/span><\/i><span style=\"font-weight: 400\">(bottom of screen)<\/span><span style=\"font-weight: 400\"> for <\/span><i><span style=\"font-weight: 400\">TomCruise <\/span><\/i><span style=\"font-weight: 400\">and you will see the change to <\/span><i><span style=\"font-weight: 400\">2 <\/span><\/i><span style=\"font-weight: 400\">stars.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-13115\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/04\/image13-502x1024.png\" alt=\"Updated mobile app screenshot on Couchbase Mobile\" width=\"332\" height=\"677\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image13-502x1024.png 502w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image13-147x300.png 147w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image13-300x611.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image13-10x20.png 10w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image13.png 628w\" sizes=\"auto, (max-width: 332px) 100vw, 332px\" \/><\/p>\n<h2><span style=\"font-weight: 400\">Next steps<\/span><\/h2>\n<p><span style=\"font-weight: 400\">This is part 3 of the blog series Building A Mobile Application with Couchbase. This post showed how to enable device-to-server syncing.<\/span><\/p>\n<p><span style=\"font-weight: 400\">In the next part of the series we show you how to enable peer-to-peer device syncing.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Continue learning by following these resources:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><a href=\"https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-1\/\"><span style=\"font-weight: 400\">Part 1 of series.<\/span><\/a> <a href=\"https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-2\/\"><span style=\"font-weight: 400\">Part 2 of series<\/span><\/a><span style=\"font-weight: 400\">.<\/span><\/li>\n<li style=\"font-weight: 400\"><a href=\"https:\/\/github.com\/sandykris123\/couchbasemobile\"><span style=\"font-weight: 400\">GitHub repository \u2013 including RateIt app project code<\/span><\/a><\/li>\n<li style=\"font-weight: 400\"><a href=\"https:\/\/www.couchbase.com\/products\/mobile\/\"><span style=\"font-weight: 400\">Couchbase Mobile \u2013 product information<\/span><\/a><\/li>\n<li style=\"font-weight: 400\"><a href=\"https:\/\/docs.couchbase.com\/couchbase-lite\/3.0\/android\/quickstart.html\"><span style=\"font-weight: 400\">Couchbase Lite documentation<\/span><\/a><\/li>\n<li style=\"font-weight: 400\"><a href=\"https:\/\/www.couchbase.com\/downloads\/\"><span style=\"font-weight: 400\">Couchbase Server and Sync Gateway download<\/span><\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Part 3: Adding sync functionality to a centralized server This multipart blog will help the reader build an end-to-end mobile application using the industry-leading features of Couchbase Lite.\u00a0 A state of the art, end-to-end, scalable and production grade application should [&hellip;]<\/p>\n","protected":false},"author":66,"featured_media":13117,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[7667,1810,1816,7666,1818,2366],"tags":[9574],"ppma_author":[9038],"class_list":["post-13102","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-couchbase-lite","category-couchbase-mobile","category-couchbase-server","category-edge-computing","category-java","category-sync-gateway","tag-mobile-development"],"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 Mobile Application with Couchbase \u2013 Part 3<\/title>\n<meta name=\"description\" content=\"Build a Java-based mobile app using Couchbase Mobile application design and embedded database. Part three showing device to server sync.\" \/>\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\/building-a-mobile-application-with-couchbase-part-3\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Building a Mobile Application with Couchbase \u2013 Part 3\" \/>\n<meta property=\"og:description\" content=\"Build a Java-based mobile app using Couchbase Mobile application design and embedded database. Part three showing device to server sync.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-3\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2022-04-21T19:03:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-22T15:04:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/04\/couchbase_mobile_app_development-scaled.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1440\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Sandhya Krishnamurthy, Senior Solutions Engineer, 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=\"Sandhya Krishnamurthy, Senior Solutions Engineer, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-3\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-3\/\"},\"author\":{\"name\":\"Sandhya Krishnamurthy, Senior Solutions Engineer, Couchbase\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/2d421ebd7ebf63e5491a9371909ab723\"},\"headline\":\"Building a Mobile Application with Couchbase \u2013 Part 3\",\"datePublished\":\"2022-04-21T19:03:56+00:00\",\"dateModified\":\"2023-05-22T15:04:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-3\/\"},\"wordCount\":1414,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-3\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/couchbase_mobile_app_development-scaled.jpg\",\"keywords\":[\"mobile development\"],\"articleSection\":[\"Couchbase Lite\",\"Couchbase Mobile\",\"Couchbase Server\",\"Edge computing\",\"Java\",\"Sync Gateway\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-3\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-3\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-3\/\",\"name\":\"Building a Mobile Application with Couchbase \u2013 Part 3\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-3\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-3\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/couchbase_mobile_app_development-scaled.jpg\",\"datePublished\":\"2022-04-21T19:03:56+00:00\",\"dateModified\":\"2023-05-22T15:04:40+00:00\",\"description\":\"Build a Java-based mobile app using Couchbase Mobile application design and embedded database. Part three showing device to server sync.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-3\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-3\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-3\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/couchbase_mobile_app_development-scaled.jpg\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/couchbase_mobile_app_development-scaled.jpg\",\"width\":2560,\"height\":1440,\"caption\":\"Couchbase Mobile application development\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-3\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Building a Mobile Application with Couchbase \u2013 Part 3\"}]},{\"@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\/2d421ebd7ebf63e5491a9371909ab723\",\"name\":\"Sandhya Krishnamurthy, Senior Solutions Engineer, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/f4d7b0d0e3660d30cbd035db5621088e\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b2f1ee16accb4f849269e443ba5b34bc512dd5d425b4399779ebbaf3d1154557?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b2f1ee16accb4f849269e443ba5b34bc512dd5d425b4399779ebbaf3d1154557?s=96&d=mm&r=g\",\"caption\":\"Sandhya Krishnamurthy, Senior Solutions Engineer, Couchbase\"},\"description\":\"Sandhya Krishnamurthy is a technologist with a strong database development background and pre-sales experience. She is a part-time artist, part-time singer and full-time mom.\",\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/sandhya-krishnamurthy\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Building a Mobile Application with Couchbase \u2013 Part 3","description":"Build a Java-based mobile app using Couchbase Mobile application design and embedded database. Part three showing device to server sync.","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\/building-a-mobile-application-with-couchbase-part-3\/","og_locale":"en_US","og_type":"article","og_title":"Building a Mobile Application with Couchbase \u2013 Part 3","og_description":"Build a Java-based mobile app using Couchbase Mobile application design and embedded database. Part three showing device to server sync.","og_url":"https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-3\/","og_site_name":"The Couchbase Blog","article_published_time":"2022-04-21T19:03:56+00:00","article_modified_time":"2023-05-22T15:04:40+00:00","og_image":[{"width":2560,"height":1440,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/04\/couchbase_mobile_app_development-scaled.jpg","type":"image\/jpeg"}],"author":"Sandhya Krishnamurthy, Senior Solutions Engineer, Couchbase","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Sandhya Krishnamurthy, Senior Solutions Engineer, Couchbase","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-3\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-3\/"},"author":{"name":"Sandhya Krishnamurthy, Senior Solutions Engineer, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/2d421ebd7ebf63e5491a9371909ab723"},"headline":"Building a Mobile Application with Couchbase \u2013 Part 3","datePublished":"2022-04-21T19:03:56+00:00","dateModified":"2023-05-22T15:04:40+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-3\/"},"wordCount":1414,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-3\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/couchbase_mobile_app_development-scaled.jpg","keywords":["mobile development"],"articleSection":["Couchbase Lite","Couchbase Mobile","Couchbase Server","Edge computing","Java","Sync Gateway"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-3\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-3\/","url":"https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-3\/","name":"Building a Mobile Application with Couchbase \u2013 Part 3","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-3\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-3\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/couchbase_mobile_app_development-scaled.jpg","datePublished":"2022-04-21T19:03:56+00:00","dateModified":"2023-05-22T15:04:40+00:00","description":"Build a Java-based mobile app using Couchbase Mobile application design and embedded database. Part three showing device to server sync.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-3\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-3\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-3\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/couchbase_mobile_app_development-scaled.jpg","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/couchbase_mobile_app_development-scaled.jpg","width":2560,"height":1440,"caption":"Couchbase Mobile application development"},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/building-a-mobile-application-with-couchbase-part-3\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Building a Mobile Application with Couchbase \u2013 Part 3"}]},{"@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\/2d421ebd7ebf63e5491a9371909ab723","name":"Sandhya Krishnamurthy, Senior Solutions Engineer, Couchbase","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/f4d7b0d0e3660d30cbd035db5621088e","url":"https:\/\/secure.gravatar.com\/avatar\/b2f1ee16accb4f849269e443ba5b34bc512dd5d425b4399779ebbaf3d1154557?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b2f1ee16accb4f849269e443ba5b34bc512dd5d425b4399779ebbaf3d1154557?s=96&d=mm&r=g","caption":"Sandhya Krishnamurthy, Senior Solutions Engineer, Couchbase"},"description":"Sandhya Krishnamurthy is a technologist with a strong database development background and pre-sales experience. She is a part-time artist, part-time singer and full-time mom.","url":"https:\/\/www.couchbase.com\/blog\/author\/sandhya-krishnamurthy\/"}]}},"authors":[{"term_id":9038,"user_id":66,"is_guest":0,"slug":"sandhya-krishnamurthy","display_name":"Sandhya Krishnamurthy, Senior Solutions Engineer, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/b155c5b9bb4bc33f88ee8b7a387044ccc4e23146d3058e66ea7c3a82dd1f51c0?s=96&d=mm&r=g","author_category":"","last_name":"Krishnamurthy","first_name":"Sandhya","job_title":"","user_url":"","description":"Sandhya Krishnamurthy is a technologist with a strong database development background and pre-sales experience. She is a part-time artist, part-time singer and full-time mom."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/13102","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\/66"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=13102"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/13102\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media\/13117"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media?parent=13102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=13102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=13102"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=13102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}