{"id":95,"date":"2012-11-15T09:00:00","date_gmt":"2012-11-15T08:00:00","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/"},"modified":"2012-11-15T09:00:00","modified_gmt":"2012-11-15T08:00:00","slug":"fun-couchbase-and-markov-chains","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/pt\/fun-couchbase-and-markov-chains\/","title":{"rendered":"Fun with Couchbase and Markov Chains"},"content":{"rendered":"\n<p>I\u2019ve been hearing about <a href=\"https:\/\/en.wikipedia.org\/wiki\/Markov_chain\">Markov chains<\/a> for long enough \u2013 it was time that I learned more about them and develop a simple fun markov chain application. I\u2019m sure that you don\u2019t want to get bogged down by the mathematical details of Markov Chains &#8211; learning by building an application is where all the fun is!<\/p>\n\n\n\n<p>In this blog, we will show how to build an application <strong>\u201cMarky\u201d<\/strong> that uses Markov chains to generate nonsensical tweets based on your twitter history. It uses Couchbase Server to store and process the data to generate these tweets.<\/p>\n\n\n\n<p><strong>Marky uses Couchbase Server <a href=\"https:\/\/www.couchbase.com\/docs\/couchbase-manual-2.0\/couchbase-views.html\">views<\/a> to process data<\/strong><br>Marky\u2019s map function is :<\/p>\n\n\n\n<p><span>function<\/span> <span>(<\/span>doc<span>,<\/span> meta<span>)<\/span> <span>{<\/span><br>\u00a0 \u00a0<span>if<\/span><span>(<\/span>doc.<span>body<\/span><span>)<\/span> <span>{<\/span><br>\u00a0 \u00a0 \u00a0 \u00a0<span>var<\/span> words <span>=<\/span> doc.<span>body<\/span>.<span>split<\/span><span>(<\/span><span>\/s+\/<\/span><span>)<\/span><span>;<\/span><br>\u00a0 \u00a0 \u00a0 \u00a0<span>if<\/span> <span>(<\/span>words.<span>length<\/span> <span>&gt;=<\/span> <span>1<\/span><span>)<\/span> <span>{<\/span><br>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0emit<span>(<\/span><span>[<\/span><span>null<\/span><span>,<\/span> words<span>[<\/span><span>0<\/span><span>]<\/span><span>]<\/span><span>,<\/span> <span>1<\/span><span>)<\/span><span>;<\/span><br>\u00a0 \u00a0 \u00a0 \u00a0<span>}<\/span><br>\u00a0 \u00a0 \u00a0 \u00a0<span>for<\/span><span>(<\/span><span>var<\/span> i <span>=<\/span> <span>0<\/span><span>;<\/span> i <span> <span>(<\/span>words.<span>length<\/span> <span>&#8211;<\/span> <span>1<\/span><span>)<\/span><span>;<\/span> i<span>++<\/span><span>)<\/span> <span>{<\/span><br>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span>var<\/span> pair <span>=<\/span> <span>[<\/span>words<span>[<\/span>i<span>]<\/span><span>,<\/span> words<span>[<\/span>i<span>+<\/span><span>1<\/span><span>]<\/span><span>]<\/span><span>;<\/span><br>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0emit<span>(<\/span>pair<span>,<\/span> <span>1<\/span><span>)<\/span><span>;<\/span><br>\u00a0 \u00a0 \u00a0 \u00a0<span>}<\/span><br>\u00a0 \u00a0<span>}<\/span><br><span>}<\/span><\/span><\/p>\n\n\n\n<p>At a high-level, it splits text up into smaller chunks using a sliding window over 2 consecutive words and tries to regroup these chunks in correct order to form sentences based on a statistical weight. In the end, you get some nonsensical text that is fun to read.<\/p>\n\n\n\n<p>For example : Given the input text \u201cIn this blog, we will show you how to build an application\u201d, it will emit the Key,Value pairs &#8211;<\/p>\n\n\n\n<p>Key \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Value\n<\/p>\n\n\n\n<p>[null,&#8221;In&#8221;] \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 1<br>[&#8220;In&#8221;,&#8221;this&#8221;] \u00a0 \u00a0 \u00a0 \u00a0 1<br>[&#8220;this&#8221;,&#8221;blog,&#8221;] \u00a0 \u00a0 \u00a01<br>[&#8220;blog,&#8221;,&#8221;we&#8221;] \u00a0 \u00a0 \u00a0 \u00a01<br>[&#8220;we&#8221;,&#8221;will&#8221;] \u00a0 \u00a0 \u00a0 \u00a0 1<br>[&#8220;will&#8221;,&#8221;show&#8221;] \u00a0 \u00a0 \u00a0 1<br>[&#8220;show&#8221;,&#8221;you&#8221;] \u00a0 \u00a0 \u00a0 \u00a01<br>[&#8220;you&#8221;,&#8221;how&#8221;] \u00a0 \u00a0 \u00a0 \u00a0 1<br>[&#8220;how&#8221;,&#8221;to&#8221;] \u00a0 \u00a0 \u00a0 \u00a0 \u00a01<br>[&#8220;to&#8221;,&#8221;build&#8221;] \u00a0 \u00a0 \u00a0 \u00a01<br>[&#8220;build&#8221;,&#8221;an&#8221;] \u00a0 \u00a0 \u00a0 \u00a01<br>[&#8220;an&#8221;,&#8221;application&#8221;] \u00a01<\/p>\n\n\n\n<p>To generate a word, we query the view using the last word we output. For example, to get candidates for a word to follow \u201cthe\u201d, we use the query parameters startkey=[&#8220;the&#8221;]&amp;endkey=[&#8220;the&#8221;,{}]&amp;group_level=2&amp;reduce=true<\/p>\n\n\n\n<p>This will get all the word pairs we outputted that start with \u201cthe\u201d, group together pairs that are the same, and run the view\u2019s reduce function on each group. Marky uses the built in reduce _sum, which will add together the values it is given. Running this on the database backing dkatz_ebooks yields:<\/p>\n\n\n\n<p>Key \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Value<br>[&#8220;the&#8221;,&#8221;#1&#8243;] \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a01<br>[&#8220;the&#8221;,&#8221;100&#8243;] \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 1<br>[&#8220;the&#8221;,&#8221;2&#8243;] \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 1<br>[&#8220;the&#8221;,&#8221;ability&#8221;] \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 3<br>[&#8220;the&#8221;,&#8221;absolute&#8221;] \u00a0 \u00a0 \u00a0 \u00a0 \u00a01<br>[&#8220;the&#8221;,&#8221;answer&#8221;] \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a01<br>[&#8220;the&#8221;,&#8221;app&#8221;] \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 1<br>[&#8220;the&#8221;,&#8221;application&#8221;] \u00a0 \u00a0 \u00a0 1<br>[&#8220;the&#8221;,&#8221;area,&#8221;] \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 1<br>[&#8220;the&#8221;,&#8221;background.&#8221;] \u00a0 \u00a0 \u00a0 1<\/p>\n\n\n\n<p>To pick the word to output after \u201cthe\u201d, we choose a word that follows it at random, but weight our choice based on the frequency of the word pair appearing in the input. That means we give \u201cability\u201d has a 3\/12 or 25% chance of being chosen here, where the rest of the words each have a 1\/12 chance of being chosen or 8.3%.<\/p>\n\n\n\n<p>Since at the beginning of a sentence, we pair the first word with null (for example: [null, \u201cIn\u201d] in the earlier example), we can do the same query with null to begin a new output and get words likely to start a thought, or tweet, or whatever our input was. We also need to do this if we get unlucky and don\u2019t get any candidate words back from the first view query. This could happen if the word in the query had only ever shown up at the end of the input texts we processed.<\/p>\n\n\n\n<p><strong>Marky Application<\/strong><\/p>\n\n\n\n<p>Marky uses a <a href=\"https:\/\/github.com\/apage43\/cbdrawer\">simple clojure wrapper<\/a> built by the community. To setup marky, create a marky-config.clj file and point it to your Couchbase Server cluster and twitter account. Add some seed data, twitter user accounts or atom feeds and you&#8217;re ready to launch the app.<\/p>\n\n\n\n<p>{:bucket &#8220;default&#8221;<br>:pass &#8220;&#8221;<br>:cburl &#8220;https:\/\/localhost:8091\/&#8221;<br>:twitter {:app-key &#8220;XXXXXXXXX&#8221;<br>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 :app-secret &#8220;XXXXXXXXXX&#8221;<br>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 :user-token &#8220;XXXXXXXX&#8221;<br>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 :user-secret &#8220;XXXXXXXX&#8221;}<br>:jobs<br>[; :period, :after are in seconds, :ttl is in days.<br>\u00a0{:type :twitter :user &#8220;user-handle1&#8221; :period 3600 :ttl 60}<br>\u00a0{:type :twitter :user &#8220;user-handle2&#8221; :period 3600 :ttl 60}<br>\u00a0{:type :send-tweet :period 3600 :after 600}<br>\u00a0{:type :atom :url &#8220;https:\/\/some-domain\/rssfeed.php&#8221; :period 86400 :ttl 60}]}<\/p>\n\n\n\n<p>Here are some fun Marky tweets &#8211;<\/p>\n\n\n\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.couchbase.com\/blog\/sites\/default\/files\/uploads\/all\/Screen%20Shot%202012-11-15%20at%2012.24.14%20PM.png\"><\/p>\n\n\n\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.couchbase.com\/blog\/sites\/default\/files\/uploads\/all\/Screen%20Shot%202012-11-15%20at%2012.36.41%20PM.png\"><\/p>\n\n\n\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.couchbase.com\/blog\/sites\/default\/files\/uploads\/all\/Screen%20Shot%202012-11-15%20at%2012.41.21%20PM.png\"><\/p>\n\n\n\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.couchbase.com\/blog\/sites\/default\/files\/uploads\/all\/Screen%20Shot%202012-11-15%20at%2012.41.46%20PM.png\"><\/p>\n\n\n\n<p>Want To Get Marky?<\/p>\n\n\n\n<p>You can download the Marky source code <a href=\"https:\/\/github.com\/couchbaselabs\/marky\">here<\/a><br>You can also contribute to the clojure wrapper project <a href=\"https:\/\/github.com\/apage43\/cbdrawer\">here<\/a><\/p>\n\n\n\n<p>Have Fun!<\/p>\n\n\n\n<p>&#8212;-<\/p>\n\n\n\n<p>Thanks to Aaron for putting together the code in clojure.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I\u2019ve been hearing about Markov chains for long enough \u2013 it was time that I learned more about them and develop a simple fun markov chain application. I\u2019m sure that you don\u2019t want to get bogged down by the mathematical details of Markov Chains &#8211; learning by building an application is where all the fun [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":18,"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":[10],"class_list":["post-95","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.6 (Yoast SEO v27.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Fun with Couchbase and Markov Chains - The Couchbase Blog<\/title>\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\/fun-couchbase-and-markov-chains\/\" \/>\n<meta property=\"og:locale\" content=\"pt_BR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Fun with Couchbase and Markov Chains\" \/>\n<meta property=\"og:description\" content=\"I\u2019ve been hearing about Markov chains for long enough \u2013 it was time that I learned more about them and develop a simple fun markov chain application. I\u2019m sure that you don\u2019t want to get bogged down by the mathematical details of Markov Chains &#8211; learning by building an application is where all the fun [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/pt\/fun-couchbase-and-markov-chains\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2012-11-15T08:00:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/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=\"The Couchbase Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"The Couchbase Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/fun-couchbase-and-markov-chains\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/fun-couchbase-and-markov-chains\\\/\"},\"author\":{\"name\":\"The Couchbase Team\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/person\\\/764f4a6771ee19bc7af70b70a326fb93\"},\"headline\":\"Fun with Couchbase and Markov Chains\",\"datePublished\":\"2012-11-15T08:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/fun-couchbase-and-markov-chains\\\/\"},\"wordCount\":662,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/fun-couchbase-and-markov-chains\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/05\\\/couchbase-nosql-dbaas.png\",\"articleSection\":[\"Uncategorized\"],\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/fun-couchbase-and-markov-chains\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/fun-couchbase-and-markov-chains\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/fun-couchbase-and-markov-chains\\\/\",\"name\":\"Fun with Couchbase and Markov Chains - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/fun-couchbase-and-markov-chains\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/fun-couchbase-and-markov-chains\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/05\\\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2012-11-15T08:00:00+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/fun-couchbase-and-markov-chains\\\/#breadcrumb\"},\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/fun-couchbase-and-markov-chains\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/fun-couchbase-and-markov-chains\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/05\\\/couchbase-nosql-dbaas.png\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/05\\\/couchbase-nosql-dbaas.png\",\"width\":1800,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/fun-couchbase-and-markov-chains\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Fun with Couchbase and Markov Chains\"}]},{\"@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\\\/sites\\\/5\\\/2026\\\/06\\\/logo.svg\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/06\\\/logo.svg\",\"width\":\"1024\",\"height\":\"1024\",\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/person\\\/764f4a6771ee19bc7af70b70a326fb93\",\"name\":\"The Couchbase Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b4c18c758421903398e84d6c9560f319f39c665798d7d23e6a6f9dff8a8f984e?s=96&d=mm&r=g7befc37d02226b59499817eafdec60c3\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b4c18c758421903398e84d6c9560f319f39c665798d7d23e6a6f9dff8a8f984e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b4c18c758421903398e84d6c9560f319f39c665798d7d23e6a6f9dff8a8f984e?s=96&d=mm&r=g\",\"caption\":\"The Couchbase Team\"},\"description\":\"Jennifer Garcia is a Senior Web Manager at Couchbase Inc. As the website manager, Jennifer has overall responsibility for the website properties including design, implementation, content, and performance.\",\"sameAs\":[\"https:\\\/\\\/www.couchbase.com\"],\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/pt\\\/author\\\/jennifer-garcia\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Fun with Couchbase and Markov Chains - The Couchbase Blog","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\/fun-couchbase-and-markov-chains\/","og_locale":"pt_BR","og_type":"article","og_title":"Fun with Couchbase and Markov Chains","og_description":"I\u2019ve been hearing about Markov chains for long enough \u2013 it was time that I learned more about them and develop a simple fun markov chain application. I\u2019m sure that you don\u2019t want to get bogged down by the mathematical details of Markov Chains &#8211; learning by building an application is where all the fun [&hellip;]","og_url":"https:\/\/www.couchbase.com\/blog\/pt\/fun-couchbase-and-markov-chains\/","og_site_name":"The Couchbase Blog","article_published_time":"2012-11-15T08:00:00+00:00","og_image":[{"width":1800,"height":630,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/couchbase-nosql-dbaas.png","type":"image\/png"}],"author":"The Couchbase Team","twitter_card":"summary_large_image","twitter_misc":{"Written by":"The Couchbase Team","Est. reading time":"3 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/"},"author":{"name":"The Couchbase Team","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/764f4a6771ee19bc7af70b70a326fb93"},"headline":"Fun with Couchbase and Markov Chains","datePublished":"2012-11-15T08:00:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/"},"wordCount":662,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/couchbase-nosql-dbaas.png","articleSection":["Uncategorized"],"inLanguage":"pt-BR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/","url":"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/","name":"Fun with Couchbase and Markov Chains - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/couchbase-nosql-dbaas.png","datePublished":"2012-11-15T08:00:00+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/#breadcrumb"},"inLanguage":"pt-BR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/"]}]},{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/couchbase-nosql-dbaas.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/couchbase-nosql-dbaas.png","width":1800,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Fun with Couchbase and Markov Chains"}]},{"@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\/sites\/5\/2026\/06\/logo.svg","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/06\/logo.svg","width":"1024","height":"1024","caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/764f4a6771ee19bc7af70b70a326fb93","name":"The Couchbase Team","image":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/secure.gravatar.com\/avatar\/b4c18c758421903398e84d6c9560f319f39c665798d7d23e6a6f9dff8a8f984e?s=96&d=mm&r=g7befc37d02226b59499817eafdec60c3","url":"https:\/\/secure.gravatar.com\/avatar\/b4c18c758421903398e84d6c9560f319f39c665798d7d23e6a6f9dff8a8f984e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b4c18c758421903398e84d6c9560f319f39c665798d7d23e6a6f9dff8a8f984e?s=96&d=mm&r=g","caption":"The Couchbase Team"},"description":"Jennifer Garcia is a Senior Web Manager at Couchbase Inc. As the website manager, Jennifer has overall responsibility for the website properties including design, implementation, content, and performance.","sameAs":["https:\/\/www.couchbase.com"],"url":"https:\/\/www.couchbase.com\/blog\/pt\/author\/jennifer-garcia\/"}]}},"acf":[],"authors":[{"term_id":10,"user_id":2,"is_guest":0,"slug":"jennifer-garcia","display_name":"The Couchbase Team","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/?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\/95","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\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/comments?post=95"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts\/95\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/media\/18"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/media?parent=95"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/categories?post=95"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/tags?post=95"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/ppma_author?post=95"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}