{"id":2945,"date":"2017-03-13T09:17:26","date_gmt":"2017-03-13T16:17:26","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=2945"},"modified":"2025-06-13T19:58:38","modified_gmt":"2025-06-14T02:58:38","slug":"offline-first-apps-couchbase-sync-gateway","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/pt\/offline-first-apps-couchbase-sync-gateway\/","title":{"rendered":"Aplicativos off-line primeiro com o Couchbase Sync Gateway"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/03\/FullSizeRender.jpg\" alt=\"Rafael Ugolini\" width=\"207\" height=\"276\" \/><\/p>\n<p><em>Rafael Ugolini is a full stack software developer currently working at Famoco in Brussels, Belgium. He has been working with software development for more than 10 years and lately he is focused on designing web solutions and developing using Python and Javascript.\u00a0<\/em><em><a href=\"https:\/\/twitter.com\/rafaelugolini\" target=\"_blank\" rel=\"noopener noreferrer\">Twitter<\/a>,\u00a0<\/em><em><a href=\"https:\/\/www.linkedin.com\/in\/rafaelugolini\" target=\"_blank\" rel=\"noopener noreferrer\">LinkedIn<\/a>,\u00a0<\/em><em><a href=\"https:\/\/github.com\/rafaelugolini\" target=\"_blank\" rel=\"noopener noreferrer\">Github<\/a><\/em><\/p>\n<h2>Introduction<\/h2>\n<p><span style=\"font-weight: 400\">In this article, I\u2019m going to propose an <a href=\"https:\/\/www.couchbase.com\/blog\/offline-first-more-reliable-mobile-apps\/\">offline-first<\/a> development using <a href=\"https:\/\/Couchbase.com\">Couchbase<\/a> as the communication tool between the backend and frontend.<\/span><\/p>\n<p><span style=\"font-weight: 400\">While studying react-redux, something that I really liked is the <a href=\"https:\/\/redux.js.org\/docs\/advanced\/AsyncActions.html\">Async Actions<\/a> pattern where you have:<\/span><br \/>\n<code><\/code><\/p>\n<pre class=\"lang:default decode:true\">{ type: 'FECH_POSTS_REQUEST' }\r\n\r\n{ type: 'FECH_POSTS_FAILURE', error: 'Oops' }\r\n\r\n{ type: 'FECH_POSTS_SUCCESS', response: { ... } }<\/pre>\n<p>After understanding a bit more about Couchbase and <a href=\"https:\/\/developer.couchbase.com\/documentation\/mobile\/current\/guides\/sync-gateway\/index.html\">Couchbase Sync Gateway<\/a>, it seems possible to apply this kind of pattern and let Couchbase deal with all the communication of the App and having a fully functional offline app.This pattern provides a very good user experience because you actually render the page based on the current status of the app.<\/p>\n<h3><span style=\"color: #343e47;font-family: Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size: 50px\">How does it work?<\/span><\/h3>\n<p><img alt=\"\" \/><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2960\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/03\/Screenshot-from-2017-03-13-15-53-52-300x119.png\" alt=\"How does it work \" width=\"517\" height=\"205\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/Screenshot-from-2017-03-13-15-53-52-300x119.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/Screenshot-from-2017-03-13-15-53-52-768x304.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/Screenshot-from-2017-03-13-15-53-52-20x8.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/Screenshot-from-2017-03-13-15-53-52.png 911w\" sizes=\"auto, (max-width: 517px) 100vw, 517px\" \/><\/p>\n<h3>Application<\/h3>\n<p>The application itself never does any call to the backend, the only responsibility it has is to save states and render them, this way it\u2019s possible to have a fully functional app working offline.<\/p>\n<h3>Couchbase Lite\/Sync Gateway<\/h3>\n<p><a href=\"https:\/\/developer.couchbase.com\/documentation\/mobile\/current\/guides\/couchbase-lite\/index.html\">Couchbase Lite<\/a> will be responsible to sync the current state of the App to <a href=\"https:\/\/www.couchbase.com\/developers\/mobile\/\">Couchbase Sync Gateway<\/a> and retrieve new information once the document is updated in the backend.<\/p>\n<h3>Web hooks<\/h3>\n<p>Once Couchbase Sync Gateway receives a document that matches the filter, it will do an HTTP call to the Web App with the document it needs to update.<\/p>\n<h3>Web App<\/h3>\n<p>The Web App can do any kind of update like:<\/p>\n<ul>\n<li>Creating a new Task in a Task Queue<\/li>\n<li>Retrieving data from an external API<\/li>\n<li>Analyze some data\/images (eg: OCR)<\/li>\n<\/ul>\n<h3>Hands On<\/h3>\n<p>To illustrate a bit how this concept works, I develop a simple example that once you save a specific document, the web application will dispatch a task that will get a random Star Wars character and update the document.<\/p>\n<p>You can download all the code necessary to run an example of this <a href=\"https:\/\/github.com\/rafaelugolini\/syncgateway_apiless_example\">solution<\/a>.<\/p>\n<p>The stack is composed by:<\/p>\n<ul>\n<li>Web App &#8211; Flask<\/li>\n<li>Task Queue &#8211; Celery +\u00a0RabbitMQ<\/li>\n<li>Sync Gateway (walrus mode)<\/li>\n<\/ul>\n<p><img alt=\"\" \/>To have it running, simple clone the git repo and run docker-compose:<br \/>\n<code><\/code><\/p>\n<pre class=\"lang:default decode:true\">git clone https:\/\/github.com\/rafaelugolini\/syncgateway_apiless_example\r\n\r\ncd syncgateway_apiless_example\r\n\r\ndocker-compose up<\/pre>\n<p>Data Modeling<\/p>\n<p>In this example, the key <strong>action<\/strong>\u00a0is the primary source of the events, the document must be saved with:<\/p>\n<pre class=\"lang:default decode:true\">{\u00a0\"action\":\u00a0\"person_request\"\u00a0}\r\n\r\n<\/pre>\n<p>To create a document curl, just use the following command<\/p>\n<pre class=\"lang:default decode:true\">curl -H \"Content-Type: application\/json\"\u00a0-X POST -d '{\"action\":\"person_request\"}'\u00a0https:\/\/localhost:4984\/db\/\r\n\r\n<\/pre>\n<p><span style=\"color: #343e47;font-family: Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size: 40px\">Sync Gateway<\/span><\/p>\n<p>In the configuration of the sync gateway, its registered an event handler that every document change with <strong>action == \u201cperson_request\u201d<\/strong>, an API call will be made to the web app.<\/p>\n<pre class=\"lang:default decode:true\">\"event_handlers\":\u00a0{\r\n\r\n\"document_changed\":\u00a0[\r\n\r\n{\"handler\":\u00a0\"webhook\",\r\n\r\n\"url\":\u00a0\"https:\/\/web_service:5000\/person_request\/\",\r\n\r\n\"filter\":\u00a0`function(doc) {\r\n\r\nif\u00a0(doc.action ==\u00a0\"person_request\")\u00a0{\r\n\r\nreturn\u00a0true;\r\n\r\n}\r\n\r\nreturn\u00a0false;\r\n\r\n}`\r\n\r\n}\r\n\r\n]\r\n\r\n}\r\n\r\n<\/pre>\n<h3>Web App<\/h3>\n<p>The web app is a simple Flask API that receives a POST with the information of the document and dispatches a task to Celery.<\/p>\n<p>The task will query a random Star Wars person from <u><a href=\"https:\/\/swapi.co\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/swapi.co\/<\/a><\/u>\u00a0and update the document:<\/p>\n<pre class=\"lang:default decode:true\">{\r\n\r\n\"action\":\u00a0\"person_success\",\r\n\r\n\"gender\":\u00a0\"female\",\r\n\r\n\"height\":\u00a0\"168\",\r\n\r\n\"mass\":\u00a0\"55\",\r\n\r\n\"name\":\u00a0\"Zam Wesell\"\r\n\r\n}\r\n\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #343e47;font-family: Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size: 40px\">Client<\/span><\/p>\n<p><span style=\"font-weight: 400\">I developed a simple pouchdb client that will print all the documents from sync gateway to the console. It basically runs this function every time there is a database change.<\/span><u><\/u><\/p>\n<pre class=\"lang:default decode:true\">const getAllDocs = () =&gt; (\r\n  db.allDocs({\r\n    include_docs: true,\r\n    attachments: true,\r\n  }).then((result) =&gt; {\r\n    console.log('\\x1Bc'); \/\/ this clears the console\r\n    console.log(util.inspect(result.rows, false, null));\r\n  }).catch((err) =&gt; {\r\n    console.log(err);\r\n  })\r\n);\r\n<\/pre>\n<p><span style=\"font-weight: 400\">Y<\/span>ou can get it from this <a href=\"https:\/\/github.com\/rafaelugolini\/syncgateway_offline_first_example\">git repo<\/a>.<\/p>\n<pre class=\"lang:default decode:true\">yarn install\r\nyarn start<\/pre>\n<p>&nbsp;<\/p>\n<p><em>This post was brought to you from the <a href=\"https:\/\/www.couchbase.com\/community\/community-writers-program\/\">Couchbase Community Writing Program<\/a><\/em><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Neste artigo, vou propor um desenvolvimento off-line primeiro usando o Couchbase como a ferramenta de comunica\u00e7\u00e3o entre o backend e o frontend. <\/p>","protected":false},"author":53,"featured_media":13873,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1810,2366],"tags":[1547],"ppma_author":[9026],"class_list":["post-2945","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-couchbase-mobile","category-sync-gateway","tag-offline-first"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Offline-first apps with Couchbase Sync Gateway - The Couchbase Blog<\/title>\n<meta name=\"description\" content=\"The author Rafael Ugolini of this post focuses on an offline-first development using Couchbase as the communication tool between the backend and frontend.\" \/>\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\/pt\/offline-first-apps-couchbase-sync-gateway\/\" \/>\n<meta property=\"og:locale\" content=\"pt_BR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Offline-first apps with Couchbase Sync Gateway\" \/>\n<meta property=\"og:description\" content=\"The author Rafael Ugolini of this post focuses on an offline-first development using Couchbase as the communication tool between the backend and frontend.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/pt\/offline-first-apps-couchbase-sync-gateway\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-03-13T16:17:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T02:58:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/03\/FullSizeRender.jpg\" \/>\n<meta name=\"author\" content=\"Laura Czajkowski, Developer Community Manager, 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=\"Laura Czajkowski, Developer Community Manager, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/offline-first-apps-couchbase-sync-gateway\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/offline-first-apps-couchbase-sync-gateway\\\/\"},\"author\":{\"name\":\"Laura Czajkowski, Developer Community Manager, Couchbase\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/person\\\/5f1a0ece4e644bc8c037686fbc8f3220\"},\"headline\":\"Offline-first apps with Couchbase Sync Gateway\",\"datePublished\":\"2017-03-13T16:17:26+00:00\",\"dateModified\":\"2025-06-14T02:58:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/offline-first-apps-couchbase-sync-gateway\\\/\"},\"wordCount\":529,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/offline-first-apps-couchbase-sync-gateway\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/1\\\/2022\\\/11\\\/couchbase-nosql-dbaas.png\",\"keywords\":[\"offline first\"],\"articleSection\":[\"Couchbase Mobile\",\"Sync Gateway\"],\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/offline-first-apps-couchbase-sync-gateway\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/offline-first-apps-couchbase-sync-gateway\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/offline-first-apps-couchbase-sync-gateway\\\/\",\"name\":\"Offline-first apps with Couchbase Sync Gateway - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/offline-first-apps-couchbase-sync-gateway\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/offline-first-apps-couchbase-sync-gateway\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/1\\\/2022\\\/11\\\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2017-03-13T16:17:26+00:00\",\"dateModified\":\"2025-06-14T02:58:38+00:00\",\"description\":\"The author Rafael Ugolini of this post focuses on an offline-first development using Couchbase as the communication tool between the backend and frontend.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/offline-first-apps-couchbase-sync-gateway\\\/#breadcrumb\"},\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/offline-first-apps-couchbase-sync-gateway\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/offline-first-apps-couchbase-sync-gateway\\\/#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\\\/offline-first-apps-couchbase-sync-gateway\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Offline-first apps with Couchbase Sync Gateway\"}]},{\"@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\":\"pt-BR\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@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\\\/5f1a0ece4e644bc8c037686fbc8f3220\",\"name\":\"Laura Czajkowski, Developer Community Manager, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bc8eebaf25cbe39bc12fd7b1ef92550becc3953ab877a3f0285a59ec2d30b754?s=96&d=mm&r=g9deb07d5daaa00220534c31768bc4409\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bc8eebaf25cbe39bc12fd7b1ef92550becc3953ab877a3f0285a59ec2d30b754?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bc8eebaf25cbe39bc12fd7b1ef92550becc3953ab877a3f0285a59ec2d30b754?s=96&d=mm&r=g\",\"caption\":\"Laura Czajkowski, Developer Community Manager, Couchbase\"},\"description\":\"Laura Czajkowski is the Snr. Developer Community Manager at Couchbase overseeing the community. She\u2019s responsible for our monthly developer newsletter.\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/pt\\\/author\\\/laura-czajkowski\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Offline-first apps with Couchbase Sync Gateway - The Couchbase Blog","description":"O autor desta postagem, Rafael Ugolini, concentra-se em um desenvolvimento off-line primeiro usando o Couchbase como ferramenta de comunica\u00e7\u00e3o entre o backend e o frontend.","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\/pt\/offline-first-apps-couchbase-sync-gateway\/","og_locale":"pt_BR","og_type":"article","og_title":"Offline-first apps with Couchbase Sync Gateway","og_description":"The author Rafael Ugolini of this post focuses on an offline-first development using Couchbase as the communication tool between the backend and frontend.","og_url":"https:\/\/www.couchbase.com\/blog\/pt\/offline-first-apps-couchbase-sync-gateway\/","og_site_name":"The Couchbase Blog","article_published_time":"2017-03-13T16:17:26+00:00","article_modified_time":"2025-06-14T02:58:38+00:00","og_image":[{"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/03\/FullSizeRender.jpg","type":"","width":"","height":""}],"author":"Laura Czajkowski, Developer Community Manager, Couchbase","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Laura Czajkowski, Developer Community Manager, Couchbase","Est. reading time":"4 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/offline-first-apps-couchbase-sync-gateway\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/offline-first-apps-couchbase-sync-gateway\/"},"author":{"name":"Laura Czajkowski, Developer Community Manager, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/5f1a0ece4e644bc8c037686fbc8f3220"},"headline":"Offline-first apps with Couchbase Sync Gateway","datePublished":"2017-03-13T16:17:26+00:00","dateModified":"2025-06-14T02:58:38+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/offline-first-apps-couchbase-sync-gateway\/"},"wordCount":529,"commentCount":1,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/offline-first-apps-couchbase-sync-gateway\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","keywords":["offline first"],"articleSection":["Couchbase Mobile","Sync Gateway"],"inLanguage":"pt-BR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/offline-first-apps-couchbase-sync-gateway\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/offline-first-apps-couchbase-sync-gateway\/","url":"https:\/\/www.couchbase.com\/blog\/offline-first-apps-couchbase-sync-gateway\/","name":"Offline-first apps with Couchbase Sync Gateway - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/offline-first-apps-couchbase-sync-gateway\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/offline-first-apps-couchbase-sync-gateway\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2017-03-13T16:17:26+00:00","dateModified":"2025-06-14T02:58:38+00:00","description":"O autor desta postagem, Rafael Ugolini, concentra-se em um desenvolvimento off-line primeiro usando o Couchbase como ferramenta de comunica\u00e7\u00e3o entre o backend e o frontend.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/offline-first-apps-couchbase-sync-gateway\/#breadcrumb"},"inLanguage":"pt-BR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/offline-first-apps-couchbase-sync-gateway\/"]}]},{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/offline-first-apps-couchbase-sync-gateway\/#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\/offline-first-apps-couchbase-sync-gateway\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Offline-first apps with Couchbase Sync Gateway"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"Blog do Couchbase","description":"Couchbase, o banco de dados NoSQL","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":"pt-BR"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"Blog do Couchbase","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"pt-BR","@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\/5f1a0ece4e644bc8c037686fbc8f3220","name":"Laura Czajkowski, gerente da comunidade de desenvolvedores, Couchbase","image":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/secure.gravatar.com\/avatar\/bc8eebaf25cbe39bc12fd7b1ef92550becc3953ab877a3f0285a59ec2d30b754?s=96&d=mm&r=g9deb07d5daaa00220534c31768bc4409","url":"https:\/\/secure.gravatar.com\/avatar\/bc8eebaf25cbe39bc12fd7b1ef92550becc3953ab877a3f0285a59ec2d30b754?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/bc8eebaf25cbe39bc12fd7b1ef92550becc3953ab877a3f0285a59ec2d30b754?s=96&d=mm&r=g","caption":"Laura Czajkowski, Developer Community Manager, Couchbase"},"description":"Laura Czajkowski \u00e9 a Snr. Developer Community Manager da Couchbase, supervisionando a comunidade. Ela \u00e9 respons\u00e1vel pelo nosso boletim informativo mensal para desenvolvedores.","url":"https:\/\/www.couchbase.com\/blog\/pt\/author\/laura-czajkowski\/"}]}},"acf":[],"authors":[{"term_id":9026,"user_id":53,"is_guest":0,"slug":"laura-czajkowski","display_name":"Laura Czajkowski, Developer Community Manager, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/bc8eebaf25cbe39bc12fd7b1ef92550becc3953ab877a3f0285a59ec2d30b754?s=96&d=mm&r=g","0":null,"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts\/2945","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/users\/53"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/comments?post=2945"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts\/2945\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/media\/13873"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/media?parent=2945"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/categories?post=2945"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/tags?post=2945"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/ppma_author?post=2945"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}