You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/fraud-detection/README.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,35 @@
3
3
This service receives new orders by a Kafka topic and returns cases which are
4
4
suspected of fraud.
5
5
6
+
## Dependencies
7
+
8
+
This service requires:
9
+
-**Kafka**: For receiving order events
10
+
-**SQL Server**: For storing fraud detection data in the `FraudDetection` database
11
+
12
+
## Kubernetes Deployment
13
+
14
+
### SQL Server Database Initialization
15
+
16
+
The fraud detection service requires a SQL Server database named `FraudDetection`. The Kubernetes deployment includes automatic database initialization:
17
+
18
+
1.**ConfigMap** (`mssql-init-script`): Contains SQL script to create the database
19
+
2.**StatefulSet** (`sql-server-fraud`): SQL Server with lifecycle hook that executes the init script
20
+
3.**InitContainers**: The fraud detection deployment waits for both Kafka and SQL Server to be ready before starting
21
+
22
+
The database is automatically created when the SQL Server pod starts using a `postStart` lifecycle hook that:
23
+
- Waits 30 seconds for SQL Server to be fully initialized
24
+
- Executes the database creation script via `sqlcmd`
25
+
26
+
### Connection Details
27
+
28
+
The service connects to SQL Server using these environment variables:
0 commit comments