{"id":10355,"date":"2024-05-10T07:19:23","date_gmt":"2024-05-10T14:19:23","guid":{"rendered":"https:\/\/www.couchbase.com\/developers\/tutorials\/quickstart-scala-webservers\/"},"modified":"2024-05-10T07:19:23","modified_gmt":"2024-05-10T14:19:23","slug":"quickstart-scala-webservers","status":"publish","type":"tutorials","link":"https:\/\/www.couchbase.com\/fr\/developers\/tutorials\/quickstart-scala-webservers\/","title":{"rendered":"Quickstart in Couchbase with Scala"},"content":{"rendered":"\n<h3 id=\"h-prerequisites\" class=\"wp-block-heading\">Prerequisites<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To run this prebuilt project, you will need:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Scala 2, version 2.13.9 or higher installed<\/li>\n\n\n<li>Code Editor installed (IntelliJ IDEA, Eclipse, or Visual Studio Code)<\/li>\n\n\n<li>Set up Couchbase, using one of the two options below<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Option 1: Couchbase Capella<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/cloud.couchbase.com\/sign-up\">A Couchbase Capella account<\/a> \u2013 free trials are available with a simple sign-up<\/li>\n\n\n<li>Capella Cluster <a href=\"https:\/\/docs.couchbase.com\/cloud\/get-started\/deploy-first-cluster.html\">deployed<\/a><\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Option 2: Couchbase Server<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Follow <a href=\"\/tutorial-couchbase-installation-options\">Couchbase Installation Options<\/a> for installing the latest Couchbase Database Server Instance (at least Couchbase Server 7)<\/li>\n\n<\/ul>\n\n\n\n<h3 id=\"h-source-code\" class=\"wp-block-heading\">Source Code<\/h3>\n\n\n\n<pre class=\"wp-block-code language-shell\"><code>git clone https:\/\/github.com\/couchbase-examples\/scala-quickstart.git\n<\/code><\/pre>\n\n\n\n<h4 id=\"h-database-and-web-server-configuration\" class=\"wp-block-heading\">Database and Web Server Configuration<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">All configuration for communication with the database and the three web servers is stored in the <code>\/src\/main\/resources\/application.conf<\/code> file.  This includes the connection string, username, and password for Couchbase, and the port number for the API server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The default username for Couchbase server is assumed to be <code>Administrator<\/code> and the default password is assumed to be <code>password<\/code>.  If these are different in your environment you will need to change them before running the application.<\/p>\n\n\n\n<h4 id=\"h-couchbase-capella-specific-configuration\" class=\"wp-block-heading\">Couchbase Capella Specific Configuration<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">This section is only needed when you&#8217;ve opted for using a Couchbase Capella cloud instance for following the tutorial.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To enable the tutorial code to establish a connection to Capella, you will need to make a couple of changes:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>import <code>travel-sample<\/code> sample bucket with <code>airline<\/code> collection onto your Capella cluster<\/li>\n\n\n<li>make sure your <code>username<\/code> in <code>application.conf<\/code> is <a href=\"https:\/\/docs.couchbase.com\/cloud\/get-started\/configure-cluster-access.html\">configured for access<\/a> to this bucket<\/li>\n\n\n<li>change the <code>host<\/code> in <code>application.conf<\/code> to the <strong>Public Connection String<\/strong> address in Capella -&gt; Databases -&gt; <code>your_database_name<\/code> -&gt; Connect. See the image below:\n<img decoding=\"async\" src=\".\/connect_wan.png\" alt=\"capella_host_address\"><\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Possible issues:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The Scala SDK does not support a bucket path as part of the <code>host<\/code> name in <code>application.conf<\/code>, use <code>bucket-name<\/code> instead<\/li>\n\n\n<li>It is not supported to create a bucket in Capella through the SDK. If you get a <code>Error: unable to find bucket &lt;bucket-name&gt;<\/code>,\nplease make sure you&#8217;ve created the bucket through the Capella user interface, and the name lines up with <code>bucket-name<\/code> in <code>application.conf<\/code><\/li>\n\n<\/ul>\n\n\n\n<h3 id=\"h-running-the-application\" class=\"wp-block-heading\">Running The Application<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">At this point the application is ready, and you can run it via your IDE or from the terminal:<\/p>\n\n\n\n<pre class=\"wp-block-code language-shell\"><code>sbt run\n<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">Note: When using Option 2: Couchbase Server, then Couchbase Server 7 must be installed and running on localhost (<a href=\"http:\/\/127.0.0.1:8091\">http:\/\/127.0.0.1:8091<\/a>) prior to running the Scala application.<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">The application will keep running until you provide a line of input, after which it will shut down the web servers.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can launch your browser and go to API server&#8217;s <a href=\"http:\/\/locahost:8080\/docs\/\">Swagger start page<\/a>.<\/p>\n\n\n\n<h3 id=\"h-what-we-ll-cover\" class=\"wp-block-heading\">What We&#8217;ll Cover<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Simple REST APIs using the Scala Couchbase SDK with the following endpoints:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#post-an-airline\">POST an airline<\/a> \u2013 Create a new airline record<\/li>\n\n\n<li><a href=\"#get-an-airline-by-key\">GET an airline by Key<\/a> \u2013 Get a specific airline<\/li>\n\n\n<li><a href=\"#put-airline\">PUT airline<\/a> \u2013 Update an airline<\/li>\n\n\n<li><a href=\"#delete-airline\">DELETE airline<\/a> \u2013 Delete an airline<\/li>\n\n\n<li><a href=\"#get-airlines-by-searching\">GET airlines by searching<\/a>  \u2013 Get all airlines matching provided name or code<\/li>\n\n<\/ul>\n\n\n\n<h3 id=\"h-document-structure\" class=\"wp-block-heading\">Document Structure<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">We will be hosting up REST APIs using embedded Netty webserver. Endpoint descriptions and <a href=\"https:\/\/swagger.io\/\">Swagger documentation<\/a> is created through the <a href=\"https:\/\/tapir.softwaremill.com\/\">tapir framework<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The REST APIs will be used to manage airline records. Our airline document will have an auto-generated UUID for its key,\nname of the airline as well as its country, callsign and both IATA and ICAO codes. For this demo we will store all airline information in\njust one document in a collection named <code>airline<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code language-json\"><code>{\n  &quot;id&quot;: &quot;b181551f-071a-4539-96a5-8a3fe8717faf&quot;,\n  &quot;name&quot;: &quot;CouchAir&quot;,\n  &quot;country&quot;: &quot;zz&quot;,\n  &quot;callsign&quot;: &quot;BASE&quot;,\n  &quot;iata&quot;: &quot;CBA&quot;,\n  &quot;icao&quot;: &quot;CBAR&quot;\n}\n<\/code><\/pre>\n\n\n\n<h3 id=\"h-let-s-review-the-code\" class=\"wp-block-heading\">Let&#8217;s Review the Code<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To begin clone the repo and open it up in the IDE of your choice to learn about how to create, read, update and delete documents in your Couchbase Server.<\/p>\n\n\n\n<h3 id=\"h-post-an-airline\" class=\"wp-block-heading\">POST an Airline<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">For CRUD operations we will use the <a href=\"https:\/\/docs.couchbase.com\/scala-sdk\/current\/howtos\/kv-operations.html\">Key Value operations<\/a> that are built into the Couchbase SDK to create, read, update, and delete a document. Every document will need an ID (similar to a primary key in other databases) in order to save it to the database.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If we look at the the <code>AirlineController<\/code> trait, found in the controllers folder and navigate to the postAirline function, then we can see the following type signature:<\/p>\n\n\n\n<pre class=\"wp-block-code language-scala\"><code>def postAirline(airlineInput: AirlineInput): F[Either[String, Airline]]\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The abstract definitions in <code>AirlineController<\/code> (and <code>CouchbaseConnection<\/code>) are generalized over some effect <code>F<\/code>, making it easier to switch between implementations such as <code>Future<\/code> and <code>IO<\/code>. This will help in defining our different REST APIs and also make it easier to test our code.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Within the <code>F<\/code> type parameter, we can see that we return an <code>Either[String, Airline]]<\/code> representing an error string, or a successful result with the <code>Airline<\/code> case class.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The input for posting an <code>Airline<\/code> is an <code>AirlineInput<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code language-scala\"><code>final case class AirlineInput(\n                                     name: String,\n                                     country: String,\n                                     callsign: String,\n                                     iata: String,\n                                     icao: String\n                             )\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The implementation for <code>postAirline<\/code> in <code>CouchbaseAirlineController<\/code> will transform the input object into airline model instance:<\/p>\n\n\n\n<pre class=\"wp-block-code language-scala\"><code>final case class Airline(\n                                id: Int32,\n                                name: String,\n                                country: String,\n                                callsign: String,\n                                iata: String,\n                                icao: String\n                        )\n\ndef fromAirlineInput(airlineInput: AirlineInput): Try[Airline] = {\n  airlineInput match {\n    case AirlineInput(name, country, callsign, iata, icao) =&gt; Airline(UUID.randomUUID(), name, country, callsign, iata, icao)\n  }\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Our <code>Airline<\/code> document is ready to be persisted to the database.  We create call to the <code>collection<\/code> using the local variable <code>airlineCollection: Future[Collection]<\/code> and then call the <code>insert<\/code> method  and passing it the UUID from the <code>Airline<\/code> as the key.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Note that the <a href=\"https:\/\/docs.couchbase.com\/scala-sdk\/current\/howtos\/json.html\">Scala SDK has support for various types of JSON<\/a> commonly used within the Scala community. Here we use the <a href=\"https:\/\/circe.github.io\/circe\/\">circe<\/a> JSON library to convert the <code>Airline<\/code> with <code>.asJson<\/code> and insert it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once the document is inserted we then return the document saved and the result all as part of the same object back to the user.<\/p>\n\n\n\n<pre class=\"wp-block-code language-scala\"><code>override def postAirline(airlineInput: AirlineInput): Future[Either[String, Airline]] = {\n  import io.circe.syntax._\n  for {\n    ac &lt;- airlineCollection\n    airline &lt;- Airline.fromAirlineInput(airlineInput) match {\n      case Failure(exception) =&gt; Future.successful(Left(exception.toString))\n      case Success(a) =&gt;\n        ac.insert[io.circe.Json](a.id.toString, a.asJson) map (_ =&gt; Right(a))\n    }\n  } yield airline\n}\n<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><em>from controllers\/CouchbaseAirlineController.scala<\/em><\/p>\n<\/blockquote>\n\n\n\n<h3 id=\"h-get-an-airline-by-key\" class=\"wp-block-heading\">GET an Airline by Key<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Navigate to the <code>getAirline<\/code> function in the <code>CouchbaseAirlineController<\/code> file in the controllers folder.  We only need\nthe airline <code>id<\/code> from the user to retrieve a particular airline document using a basic key-value operation which is\npassed in the method signature as a string. Since we created the document with a unique key we can use that key to find\nthe document in the scope and collection it is stored in.<\/p>\n\n\n\n<pre class=\"wp-block-code language-scala\"><code>override def getAirline(id: UUID): Future[Either[String, Airline]] = {\n  for {\n    ac &lt;- airlineCollection\n    res &lt;- ac.get(id.toString).map(_.contentAsCirceJson[Airline]).\n            recover { case _: DocumentNotFoundException =&gt; Left(s&quot;Could not retrieve Airline. ID: $id was not found.&quot;)}\n  } yield res\n}\n<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><em>from getAirline function in controllers\/CouchbaseAirlineController.scala and using the implicit class in models\/CirceGetResult.<\/em><\/p>\n<\/blockquote>\n\n\n\n<h3 id=\"h-put-airline\" class=\"wp-block-heading\">PUT Airline<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Now let&#8217;s navigate to the <code>putAirline<\/code> function of the <code>CouchbaseAirlineController<\/code> class. The entire document gets\nreplaced except for the document key and the <code>id<\/code> field.  We create a call to the <code>collection<\/code> using the <code>upsert<\/code> method\nand then return the document saved and the result just as we did in the previous endpoint.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The only difference in implementation with <code>postAirline<\/code> is the following line:<\/p>\n\n\n\n<pre class=\"wp-block-code language-scala\"><code>ac.upsert[io.circe.Json](args.id.toString, p.asJson)\n<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><em>from update method of controllers\/CouchbaseAirlineController.scala<\/em><\/p>\n<\/blockquote>\n\n\n\n<h3 id=\"h-delete-airline\" class=\"wp-block-heading\">DELETE Airline<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Navigate to the <code>deleteAirline<\/code> function in the <code>CouchbaseAirlineController<\/code> class. We only need the <code>Key<\/code> or <code>id<\/code> from\nthe user to remove a document using a basic key-value operation.<\/p>\n\n\n\n<pre class=\"wp-block-code language-scala\"><code>ac.remove(id.toString)\n<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><em>from deleteAirline method of controllers\/CouchbaseAirlineController.scala<\/em><\/p>\n<\/blockquote>\n\n\n\n<h3 id=\"h-get-airlines-by-searching\" class=\"wp-block-heading\">GET Airlines by Searching<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/docs.couchbase.com\/scala-sdk\/current\/howtos\/n1ql-queries-with-sdk.html\">SQL++ (N1QL)<\/a> is a powerful query language based on SQL, but designed for structured and flexible JSON documents.\nWe will use a SQL++ query to search for profiles with Skip, Limit, and Search options.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Navigate to the <code>getAirlines<\/code> method in the <code>CouchbaseAirlineController<\/code> class. This endpoint is different from all\nthe others because it makes the SQL++ query rather than a key-value operation. This means more overhead because the\nquery engine is involved. You may need to create an <a href=\"https:\/\/docs.couchbase.com\/server\/current\/learn\/services-and-indexes\/indexes\/indexing-and-query-perf.html\">index<\/a>\nspecific for this query on fields <code>name<\/code>, <code>country<\/code>, <code>callsign<\/code>, <code>icao<\/code>, <code>iata<\/code>, so it would be performant.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The individual <code>skip<\/code> (optional), <code>limit<\/code> (optional), and <code>search<\/code> values are obtained from their respective parameters.\nThen, we build our SQL++ query using the parameters that were passed in.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, we pass that <code>query<\/code> to the <code>cluster.query<\/code> method and return the result.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Take notice of the SQL++ syntax and how it targets the <code>bucket<\/code>.<code>scope<\/code>.<code>collection<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code language-scala\"><code>  override def airlineListing(args: AirlineListingInput): Future[Either[String, List[Airline]]] = {\n  val query = s&quot;SELECT p.* FROM &quot; +\n          s&quot;`${quickstartConfig.couchbase.bucketName}`.`_default`.`${quickstartConfig.couchbase.collectionName}` a &quot; +\n          s&quot;WHERE lower(a.name) LIKE &#039;%${args.search.toLowerCase}%&#039; &quot; +\n          s&quot;OR lower(a.country) LIKE &#039;%${args.search.toLowerCase}%&#039;  &quot; +\n          s&quot;OR lower(a.callsign) LIKE &#039;%${args.search.toLowerCase}%&#039;  &quot; +\n          s&quot;OR lower(a.iata) LIKE &#039;%${args.search.toLowerCase}%&#039;  &quot; +\n          s&quot;OR lower(a.icao) LIKE &#039;%${args.search.toLowerCase}%&#039;  &quot; +\n          s&quot;LIMIT &quot; + args.limit.getOrElse(5) + &quot; OFFSET &quot; + args.skip.getOrElse(0)\n\n  import cats.implicits._\n  for {\n    cluster &lt;- couchbaseConnection.cluster\n    rows &lt;- Future.fromTry(\n      cluster.query(\n        query,\n        QueryOptions(scanConsistency =\n          Some(QueryScanConsistency.RequestPlus())\n        )\n      )\n    )\n    airlines &lt;- Future.fromTry(\n      rows\n              .rowsAs[io.circe.Json]\n              .map(_.map(json =&gt; json.as[Airline].left.map(_.getMessage())))\n    )\n    accumulatedAirlines = airlines.toList.sequence\n  } yield accumulatedAirlines\n}\n<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><em>from getAirlines method of controllers\/CouchbaseAirlineController.scala<\/em><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Prerequisites To run this prebuilt project, you will need: Option 1: Couchbase Capella Option 2: Couchbase Server Source Code Database and Web Server Configuration All configuration for communication with the database and the three web servers is stored in the \/src\/main\/resources\/application.conf file. This includes the connection string, username, and password for Couchbase, and the port [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"menu_order":0,"template":"","meta":{"_acf_changed":false,"inline_featured_image":false,"_acf":"","footnotes":""},"tutorial-languages":[649],"tutorial-tags":[546],"tutorial-technologies":[562,548,549,554],"tutorial-types":[550],"class_list":["post-10355","tutorials","type-tutorials","status-publish","hentry","tutorial-languages-scala","tutorial-tags-rest-api","tutorial-technologies-capella","tutorial-technologies-kv","tutorial-technologies-query","tutorial-technologies-server","tutorial-types-quickstart"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.8 (Yoast SEO v28.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Quickstart in Couchbase with Scala - Couchbase<\/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\/fr\/developers\/tutorials\/quickstart-scala-webservers\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Quickstart in Couchbase with Scala\" \/>\n<meta property=\"og:description\" content=\"Prerequisites To run this prebuilt project, you will need: Option 1: Couchbase Capella Option 2: Couchbase Server Source Code Database and Web Server Configuration All configuration for communication with the database and the three web servers is stored in the \/src\/main\/resources\/application.conf file. This includes the connection string, username, and password for Couchbase, and the port [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/fr\/developers\/tutorials\/quickstart-scala-webservers\/\" \/>\n<meta property=\"og:site_name\" content=\"Couchbase\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Couchbase\/\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/10\/Cloud-2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2548\" \/>\n\t<meta property=\"og:image:height\" content=\"1171\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@couchbase\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/fr\\\/developers\\\/tutorials\\\/quickstart-scala-webservers\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/fr\\\/developers\\\/tutorials\\\/quickstart-scala-webservers\\\/\",\"name\":\"Quickstart in Couchbase with Scala - Couchbase\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/fr\\\/#website\"},\"datePublished\":\"2024-05-10T14:19:23+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/fr\\\/developers\\\/tutorials\\\/quickstart-scala-webservers\\\/#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/fr\\\/developers\\\/tutorials\\\/quickstart-scala-webservers\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/fr\\\/developers\\\/tutorials\\\/quickstart-scala-webservers\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.couchbase.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Quickstart in Couchbase with Scala\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/fr\\\/#website\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/fr\\\/\",\"name\":\"Couchbase\",\"description\":\"The Operational Data Platform for AI\u2122\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/fr\\\/#organization\"},\"alternateName\":\"Couchbase, Inc.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.couchbase.com\\\/fr\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"fr-FR\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/fr\\\/#organization\",\"name\":\"Couchbase\",\"alternateName\":\"Couchbase, Inc.\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/fr\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/fr\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/Couchbase_Logo_Couchbase_Token_Red-1.png\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/Couchbase_Logo_Couchbase_Token_Red-1.png\",\"width\":1129,\"height\":1129,\"caption\":\"Couchbase\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/fr\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/Couchbase\\\/\",\"https:\\\/\\\/x.com\\\/couchbase\",\"https:\\\/\\\/www.youtube.com\\\/c\\\/CouchbaseServer\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/couchbase\\\/\",\"https:\\\/\\\/github.com\\\/couchbase\\\/\",\"https:\\\/\\\/en.wikipedia.org\\\/wiki\\\/Couchbase,_Inc.\"],\"description\":\"Couchbase is a database software company headquartered in San Jose, California, providing an operational data platform for AI used by hundreds of global enterprises.\",\"legalName\":\"Couchbase, Inc.\",\"foundingDate\":\"2011-01-01\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Quickstart in Couchbase with Scala - Couchbase","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\/fr\/developers\/tutorials\/quickstart-scala-webservers\/","og_locale":"fr_FR","og_type":"article","og_title":"Quickstart in Couchbase with Scala","og_description":"Prerequisites To run this prebuilt project, you will need: Option 1: Couchbase Capella Option 2: Couchbase Server Source Code Database and Web Server Configuration All configuration for communication with the database and the three web servers is stored in the \/src\/main\/resources\/application.conf file. This includes the connection string, username, and password for Couchbase, and the port [&hellip;]","og_url":"https:\/\/www.couchbase.com\/fr\/developers\/tutorials\/quickstart-scala-webservers\/","og_site_name":"Couchbase","article_publisher":"https:\/\/www.facebook.com\/Couchbase\/","og_image":[{"width":2548,"height":1171,"url":"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/10\/Cloud-2.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_site":"@couchbase","twitter_misc":{"Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/fr\/developers\/tutorials\/quickstart-scala-webservers\/","url":"https:\/\/www.couchbase.com\/fr\/developers\/tutorials\/quickstart-scala-webservers\/","name":"Quickstart in Couchbase with Scala - Couchbase","isPartOf":{"@id":"https:\/\/www.couchbase.com\/fr\/#website"},"datePublished":"2024-05-10T14:19:23+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/fr\/developers\/tutorials\/quickstart-scala-webservers\/#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/fr\/developers\/tutorials\/quickstart-scala-webservers\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/fr\/developers\/tutorials\/quickstart-scala-webservers\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/"},{"@type":"ListItem","position":2,"name":"Quickstart in Couchbase with Scala"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/fr\/#website","url":"https:\/\/www.couchbase.com\/fr\/","name":"Couchbase","description":"The Operational Data Platform for AI\u2122","publisher":{"@id":"https:\/\/www.couchbase.com\/fr\/#organization"},"alternateName":"Couchbase, Inc.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/fr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"fr-FR"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/fr\/#organization","name":"Couchbase","alternateName":"Couchbase, Inc.","url":"https:\/\/www.couchbase.com\/fr\/","logo":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/www.couchbase.com\/fr\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/11\/Couchbase_Logo_Couchbase_Token_Red-1.png","contentUrl":"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/11\/Couchbase_Logo_Couchbase_Token_Red-1.png","width":1129,"height":1129,"caption":"Couchbase"},"image":{"@id":"https:\/\/www.couchbase.com\/fr\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Couchbase\/","https:\/\/x.com\/couchbase","https:\/\/www.youtube.com\/c\/CouchbaseServer","https:\/\/www.linkedin.com\/company\/couchbase\/","https:\/\/github.com\/couchbase\/","https:\/\/en.wikipedia.org\/wiki\/Couchbase,_Inc."],"description":"Couchbase est une soci\u00e9t\u00e9 de logiciels de bases de donn\u00e9es dont le si\u00e8ge social est situ\u00e9 \u00e0 San Jose, en Californie, et qui fournit une plateforme op\u00e9rationnelle de donn\u00e9es pour l\u2019IA utilis\u00e9e par des centaines d\u2019entreprises mondiales.","legalName":"Couchbase, Inc.","foundingDate":"2011-01-01"}]}},"acf":[],"permalink_manager":null,"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/fr\/wp-json\/wp\/v2\/tutorials\/10355","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/fr\/wp-json\/wp\/v2\/tutorials"}],"about":[{"href":"https:\/\/www.couchbase.com\/fr\/wp-json\/wp\/v2\/types\/tutorials"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/fr\/wp-json\/wp\/v2\/tutorials\/10355\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/fr\/wp-json\/wp\/v2\/media?parent=10355"}],"wp:term":[{"taxonomy":"tutorial-languages","embeddable":true,"href":"https:\/\/www.couchbase.com\/fr\/wp-json\/wp\/v2\/tutorial-languages?post=10355"},{"taxonomy":"tutorial-tags","embeddable":true,"href":"https:\/\/www.couchbase.com\/fr\/wp-json\/wp\/v2\/tutorial-tags?post=10355"},{"taxonomy":"tutorial-technologies","embeddable":true,"href":"https:\/\/www.couchbase.com\/fr\/wp-json\/wp\/v2\/tutorial-technologies?post=10355"},{"taxonomy":"tutorial-types","embeddable":true,"href":"https:\/\/www.couchbase.com\/fr\/wp-json\/wp\/v2\/tutorial-types?post=10355"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}