What this category’s data looks like
Infrastructure construction ledger data originates from construction logs, material incoming acceptance receipts, equipment operation and maintenance records, and monthly progress reports. Data update frequency aligns with business milestones. Construction logs are updated daily, material incoming records are updated immediately per batch, and monthly progress reports are archived by calendar month. Each document includes fields such as project unique identifier, construction node name, material category and specification, incoming/operation quantity, corresponding date, responsible team number, and more. Units include cubic meters, tons, operating hours, calendar days, and other standard units.
What constraints these characteristics impose on database and operations workflows
Multiple heterogeneous data sources cause fluctuations in write concurrency. Batch write conflicts may occur during peak periods. Databases must support transactional writes and idempotency checks. Different update frequencies across business milestones require flexible write scheduling for the database, to avoid resource contention. The variety of fields and units requires pre-configured unified field mapping rules, to prevent type mismatches or unit confusion during data import. Large volumes of archived historical ledger data require tiered storage strategies, separating hot and cold data to reduce operation and maintenance costs. Additionally, the timeliness requirements for construction ledgers demand stable, low-latency database connections.
How to set configurations
| Configuration Item | Recommended Value | Rationale |
|---|---|---|
MONGODB_URI | mongodb://user:pass@host:port/dbname?replicaSet=rs0&readPreference=secondaryPreferred | Infrastructure construction ledgers have multi-source write requirements. Replica set configuration improves read availability and write fault tolerance. The secondaryPreferred read preference distributes read requests to reduce pressure on the primary node. |
PG_URL | postgresql://user:pass@host:port/report_db?sslmode=require | Monthly summary reports require multi-table joins. PostgreSQL's relational features are suitable for storing structured report data. sslmode=require ensures secure transmission of sensitive construction data. |
DB_MAX_LINK | 20–30 | The peak concurrent write volume for single-project construction data is approximately 10 writes per minute. Reserving sufficient connection counts avoids connection exhaustion, while preventing excessive connections from occupying server resources. |
REDIS_URL | redis://:password@host:port/0?maxmemory-policy=allkeys-lru | Used to cache frequently accessed construction node metadata and report templates. The allkeys-lru policy automatically cleans expired cache, ensuring reasonable use of memory resources. |
| Cache expiration time | 12 hours | Construction node metadata changes infrequently. A 12-hour cache cycle balances query performance and data timeliness. |
Three common configuration mistakes
- Symptom: Database connection timeout. mongosh can connect normally, but the FastGPT application cannot access the database. Cause: The
MONGODB_URIconfigured in FastGPT does not have a correct network access whitelist. Only local mongosh access is allowed, and the IP range of the application deployment node is not added. - Symptom: Synchronization fails because historical version documents lack the
tmbIdfield. Cause: Field completion was not performed for existing ledger data in advance, per the requirements of FastGPT v4.17.0. Historical data migration verification was not enabled. - Symptom: Duplicate data records appear during concurrent writes. Cause: Idempotent write verification was not configured. A unique identifier constraint was not added for individual ledger entries, leading to multiple duplicate construction ledger entries being generated when submissions are repeated.
How to confirm configuration is correct
- Run a test write command, submit a simulated construction ledger entry, and check whether the corresponding record exists in the database. Verify that field mapping and unit conversion meet expected requirements.
- Simulate concurrent write requests from multiple nodes, check the database connection pool usage, and confirm that the connection count does not exceed the
DB_MAX_LINKconfiguration limit. - Access the generated ledger report page, check that the data in the report matches the original ledger stored in the database. Confirm that the data synchronization link is working properly.
- Check the cache service logs, confirm that frequently accessed metadata can be cached normally and updated on schedule. Confirm that the
REDIS_URLconfiguration is effective.
The values provided are common starting points, and should be evaluated against the relevant deployment’s own data samples.
Question material comes from public community discussions. Configuration values are common starting points and should be measured against your own samples. Verified on 2026-09-28.