Skip to content

Commit 0c7b807

Browse files
authored
refactor: Couchbase CE edition implementation refactor (#65)
1 parent 7c28b48 commit 0c7b807

6 files changed

Lines changed: 25 additions & 17 deletions

File tree

docs/community-edition/Introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Below is a summary of the available editions in the Flamingock Community Edition
2727
| MongoDB | MongoDB | >=4.0 | ✅ Yes | ✅ Yes | Flamingock provides support for both low-level native drivers and high-level abstractions through Spring Data integration. |
2828
| DynamoDB | AWS DynamoDB | >=2.25.29 | ✅ Yes | ✅ Yes | |
2929
| CosmosDB | Azure Cosmos DB | Mongo API 3.6/4.0 | ✅ Yes | ✅ Yes | |
30-
| Couchbase | Couchbase Server | >=3.4.3 | ❌ No | ✅ Yes | |
30+
| Couchbase | Couchbase Server | >=3.6.0 | ❌ No | ✅ Yes | |
3131

3232
---
3333
## Features

docs/community-edition/ce-couchbase.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This edition supports Couchbase through a dedicated artifact:
2525

2626
| Edition Name | Java SDK | Couchbase Compatibility |
2727
|---------------------------|------------------------------------|-------------------------|
28-
| `flamingock-ce-couchbase` | `com.couchbase.client:java-client` | >= `3.4.3` |
28+
| `flamingock-ce-couchbase` | `com.couchbase.client:java-client` (>= `3.6.0`) | >= `7.0` |
2929

3030
---
3131

@@ -66,13 +66,17 @@ implementation("com.couchbase.client:java-client:3.x.x")
6666

6767
### 2. Enable Flamingock runner
6868

69-
At minimum, you must provide a `Cluster` instance (as a **dependency**):
69+
At minimum, you must provide:
70+
- A Cluster instance (as a **dependency**)
71+
- A Bucket instance (as a **dependency**)
7072

7173
```java
7274
Cluster cluster = Cluster.connect("localhost", "username", "password");
75+
Bucket bucket = cluster.bucket("YOUR_BUCKET");
7376

7477
Runner runner = Flamingock.builder()
7578
.addDependency(cluster)
79+
.addDependency(bucket)
7680
.build();
7781
```
7882

@@ -88,26 +92,27 @@ runner.execute();
8892

8993
## Configuration overview
9094

91-
Flamingock’s Couchbase Community Edition requires both:
92-
93-
- A `Cluster` dependency
94-
- A set of configuration properties
95+
Flamingock requires both dependencies and configuration properties, set via the builder.
9596

9697
### Dependencies
9798

9899
These must be registered using `.addDependency(...)`
99100

100101
| Type | Required | Description |
101102
|-------------------------------------|:--------:|----------------------------------------------------|
102-
| `com.couchbase.client.java.Cluster` | Yes | Required to connect and execute against Couchbase. |
103+
| `com.couchbase.client.java.Cluster` | Yes | Required to connect and execute against Couchbase cluster. |
104+
| `com.couchbase.client.java.Bucket` | Yes | Required to connect and execute against Couchbase bucket. |
103105

104106
### Properties
105107

106108
These must be set using `.setProperty(...)`
107109

108110
| Property | Type | Required | Default Value | Description |
109111
|---------------|-----------|:--------:|---------------|--------------------------------------------------------------------------|
110-
| `autoCreate` | `boolean` | No | `true` | Whether Flamingock should auto-create required buckets and indexes. |
112+
| `couchbase.autoCreate` | `boolean` | No | `true` | Whether Flamingock should auto-create required collections and indexes. |
113+
| `couchbase.scopeName` | `String` | No | `"_default"` | Name of the Couchbase scope where the collections exist or will be created. |
114+
| `couchbase.auditRepositoryName` | `String` | No | `"flamingockAuditLogs"` | Name of the collection for storing the audit log. Overrides the default. Most users should keep the default value. |
115+
| `couchbase.lockRepositoryName` | `String` | No | `"flamingockLocks"` | Name of the collection used for distributed locking. Overrides the default. Most users should keep the default value. |
111116

112117
:::warning
113118
In production environments, we strongly recommend keeping the default configuration values unless you fully understand the implications.
@@ -122,12 +127,15 @@ The following example shows how to configure Flamingock with both required and o
122127

123128
```java
124129
Cluster cluster = Cluster.connect("localhost", "username", "password");
130+
Bucket bucket = cluster.bucket("YOUR_BUCKET");
125131

126132
FlamingockBuilder builder = Flamingock.builder()
127133
// mandatory dependency
128134
.addDependency(cluster)
135+
.addDependency(bucket)
129136
// optional configuration
130-
.setProperty("autoCreate", true);
137+
.setProperty("autoCreate", true)
138+
.setProperty("couchbase.scopeName", "YOUR_SCOPE");
131139
```
132140

133141
> You can add additional dependencies and properties based on your custom setup (e.g., metrics, listeners, or cloud-specific settings).

docs/community-edition/ce-dynamodb.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ These must be set using `.setProperty(...)`
120120
| `dynamodb. readCapacityUnits` | `Long` | No | `5L` | Read capacity units (for **PROVISIONED** billing mode only). |
121121
| `dynamodb. writeCapacityUnits` | `Long` | No | `5L` | Write capacity units (for **PROVISIONED** billing mode only). |
122122
| `dynamodb.autoCreate` | `Boolean` | No | `true` | Automatically creates the required tables if they do not exist. |
123-
| `dynamodb. auditRepositoryName` | `String` | No | `flamingockAuditLogs` | Table used to store audit records. Most users should keep the default name. |
124-
| `dynamodb. lockRepositoryName` | `String` | No | `flamingockLock` | Table used for distributed locking. Most users should keep the default name. |
123+
| `dynamodb. auditRepositoryName` | `String` | No | `"flamingockAuditLogs"` | Table used to store audit records. Most users should keep the default name. |
124+
| `dynamodb. lockRepositoryName` | `String` | No | `"flamingockLocks"` | Table used for distributed locking. Most users should keep the default name. |
125125

126126
:::warning
127127
In production environments, we strongly recommend keeping the default configuration values unless you fully understand the implications.

docs/community-edition/ce-mongodb-java-driver.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ These must be set using `.setProperty(...)`
116116
| `mongodb. writeConcern.wTimeout` | `Duration` | `Duration .ofSeconds(1)` | No | Maximum time to wait for the write concern to be fulfilled. |
117117
| `mongodb. readPreference` | `ReadPreference Level` | `ReadPreferenceLevel .PRIMARY` | No | Defines which MongoDB node to read from. |
118118
| `mongodb. auditRepositoryName` | `String` | `"flamingockAuditLogs"` | No | Name of the collection for storing the audit log. Overrides the default. Most users should keep the default value. |
119-
| `mongodb. lockRepositoryName` | `String` | `"flamingockLock"` | No | Name of the collection used for distributed locking. Overrides the default. Most users should keep the default value. |
119+
| `mongodb. lockRepositoryName` | `String` | `"flamingockLocks"` | No | Name of the collection used for distributed locking. Overrides the default. Most users should keep the default value. |
120120

121121
:::warning
122122
We strongly recommend keeping the default configuration values in production environments. They are optimized for **consistency, durability, and safety**, ensuring Flamingock’s audit and rollback guarantees.
@@ -172,7 +172,7 @@ You can find practical examples in the official GitHub repository:
172172
- **Use Flamingock’s default consistency settings (`writeConcern`, `readConcern`, `readPreference`) in production**
173173
These values guarantee strong consistency, durability, and fault tolerance. Overriding them is discouraged unless absolutely necessary.
174174
175-
- **Use the default collection names (`flamingockAuditLogs`, `flamingockLock`)**
175+
- **Use the default collection names (`flamingockAuditLogs`, `flamingockLocks`)**
176176
These help avoid collisions and simplify debugging.
177177
178178
- **Enable automatic index creation unless your environment prohibits it**

docs/community-edition/ce-mongodb-springdata.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ Spring Boot will typically auto-configure `MongoTemplate` for you.
169169
| `mongodb. writeConcern.wTimeout` | `Duration` | `Duration. ofSeconds(1)` | No | Maximum time to wait for the write concern to be fulfilled. |
170170
| `mongodb. readPreference` | `ReadPreference Level` | `ReadPreferenceLevel. PRIMARY` | No | Specifies which MongoDB node to read from. |
171171
| `mongodb. auditRepositoryName` | `String` | `"flamingockAuditLogs"` | No | Name of the collection used to store applied changes. Most users should keep the default value. |
172-
| `mongodb. lockRepositoryName` | `String` | `"flamingockLock"` | No | Name of the collection used for distributed locking. Most users should keep the default value. | |
172+
| `mongodb. lockRepositoryName` | `String` | `"flamingockLocks"` | No | Name of the collection used for distributed locking. Most users should keep the default value. | |
173173

174174
:::warning
175175
It's **strongly recommended keeping the default MongoDB configuration values provided by Flamingock** — especially in production environments. These defaults are carefully chosen to guarantee **maximum consistency, durability, and safety**, which are fundamental to Flamingock’s audit and rollback guarantees.
@@ -252,7 +252,7 @@ You can find practical examples in the official GitHub repository:
252252
These defaults are **strictly selected to guarantee strong consistency, durability, and fault-tolerance**, which are fundamental to Flamingock’s execution guarantees.
253253
Overriding them is **strongly discouraged in production environments**, as it can compromise the integrity of audit logs and distributed coordination.
254254

255-
- **Use the default repository names (`flamingockAuditLogs`, `flamingockLock`) unless you have a strong reason to change them**
255+
- **Use the default repository names (`flamingockAuditLogs`, `flamingockLocks`) unless you have a strong reason to change them**
256256
The default names are chosen to avoid collisions and clearly identify Flamingock-managed collections. Overriding them is supported but rarely necessary.
257257

258258
- **Keep `indexCreation` enabled unless your deployment restricts index creation at runtime**

docs/testing/springboot-integration-testing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ static void overrideProperties(DynamicPropertyRegistry registry) {
134134
registry.add("flamingock.dynamodb.writeCapacityUnits", () -> 5L);
135135
registry.add("flamingock.dynamodb.autoCreate", () -> true);
136136
registry.add("flamingock.dynamodb.auditRepositoryName", () -> "flamingockAuditLogs");
137-
registry.add("flamingock.dynamodb.lockRepositoryName", () -> "flamingockLock");
137+
registry.add("flamingock.dynamodb.lockRepositoryName", () -> "flamingockLocks");
138138
}
139139
```
140140

0 commit comments

Comments
 (0)