{"id":2903,"date":"2017-03-07T06:07:57","date_gmt":"2017-03-07T14:07:57","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=2903"},"modified":"2023-06-19T03:30:27","modified_gmt":"2023-06-19T10:30:27","slug":"service-discovery-java-database-dcos","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/service-discovery-java-database-dcos\/","title":{"rendered":"Service Discovery With Java and Database Application in DC\/OS"},"content":{"rendered":"<p>This blog will show how a simple Java application can talk to a database or <a href=\"https:\/\/www.couchbase.com\/blog\/what-is-a-database-as-a-service-dbaas-why-is-it-important\/\">database as a service<\/a> (<a href=\"https:\/\/www.couchbase.com\/products\/cloud\/\">DBaaS<\/a>) using service discovery in DC\/OS.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2913\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/03\/dcos-1024x538-e1488894866397.png\" alt=\"DC\/OS logo\" width=\"711\" height=\"299\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-1024x538-e1488894866397.png 711w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-1024x538-e1488894866397-300x126.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-1024x538-e1488894866397-20x8.png 20w\" sizes=\"auto, (max-width: 711px) 100vw, 711px\" \/><\/p>\n<h2>Why Service Discovery?<\/h2>\n<p>An application typically consist of\u00a0multiple\u00a0components\u00a0such as an application server, a database, a web server, caching\u00a0and messaging server.\u00a0Typically, multiple replicas\u00a0of each\u00a0component would run based upon the needs of your application.\u00a0Deploying this application using a container orchestration framework\u00a0means that each replica\u00a0would run as a container. So, an application is\u00a0typically deployed as multi-container application.<\/p>\n<p>Each container is assigned a\u00a0unique IP address for its lifetime. But containers are ephemeral\u00a0and\u00a0may terminate and rescheduled on a different host by the orchestration framework. A container is typically assigned a different IP address in that case. This means\u00a0an\u00a0application deployed in application server cannot rely upon the IP address of the database. This is where service discovery is\u00a0required.<\/p>\n<p>So,\u00a0multiple replicas\u00a0of\u00a0a component are assigned\u00a0a logical name. For example, <code>web<\/code> for all the application server containers and <code>db<\/code> for all the database containers.\u00a0Now, an application can talk to the database\u00a0containers using the\u00a0logical service name. This allows the\u00a0database containers\u00a0to be rescheduled anywhere in the cluster, and also scale up and down dynamically.<\/p>\n<p>Let&#8217;s see how this can be accomplished in DC\/OS with a single instance of application server and database server.\u00a0This blog will use WildFly for application server and Couchbase for database.<\/p>\n<p><a href=\"https:\/\/www.couchbase.com\/blog\/couchbase-cluster-mesos-dcos\/\">Couchbase Cluster on Mesos with DC\/OS<\/a> provide more details on how to setup a <a href=\"https:\/\/docs.couchbase.com\/home\/server.html\">Couchbase<\/a> cluster on DC\/OS.<\/p>\n<p>This blog will use the following\u00a0main\u00a0steps:<\/p>\n<ul>\n<li>Setup\u00a0DC\/OS\u00a0Cluster<\/li>\n<li>Marathon application definition<\/li>\n<li>Deploy the application<\/li>\n<\/ul>\n<p>The complete source code used in this blog is at\u00a0<a href=\"https:\/\/github.com\/arun-gupta\/dcos-java-database\">github.com\/arun-gupta\/dcos-java-database<\/a>.<\/p>\n<p>Many thanks to <a href=\"https:\/\/twitter.com\/unterstein\">@unterstein<\/a> for creating the Maven plugin and helping me understand\u00a0the inner workings of DC\/OS.<\/p>\n<h2>Setup DC\/OS\u00a0Cluster<\/h2>\n<p>DC\/OS cluster can be easily created using the <a href=\"https:\/\/downloads.dcos.io\/dcos\/stable\/aws.html?_ga=1.207445715.1510362819.1478208859\">CloudFormation template<\/a>.\u00a0Detailed instructions, including system requirements and screenshots and setup, are available at Installing DC\/OS on AWS.<\/p>\n<p>CloudFormation output looks as shown:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-2904\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/03\/dcos-cluster-cloudformation-output-1024x470.png\" alt=\"DC\/OS Cluster CloudFormation Output\" width=\"900\" height=\"413\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-cloudformation-output-1024x470.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-cloudformation-output-300x138.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-cloudformation-output-768x353.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-cloudformation-output-1536x706.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-cloudformation-output-20x9.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-cloudformation-output-1320x606.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-cloudformation-output.png 1850w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<p>Note down the value shown for the keys <code>DnsAddress<\/code> and <code>PublicSlaveDnsAddress<\/code>. The value of the first key can be used to access DC\/OS GUI\u00a0and looks like:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-2905\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/03\/dcos-cluster-console-default-output-1024x624.png\" alt=\"DC\/OS Cluster Console Default Output\" width=\"900\" height=\"548\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-console-default-output-1024x624.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-console-default-output-300x183.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-console-default-output-768x468.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-console-default-output-1536x936.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-console-default-output-20x12.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-console-default-output-1320x804.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-console-default-output.png 2048w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<p>Configure DC\/OS CLI\u00a0as explained in CLI.\u00a0In short, the following commands are used:<\/p>\n<ul>\n<li><code>dcos config set core.dcos_url https:\/\/${DnsAddress}<\/code> Replace <code>${DnsAddress}<\/code> with the corresponding value from the CloudFormation output.<\/li>\n<li><code>dcos auth login<\/code><\/li>\n<li><code>dcos config show core.dcos_acs_token<\/code>. If not already done, clone the repo from\u00a0<a href=\"https:\/\/github.com\/arun-gupta\/dcos-java-database\">github.com\/arun-gupta\/dcos-java-database<\/a>.\u00a0Create a new file<code>.dcos-token<\/code>\u00a0and copy the output from the command\u00a0in this file.<\/li>\n<li><code>dcos package install marathon-lb<\/code><\/li>\n<\/ul>\n<h2>Marathon Application Definition<\/h2>\n<p>Marathon framework is used to\u00a0schedule containers in DC\/OS. A\u00a0marathon application can be defined by providing an application definition.<\/p>\n<p>As mentioned earlier, this blog will show how\u00a0a simple Java application can\u00a0talk to a database. We&#8217;ll use a Java EE application deployed in WildFly and use Couchbase as the database.\u00a0The application definition looks like:<\/p>\n<pre class=\"lang:default decode:true\">{  \r\n  \"id\":\"\/webapp\",\r\n  \"apps\":[  \r\n    {  \r\n      \"id\":\"database\",\r\n      \"cpus\":4,\r\n      \"mem\":4096,\r\n      \"instances\":1,\r\n      \"container\":{  \r\n        \"type\":\"DOCKER\",\r\n        \"docker\":{  \r\n          \"image\":\"arungupta\/couchbase:travel\",\r\n          \"network\":\"USER\"\r\n        }\r\n      },\r\n      \"ipAddress\":{  \r\n        \"networkName\":\"dcos\"\r\n      }\r\n    },\r\n    {  \r\n      \"id\":\"web\",\r\n      \"dependencies\":[  \r\n        \"\/webapp\/database\"\r\n      ],\r\n      \"cpus\":2,\r\n      \"mem\":4096,\r\n      \"instances\":1,\r\n      \"container\":{  \r\n        \"type\":\"DOCKER\",\r\n        \"docker\":{  \r\n          \"image\":\"arungupta\/wildfly-couchbase-javaee:travel\",\r\n          \"network\":\"USER\",\r\n          \"portMappings\":[  \r\n            {  \r\n              \"hostPort\":0,\r\n              \"containerPort\":8080,\r\n              \"protocol\":\"tcp\"\r\n            }\r\n          ]\r\n        }\r\n      },\r\n      \"ipAddress\":{  \r\n        \"networkName\":\"dcos\"\r\n      },\r\n      \"env\":{  \r\n        \"COUCHBASE_URI\":\"database-webapp.marathon.containerip.dcos.thisdcos.directory\"\r\n      },\r\n      \"labels\":{  \r\n        \"HAPROXY_0_VHOST\":\"DCOS-PublicSlaveLo-DD2EGGFVCJA0-1604955948.us-west-1.elb.amazonaws.com\",\r\n        \"HAPROXY_GROUP\":\"external\"\r\n      }\r\n    }\r\n  ]\r\n}<\/pre>\n<p>What\u00a0are the key points in this application definition?<\/p>\n<ul>\n<li>Application has two containers: <code>database<\/code> and <code>web<\/code>. The\u00a0web container has a dependency on the database container defined using <code>dependencies<\/code> attribute.<\/li>\n<li><code>database<\/code> container uses <code>arungupta\/couchbase:travel<\/code>\u00a0Docker image. This image is created from\u00a0<a href=\"https:\/\/github.com\/arun-gupta\/couchbase-javaee\/tree\/master\/couchbase\">github.com\/arun-gupta\/couchbase-javaee\/tree\/master\/couchbase<\/a>. It uses Couchbase base image\u00a0and uses\u00a0<a href=\"https:\/\/docs.couchbase.com\/server\/7.0\/rest-api\/rest-endpoints-all.html\">Couchbase REST API<\/a> to pre-configure the database. A sample bucket is also loaded in the database as well.<\/li>\n<li><code>web<\/code> container uses <code>arungupta\/wildfly-couchbase-javaee:travel<\/code> image. This image is created from <a href=\"https:\/\/github.com\/arun-gupta\/couchbase-javaee\/blob\/master\/Dockerfile\">github.com\/arun-gupta\/couchbase-javaee\/blob\/master\/Dockerfile<\/a>. This is a Java EE 7 application bundled in WildFly. The app uses <code>COUCHBASE_URI<\/code> as an environment variable to connect to the Couchbase database. The value of this environment variable is configured to use DNS service discovery and is derived as explained\u00a0in\u00a0Virtual Networks.<\/li>\n<\/ul>\n<p>Make sure to change the value of <code>HAPROXY_0_VHOST<\/code> to match the value of <code>${PublicSlaveDnsAddress}<\/code> from CloudFormation output. The label <code>HAPROXY_0_VHOST<\/code> instructs Marathon-LB to expose the Docker container, the WildFly application server in our case,\u00a0on the external load balancer with a virtual host. The <code>0<\/code> in the label key corresponds to the servicePort index, beginning from 0. If you had multiple servicePort definitions, you would iterate them as 0, 1, 2, and so on. Deploying an internally and externally load-balanced app with marathon-lb\u00a0provide more details about how to configure marathon-lb.<\/p>\n<p>Service Discovery and Load Balancing\u00a0provide more details about service discovery and load balancing in DC\/OS.<\/p>\n<h2>Deploy the\u00a0Application using Maven<\/h2>\n<p>The application can be deployed using\u00a0<a href=\"https:\/\/github.com\/dcos-labs\/dcos-maven-plugin\">dcos-maven-plugin<\/a>.<\/p>\n<p>Plugin looks like:<\/p>\n<pre class=\"lang:xhtml decode:true \">&lt;plugin&gt;\r\n    &lt;groupId&gt;dcos&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;dcos-maven-plugin&lt;\/artifactId&gt;\r\n    &lt;version&gt;0.2&lt;\/version&gt;\r\n    &lt;configuration&gt;\r\n        &lt;dcosUrl&gt;https:\/\/DCOS-ElasticLoadBa-1TH4TXIU5P783-1163025470.us-west-1.elb.amazonaws.com\/&lt;\/dcosUrl&gt;\r\n        &lt;deployable&gt;group&lt;\/deployable&gt;\r\n        &lt;ignoreSslCertificate&gt;true&lt;\/ignoreSslCertificate&gt;\r\n    &lt;\/configuration&gt;\r\n    &lt;executions&gt;\r\n        &lt;execution&gt;\r\n            &lt;id&gt;dcos:deploy&lt;\/id&gt;\r\n            &lt;phase&gt;install&lt;\/phase&gt;\r\n            &lt;goals&gt;\r\n                &lt;goal&gt;deploy&lt;\/goal&gt;\r\n            &lt;\/goals&gt;\r\n        &lt;\/execution&gt;\r\n    &lt;\/executions&gt;\r\n&lt;\/plugin&gt;<\/pre>\n<p>Main points in this fragment are:<\/p>\n<ul>\n<li>Plugin version is 0.2. That indicates the plugin is\u00a0still\u00a0in early stages of development.<\/li>\n<li><code>dcosUrl<\/code> is the value of <code>${DnsAddress}<\/code> key from\u00a0CloudFormation output.\u00a0This address is used for deployment of the application.<\/li>\n<li><code>&lt;deployable&gt;<\/code> element enables different types of deployment &#8211; app, group or pods.\u00a0This element is\u00a0a hint\u00a0for the plugin and should likely go away in a future version as\u00a0Marathon API consolidates. Follow <a href=\"https:\/\/github.com\/dcos-labs\/dcos-maven-plugin\/issues\/11\">#11<\/a> for more details.<\/li>\n<\/ul>\n<p>Other\u00a0details and configuration about the plugin are\u00a0at <a href=\"https:\/\/github.com\/dcos-labs\/dcos-maven-plugin\">dcos-maven-plugin<\/a>.<\/p>\n<p>Deploy the application:<\/p>\n<pre class=\"lang:default decode:true \">mvn install<\/pre>\n<p>The following output is shown:<\/p>\n<pre class=\"lang:default decode:true \">[INFO] --- dcos-maven-plugin:0.2:deploy (dcos:deploy) @ dcos-java-database ---\r\n[INFO] About to execute DC\/OS deploy\r\n[INFO] app definition: \/Users\/arungupta\/workspaces\/dcos-java-database\/app-definition.json\r\n[INFO] dcos token: \/Users\/arungupta\/workspaces\/dcos-java-database\/.dcos-token\r\n[INFO] dcos url: https:\/\/DCOS-ElasticLoadBa-1TH4TXIU5P783-1163025470.us-west-1.elb.amazonaws.com\/\r\n[INFO] ignore ssl certificate: true\r\n[INFO] deployable: group\r\n[INFO] Response from DC\/OS [200] {\"version\":\"2017-03-07T13:27:49.970Z\",\"deploymentId\":\"dbc80f96-28cb-4040-8d0d-78452e461ec1\"}<\/pre>\n<p>Here are some of the updated output from DC\/OS console.<\/p>\n<p>First updated Services tab:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-2906\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/03\/dcos-cluster-webapp-1-1024x811.png\" alt=\"DC\/OS Cluster Web Application\" width=\"900\" height=\"713\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-1-1024x811.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-1-300x238.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-1-768x608.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-1-20x16.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-1-1320x1045.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-1.png 1452w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<p>Two applications\u00a0in the service:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-2907\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/03\/dcos-cluster-webapp-2-1024x824.png\" alt=\"DC\/OS Cluster Web Application\" width=\"900\" height=\"724\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-2-1024x824.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-2-300x241.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-2-768x618.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-2-20x16.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-2-1320x1062.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-2.png 1422w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<p>Database application has one task:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-2908\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/03\/dcos-cluster-webapp-3-1024x484.png\" alt=\"DC\/OS Cluster Web Application\" width=\"900\" height=\"425\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-3-1024x484.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-3-300x142.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-3-768x363.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-3-1536x726.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-3-20x9.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-3-1320x624.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-3.png 2048w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<p>Status of database task:<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2909 size-large\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/03\/dcos-cluster-webapp-4-1024x931.png\" alt=\"Database Service Discovery\" width=\"900\" height=\"818\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-4-1024x931.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-4-300x273.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-4-768x698.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-4-20x18.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-4-1320x1200.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-4.png 1502w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<p>Logs from the database task:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-2910\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/03\/dcos-cluster-webapp-5-1024x668.png\" alt=\"DC\/OS Cluster Web Application\" width=\"900\" height=\"587\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-5-1024x668.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-5-300x196.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-5-768x501.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-5-1536x1001.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-5-2048x1335.png 2048w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-5-20x13.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-5-1320x861.png 1320w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<p>It shows\u00a0the output from Couchbase REST API for configuring the server.<\/p>\n<p>Status of web task:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-2911\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/03\/dcos-cluster-webapp-6-1024x761.png\" alt=\"DC\/OS Cluster Web Application\" width=\"900\" height=\"669\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-6-1024x761.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-6-300x223.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-6-768x571.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-6-1536x1142.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-6-20x15.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-6-1320x981.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-6.png 1784w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<p>Logs from web task:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-2912\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/03\/dcos-cluster-webapp-7-1024x606.png\" alt=\"DC\/OS Cluster WildFly Output\" width=\"900\" height=\"533\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-7-1024x606.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-7-300x178.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-7-768x454.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-7-1536x909.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-7-2048x1212.png 2048w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-7-20x12.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-7-1320x781.png 1320w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<p>It shows that the Java EE application is deployed successfully.<\/p>\n<p>Access the application:<\/p>\n<pre class=\"lang:default decode:true \">curl https:\/\/DCOS-PublicSlaveLo-DD2EGGFVCJA0-1604955948.us-west-1.elb.amazonaws.com\/airlines\/resources\/airline<\/pre>\n<p>The address is the value of the key\u00a0<code>${PublicSlaveDnsAddress}<\/code> from CloudFormation output. A formatted output, for example with <a href=\"https:\/\/stedolan.github.io\/jq\/\">jq<\/a>,\u00a0looks like:<\/p>\n<pre class=\"lang:default decode:true \">[\r\n  {\r\n    \"travel-sample\": {\r\n      \"country\": \"United States\",\r\n      \"iata\": \"Q5\",\r\n      \"callsign\": \"MILE-AIR\",\r\n      \"name\": \"40-Mile Air\",\r\n      \"icao\": \"MLA\",\r\n      \"id\": 10,\r\n      \"type\": \"airline\"\r\n    }\r\n  },\r\n  {\r\n    \"travel-sample\": {\r\n      \"country\": \"United States\",\r\n\r\n. . .\r\n\r\n     \"icao\": \"RLA\",\r\n      \"id\": 1203,\r\n      \"type\": \"airline\"\r\n    }\r\n  }\r\n]<\/pre>\n<p>That&#8217;s it!<\/p>\n<p>As mentioned earlier, the complete source code used in this blog is at <a href=\"https:\/\/github.com\/arun-gupta\/dcos-java-database\">github.com\/arun-gupta\/dcos-java-database<\/a>.<\/p>\n<p>This blog showed\u00a0how\u00a0a simple Java application can\u00a0talk to a database using service discovery\u00a0in DC\/OS.<\/p>\n<p>For further information check out:<\/p>\n<ul>\n<li><a href=\"https:\/\/dcos.io\/\">DC\/OS Docs<\/a><\/li>\n<li><a href=\"https:\/\/www.couchbase.com\/products\/cloud\/kubernetes\/\">Couchbase on Containers<\/a><\/li>\n<li>Couchbase <a href=\"https:\/\/www.couchbase.com\/developers\/\">Developer Portal<\/a><\/li>\n<li>Ask questions on <a href=\"https:\/\/www.couchbase.com\/forums\/\">Couchbase Forums<\/a> or <a href=\"https:\/\/stackoverflow.com\/questions\/tagged\/couchbase\">Stack Overflow<\/a><\/li>\n<li>Download <a href=\"https:\/\/www.couchbase.com\/downloads\/\">Couchbase<\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This blog will show how a simple Java application can talk to a database or database as a service (DBaaS) using service discovery in DC\/OS. Why Service Discovery? An application typically consist of\u00a0multiple\u00a0components\u00a0such as an application server, a database, a [&hellip;]<\/p>\n","protected":false},"author":58,"featured_media":2909,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1814],"tags":[1520,1874,1873],"ppma_author":[8933],"class_list":["post-2903","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-application-design","tag-containers","tag-maven","tag-mesos"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.7.1 (Yoast SEO v25.7) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Service Discovery With Java and Database Application in DC\/OS<\/title>\n<meta name=\"description\" content=\"This blog will show how a simple Java application can talk to a database using service discovery in DC\/OS.\" \/>\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\/service-discovery-java-database-dcos\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Service Discovery With Java and Database Application in DC\/OS\" \/>\n<meta property=\"og:description\" content=\"This blog will show how a simple Java application can talk to a database using service discovery in DC\/OS.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/service-discovery-java-database-dcos\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-03-07T14:07:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-06-19T10:30:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/03\/dcos-cluster-webapp-4.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1502\" \/>\n\t<meta property=\"og:image:height\" content=\"1366\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Arun Gupta, VP, Developer Advocacy, Couchbase\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@arungupta\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Arun Gupta, VP, Developer Advocacy, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/service-discovery-java-database-dcos\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/service-discovery-java-database-dcos\/\"},\"author\":{\"name\":\"Arun Gupta, VP, Developer Advocacy, Couchbase\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/39d8caed0f536489b6aa6e8d31ee631f\"},\"headline\":\"Service Discovery With Java and Database Application in DC\/OS\",\"datePublished\":\"2017-03-07T14:07:57+00:00\",\"dateModified\":\"2023-06-19T10:30:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/service-discovery-java-database-dcos\/\"},\"wordCount\":985,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/service-discovery-java-database-dcos\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-4.png\",\"keywords\":[\"containers\",\"maven\",\"mesos\"],\"articleSection\":[\"Application Design\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/service-discovery-java-database-dcos\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/service-discovery-java-database-dcos\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/service-discovery-java-database-dcos\/\",\"name\":\"Service Discovery With Java and Database Application in DC\/OS\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/service-discovery-java-database-dcos\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/service-discovery-java-database-dcos\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-4.png\",\"datePublished\":\"2017-03-07T14:07:57+00:00\",\"dateModified\":\"2023-06-19T10:30:27+00:00\",\"description\":\"This blog will show how a simple Java application can talk to a database using service discovery in DC\/OS.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/service-discovery-java-database-dcos\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/service-discovery-java-database-dcos\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/service-discovery-java-database-dcos\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-4.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-4.png\",\"width\":1502,\"height\":1366,\"caption\":\"DC\/OS Cluster Web Application\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/service-discovery-java-database-dcos\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Service Discovery With Java and Database Application in DC\/OS\"}]},{\"@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\/39d8caed0f536489b6aa6e8d31ee631f\",\"name\":\"Arun Gupta, VP, Developer Advocacy, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/8900a75409c646948fe0bd80f6240337\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f912e10b5f39748ee4f1a0b0da6f42747f0b3a94fe7acb511791468656f5e726?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f912e10b5f39748ee4f1a0b0da6f42747f0b3a94fe7acb511791468656f5e726?s=96&d=mm&r=g\",\"caption\":\"Arun Gupta, VP, Developer Advocacy, Couchbase\"},\"description\":\"Arun Gupta is the vice president of developer advocacy at Couchbase. He has built and led developer communities for 10+ years at Sun, Oracle, and Red Hat. He has deep expertise in leading cross-functional teams to develop and execute strategy, planning and execution of content, marketing campaigns, and programs. Prior to that he led engineering teams at Sun and is a founding member of the Java EE team. Gupta has authored more than 2,000 blog posts on technology. He has extensive speaking experience in more than 40 countries on myriad topics and is a JavaOne Rock Star for three years in a row. Gupta also founded the Devoxx4Kids chapter in the US and continues to promote technology education among children. An author of several books on technology, an avid runner, a globe trotter, a Java Champion, a JUG leader, NetBeans Dream Team member, and a Docker Captain, he is easily accessible at @arungupta.\",\"sameAs\":[\"https:\/\/x.com\/arungupta\"],\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/arun-gupta\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Service Discovery With Java and Database Application in DC\/OS","description":"This blog will show how a simple Java application can talk to a database using service discovery in DC\/OS.","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\/service-discovery-java-database-dcos\/","og_locale":"en_US","og_type":"article","og_title":"Service Discovery With Java and Database Application in DC\/OS","og_description":"This blog will show how a simple Java application can talk to a database using service discovery in DC\/OS.","og_url":"https:\/\/www.couchbase.com\/blog\/service-discovery-java-database-dcos\/","og_site_name":"The Couchbase Blog","article_published_time":"2017-03-07T14:07:57+00:00","article_modified_time":"2023-06-19T10:30:27+00:00","og_image":[{"width":1502,"height":1366,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/03\/dcos-cluster-webapp-4.png","type":"image\/png"}],"author":"Arun Gupta, VP, Developer Advocacy, Couchbase","twitter_card":"summary_large_image","twitter_creator":"@arungupta","twitter_misc":{"Written by":"Arun Gupta, VP, Developer Advocacy, Couchbase","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/service-discovery-java-database-dcos\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/service-discovery-java-database-dcos\/"},"author":{"name":"Arun Gupta, VP, Developer Advocacy, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/39d8caed0f536489b6aa6e8d31ee631f"},"headline":"Service Discovery With Java and Database Application in DC\/OS","datePublished":"2017-03-07T14:07:57+00:00","dateModified":"2023-06-19T10:30:27+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/service-discovery-java-database-dcos\/"},"wordCount":985,"commentCount":4,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/service-discovery-java-database-dcos\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-4.png","keywords":["containers","maven","mesos"],"articleSection":["Application Design"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/service-discovery-java-database-dcos\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/service-discovery-java-database-dcos\/","url":"https:\/\/www.couchbase.com\/blog\/service-discovery-java-database-dcos\/","name":"Service Discovery With Java and Database Application in DC\/OS","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/service-discovery-java-database-dcos\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/service-discovery-java-database-dcos\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-4.png","datePublished":"2017-03-07T14:07:57+00:00","dateModified":"2023-06-19T10:30:27+00:00","description":"This blog will show how a simple Java application can talk to a database using service discovery in DC\/OS.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/service-discovery-java-database-dcos\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/service-discovery-java-database-dcos\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/service-discovery-java-database-dcos\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-4.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/dcos-cluster-webapp-4.png","width":1502,"height":1366,"caption":"DC\/OS Cluster Web Application"},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/service-discovery-java-database-dcos\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Service Discovery With Java and Database Application in DC\/OS"}]},{"@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\/39d8caed0f536489b6aa6e8d31ee631f","name":"Arun Gupta, VP, Developer Advocacy, Couchbase","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/8900a75409c646948fe0bd80f6240337","url":"https:\/\/secure.gravatar.com\/avatar\/f912e10b5f39748ee4f1a0b0da6f42747f0b3a94fe7acb511791468656f5e726?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f912e10b5f39748ee4f1a0b0da6f42747f0b3a94fe7acb511791468656f5e726?s=96&d=mm&r=g","caption":"Arun Gupta, VP, Developer Advocacy, Couchbase"},"description":"Arun Gupta is the vice president of developer advocacy at Couchbase. He has built and led developer communities for 10+ years at Sun, Oracle, and Red Hat. He has deep expertise in leading cross-functional teams to develop and execute strategy, planning and execution of content, marketing campaigns, and programs. Prior to that he led engineering teams at Sun and is a founding member of the Java EE team. Gupta has authored more than 2,000 blog posts on technology. He has extensive speaking experience in more than 40 countries on myriad topics and is a JavaOne Rock Star for three years in a row. Gupta also founded the Devoxx4Kids chapter in the US and continues to promote technology education among children. An author of several books on technology, an avid runner, a globe trotter, a Java Champion, a JUG leader, NetBeans Dream Team member, and a Docker Captain, he is easily accessible at @arungupta.","sameAs":["https:\/\/x.com\/arungupta"],"url":"https:\/\/www.couchbase.com\/blog\/author\/arun-gupta\/"}]}},"authors":[{"term_id":8933,"user_id":58,"is_guest":0,"slug":"arun-gupta","display_name":"Arun Gupta, VP, Developer Advocacy, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/f912e10b5f39748ee4f1a0b0da6f42747f0b3a94fe7acb511791468656f5e726?s=96&d=mm&r=g","author_category":"","last_name":"Gupta","first_name":"Arun","job_title":"","user_url":"","description":"Arun Gupta is the vice president of developer advocacy at Couchbase. He has built and led developer communities for 10+ years at Sun, Oracle, and Red Hat. He has deep expertise in leading cross-functional teams to develop and execute strategy, planning and execution of content, marketing campaigns, and programs. Prior to that he led engineering teams at Sun and is a founding member of the Java EE team.\r\n\r\nGupta has authored more than 2,000 blog posts on technology. He has extensive speaking experience in more than 40 countries on myriad topics and is a JavaOne Rock Star for three years in a row. Gupta also founded the Devoxx4Kids chapter in the US and continues to promote technology education among children. An author of several books on technology, an avid runner, a globe trotter, a Java Champion, a JUG leader, NetBeans Dream Team member, and a Docker Captain, he is easily accessible at @arungupta."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2903","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\/58"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=2903"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2903\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media\/2909"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media?parent=2903"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=2903"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=2903"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=2903"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}