What data looks like for this category
Teams from production, quality assurance, quality control, and warehouse departments generate daily data for this category. The data includes master production files, batch production records, batch packaging records, cleaning records, inspection records, deviations/CAPA/changes, and batch release review forms. Data sources include approved formulation processes, material batches, MES/electronic batch records, equipment and environmental monitoring data, LIMS, and quality management systems. Updates occur per production batch, each key process step, and as per the established monitoring plan. Fields include material batch numbers, process temperature (℃), runtime duration (minutes), test result values, and additional relevant metrics. The system updates data in real time or synchronizes it at designated nodes during the production flow.
Constraints on database and operations workflows
Data for this category links strongly to a unique production batch. Teams must archive data by batch and prevent any alterations at any stage. The database must support fast retrieval by batch and fine-grained permission isolation. Multi-source heterogeneous data access requires the database to support both structured parameters and unstructured document formats, to meet storage needs for different types of ledgers. High-frequency node-level updates create sustained write pressure. Teams must configure reasonable connection pool parameters to avoid overload. Data must remain fully traceable. Operations workflows must retain complete operation logs and meet relevant data integrity requirements. Batch record review and release rely on real-time data aggregation. Database query latency must align with production timelines to avoid disrupting process progress.
Configuration Settings
These configurations are written for FastGPT v4.17.0.
| Configuration Item | Recommended Setting | Rationale |
|---|---|---|
MONGODB_URI | mongodb://fastgpt:securepass@db-host:27017/fastgpt_db?replicaSet=rs1 (adjust replica set configuration based on actual testing) | Stores unstructured batch record documents and historical data, supports multi-node high-availability deployment, and adapts to multi-source data access requirements |
PG_URL | postgresql://fastgpt:securepass@db-host:5432/fastgpt_pg?sslmode=require | Stores structured process parameters, batch ledgers, and compliance data. Enables SSL to secure data transmission |
DB_MAX_LINK | 20–30 connections | Matches the high-frequency write and query scenarios for this category, preventing database response delays caused by connection pool overload |
REDIS_URL | redis://:securepass@cache-host:6379/0 | Caches frequently queried basic batch data to reduce direct database access pressure |
| Database backup strategy | Perform full daily backups per production batch, incremental backups at key process nodes | Aligns with the batch-level data update rhythm of this category, ensuring data traceability and fault recovery capabilities |
Three common configuration errors
- FastGPT cannot start after a power outage. Symptoms include the PostgreSQL service failing to start normally and MongoDB rejecting connections. The cause is failure to configure database persistent mounting and automatic recovery scripts. Power outages cause unsynchronized cached data to corrupt database files.
- Workflow validation fails when using a database connection plugin to connect to PostgreSQL. The cause is incorrect configuration of permission parameters in the database connection string, or failure to pass the required batch ID field in the workflow.
- MongoDB connection times out. The cause is insufficient maximum connection number configured in the database connection pool, or network firewalls restricting cross-node access to database ports.
How to verify correct configuration
- Run
docker logs fastgptto view startup logs. Confirm that connection validation forMONGODB_URIandPG_URLpasses, with no timeout or permission error prompts. - Manually import a simulated batch production record. Use the FastGPT ledger query interface to retrieve associated data for that batch. Confirm that returned results are complete and fields match the preset format.
- Simulate a power outage and restart scenario. Verify that the FastGPT service and database services can automatically recover and start, with no data loss or startup failures.
- Check database connection pool monitoring metrics. Confirm that current connection count does not exceed the
DB_MAX_LINKconfiguration value, with no connection overflow events.
The values provided here are common starting points and should be evaluated against the reader's own samples.