Couchbase is a provider of Spring Boot for handling NoSQL database operations through JSON. Couchbase is NoSQL document oriented distributed database over the cloud or on- premises which perform transactions by JSON and provide unmatched versatility, performance and scalability. To use Couchbase in your Spring boot application you have to add this Couchbase starter in your pom.xml .
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-couchbase</artifactId>
<version>2.6.3</version>
</dependency>
After adding Couchbase Database starter in your application it will automatically download and add the required dependencies in your application and initialize with default values. You can overwrite these values through application.properties / application.yaml .
Data Couchbase Configuration Properties
Spring Boot load these properties in CouchbaseDataProperties class.
Name | Default Value | Description |
spring.data.couchbase.auto-index | false | create views and indexes automatically. |
spring.data.couchbase.consistency | read-your-own-writes | By default Consistency to apply on generated queries. |
spring.data.couchbase.repositories.enabled | true | Enable Couchbase repositories. |
Couchbase Configuration Properties
Spring Boot load these properties in CouchbaseProperties class.
Name | Default Value | Description |
spring.couchbase.bootstrap-hosts | Couchbase nodes host/IP address to bootstrap from. | |
spring.couchbase.bucket.name | default | bucket name connect to. |
spring.couchbase.bucket.password | bucket password. | |
spring.couchbase.env.endpoints.key-value | 1 | Number of sockets per node for each Key/value service. |
spring.couchbase.env.endpoints.query | 1 | Number of sockets per node for each Query (N1QL) service. |
spring.couchbase.env.endpoints.view | 1 | Number of sockets per node for each view service. |
spring.couchbase.env.ssl.enabled | Enable SSL support. Enabled automatically if a “keyStore” is provided otherwise specified otherwise. | |
spring.couchbase.env.ssl.key-store | Path to JVM key store which holds the certificates. | |
spring.couchbase.env.ssl.key-store-password | Password used to access the key store. | |
spring.couchbase.env.timeouts.connect | 5000 | Bucket connections timeout. (in milliseconds) |
spring.couchbase.env.timeouts.key-value | 2500 | Blocking operations performed on a key timeout.( in milliseconds) |
spring.couchbase.env.timeouts.query | 7500 | N1QL query operations timeout.( in milliseconds) |
spring.couchbase.env.timeouts.socket-connect | 1000 | Socket connect connections timeout.( in milliseconds). |
spring.couchbase.env.timeouts.view | 7500 | Regular and geospatial view operations timeout. (in milliseconds). |
References
https://docs.spring.io/spring-boot/docs/1.4.x/reference/html/common-application-properties.html
Happy Learning !!!