Skip to content

Commit 5c3f348

Browse files
committed
feat: adjust docs
1 parent df64b30 commit 5c3f348

File tree

5 files changed

+213
-2
lines changed

5 files changed

+213
-2
lines changed

docs/.vitepress/config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export default defineConfig({
1919
{
2020
text: "Configuration", items: [
2121
{ text: "Server", link: "/docs/configuration/server" },
22+
{ text: "Indexer", link: "/docs/configuration/indexer" },
2223
{ text: "Dashboard", link: "/docs/configuration/dashboard" }
2324
]
2425
},
@@ -35,6 +36,7 @@ export default defineConfig({
3536
]
3637
},
3738
{ text: "Caching", link: "/docs/caching" },
39+
{ text: "Broker", link: "/docs/broker" },
3840
{
3941
text: "Frontend Library", link: "/docs/frontend-library", items: [
4042
{ text: "Prompt", link: "/docs/frontend-library/prompt" },

docs/docs/broker.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
## Broker Configuration
2+
3+
### Background
4+
5+
Feedback-Fusion employs an event-driven architecture where the main server component emits events that need to be processed asynchronously.
6+
The indexer service handles the actual processing of these events. Communication between these components flows through a broker system that ensures reliable message delivery and decouples event production from consumption.
7+
8+
The broker implementation offers two distinct approaches:
9+
10+
- **gRPC**: Designed for smaller deployments where simplicity matters more than scale. The server sends asynchronous gRPC requests to the indexer,
11+
which processes events and returns responses after completion. This approach works well for single-instance setups but doesn't scale horizontally since each server instance needs to communicate with specific indexer instances.
12+
13+
- **Fluvio**: Built for high-performance scenarios requiring horizontal scalability. Events are published to a distributed streaming platform
14+
where multiple indexer instances can consume and process them concurrently. This enables dynamic scaling based on workload and provides better fault tolerance.
15+
Fluvio is essentially a faster, more modern alternative to Apache Kafka. See [fluvio.io](https://fluvio.io) for more details.
16+
17+
Choose gRPC for development environments or small production setups where operational simplicity is preferred. Select Fluvio when you need to handle high event volumes across multiple server and indexer instances.
18+
19+
### Configuration
20+
21+
#### Fluvio Driver
22+
23+
Configure Fluvio as your broker driver for scalable, distributed event processing:
24+
25+
```hcl
26+
broker = {
27+
fluvio = {
28+
topic = "feedback-fusion"
29+
30+
fluvio = {
31+
endpoint = "127.0.0.1:9003"
32+
use_spu_local_address = false
33+
34+
tls = {
35+
tls_policy = "disabled"
36+
}
37+
}
38+
}
39+
40+
batch_interval = 0
41+
}
42+
```
43+
44+
#### gRPC Driver
45+
46+
Configure gRPC as your broker driver for simple, direct communication:
47+
48+
```hcl
49+
broker = {
50+
grpc = {
51+
endpoint = "https://grpc.example.com"
52+
tls = {
53+
key = "/path/to/key.pem"
54+
certificate = "/path/to/certificate.pem"
55+
certificate_authority = "/path/to/ca.pem"
56+
}
57+
}
58+
max_batch_size = 10
59+
batch_interval = 1000
60+
}
61+
```
62+
63+
### Configuration Reference
64+
65+
#### Top-Level Parameters
66+
67+
| Parameter | Description | Default | Data Type |
68+
|-----------|-------------|---------|-----------|
69+
| fluvio | Fluvio broker driver configuration | N/A | Object |
70+
| grpc | gRPC broker driver configuration | N/A | Object |
71+
| max_batch_size | Maximum number of messages to process in a single batch | 10 | Integer |
72+
| batch_interval | Time interval in milliseconds to wait before processing a batch | 1000 | Integer |
73+
74+
#### Fluvio Configuration
75+
76+
| Parameter | Description | Default | Data Type |
77+
|-----------|-------------|---------|-----------|
78+
| fluvio | Fluvio cluster configuration object. See [FluvioClusterConfig](https://docs.rs/fluvio/latest/fluvio/config/struct.FluvioClusterConfig.html) for available options | N/A | Object |
79+
| topic | Topic name for event streams | "feedback-fusion" | String |
80+
81+
#### gRPC Configuration
82+
83+
| Parameter | Description | Default | Data Type |
84+
|-----------|-------------|---------|-----------|
85+
| endpoint | gRPC server endpoint URL | N/A | String |
86+
| tls | TLS configuration for secure communication | N/A | Object |
87+
88+
#### TLS Configuration
89+
90+
| Parameter | Description | Default | Data Type |
91+
|-----------|-------------|---------|-----------|
92+
| key | Path to TLS private key file | N/A | String |
93+
| certificate | Path to TLS certificate file | N/A | String |
94+
| certificate_authority | Path to CA certificate file | N/A | String |
95+
96+
**Important**: You must configure exactly one broker driver. Choose either `fluvio` or `grpc` - configuring both will result in an error.

docs/docs/configuration/indexer.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
## Indexer Configuration
2+
3+
The indexer component processes events emitted by the main Feedback-Fusion server. Since it only consumes and processes events, its configuration is limited to the essential components needed for this task.
4+
5+
### Configuration Structure
6+
7+
The indexer configuration reuses the same configuration options as the main server, but only requires two sections:
8+
9+
- **Database Configuration**: Where to store processed data
10+
- **Broker Configuration**: How to receive events from the server
11+
12+
### Example Configuration
13+
14+
```hcl
15+
# Database configuration (same as server)
16+
database = {
17+
postgres = {
18+
endpoint = "localhost:5432"
19+
username = "postgres_user"
20+
password = "postgres_password"
21+
database = "postgres_db"
22+
}
23+
}
24+
25+
# Broker configuration (event consumption only)
26+
broker = {
27+
fluvio = {
28+
topic = "feedback-fusion"
29+
30+
fluvio = {
31+
endpoint = "127.0.0.1:9003"
32+
use_spu_local_address = false
33+
34+
tls = {
35+
tls_policy = "disabled"
36+
}
37+
}
38+
}
39+
}
40+
41+
# OR for gRPC-based setups:
42+
43+
broker = {
44+
grpc = {
45+
key = "/path/to/key.pem"
46+
certificate = "/path/to/certificate.pem"
47+
certificate_authority = "/path/to/ca.pem"
48+
}
49+
}
50+
```
51+
52+
### Configuration Reference
53+
54+
#### Database Configuration
55+
56+
Identical to the server database configuration. See [Server Configuration](/docs/configuration/server) for available database options.
57+
58+
#### Broker Configuration (Indexer-Specific)
59+
60+
| Parameter | Description | Default | Data Type |
61+
|-----------|-------------|---------|-----------|
62+
| fluvio | Fluvio consumer configuration | N/A | Object |
63+
| grpc | gRPC TLS configuration (flattened) | N/A | Object |
64+
65+
**Note**: Unlike the server configuration, the indexer broker configuration:
66+
- Does not include `endpoint` for gRPC (the indexer acts as a server, not a client)
67+
- Does not include `max_batch_size` or `batch_interval` (these are producer-specific settings)
68+
- Must use the same broker driver type (`fluvio` or `grpc`) as configured in the server
69+
- For gRPC, the TLS parameters are flattened directly under the `grpc` object
70+
71+
For detailed broker configuration options, see [Broker Configuration](/docs/broker).

docs/docs/configuration/server.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,3 +223,34 @@ preset = {
223223
]
224224
}
225225
```
226+
227+
## Broker Configuration
228+
229+
**Important**: The broker configuration requires exactly one driver to be configured.
230+
You must choose either the `fluvio` driver or the `grpc` driver - configuring both simultaneously is not supported. The configuration below shows the gRPC driver setup.
231+
232+
```hcl
233+
broker = {
234+
grpc = {
235+
endpoint = "https://grpc.example.com"
236+
tls = {
237+
key = "/path/to/key.pem"
238+
certificate = "/path/to/certificate.pem"
239+
certificate_authority = "/path/to/ca.pem"
240+
}
241+
}
242+
max_batch_size = 10
243+
batch_interval = 1000
244+
}
245+
```
246+
247+
### Broker Configuration Reference
248+
249+
| Parameter | Description | Default | Data Type |
250+
|-----------|-------------|---------|-----------|
251+
| fluvio | Fluvio broker driver configuration | N/A | Object |
252+
| grpc | gRPC broker driver configuration | N/A | Object |
253+
| max_batch_size | Maximum batch size for message processing | 10 | Integer |
254+
| batch_interval | Batch interval in milliseconds | 1000 | Integer |
255+
256+
For more detailed information about broker configuration options, see [Broker configuration](/docs/broker).

docs/docs/deployment/docker.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
## Prerequisites
44
- Docker installed on your target machine. [Install Docker](https://docs.docker.com/get-docker/)
55
- Docker Compose installed on your target machine. [Install Docker Compose](https://docs.docker.com/compose/install/)
6-
- A running database of your choice. [Supported Databases](/docs/configuration/server#database-configuration)
6+
- A running database of your choice. See [Database Configuration](/docs/configuration/server#database-configuration) for supported databases.
7+
- For Fluvio deployments: A running Fluvio cluster. See [Broker Configuration](/docs/broker) for setup instructions.
78

89
## Docker Compose Configuration
910
Create a `docker-compose.yml` file with the following content:
@@ -23,9 +24,19 @@ services:
2324
restart: unless-stopped
2425
volumes:
2526
- /path/to/config:/path/to/container/config
27+
28+
feedback-fusion-indexer:
29+
image: ghcr.io/onelitefeathernet/feedback-fusion-indexer:latest
30+
container_name: feedback-fusion-indexer
31+
environment:
32+
RUST_LOG: INFO
33+
FEEDBACK_FUSION_CONFIG: /path/to/container/config
34+
restart: unless-stopped
35+
volumes:
36+
- /path/to/indexer-config:/path/to/container/config
2637
```
2738
28-
Refer to the [configuration documentation](/docs/configuration/server) for the config file details.
39+
Refer to the [Server Configuration](/docs/configuration/server) for the main server config file details and [Indexer Configuration](/docs/configuration/indexer) for the indexer config file details.
2940
3041
Afterwards start the application:
3142

0 commit comments

Comments
 (0)