Data Profile for This Category
This category’s data includes casting process cards, batching lists, heat records, mold histories, first-piece inspection records, and material test reports. Data sources include ERP material master data, melting furnace thermometers, spectrometers, MES heat records, mold management systems, and customer technical drawings.
Data updates trigger per heat, per batch, or daily. Individual records contain fields such as alloy composition percentage, pouring temperature, mold cycle, defect type, and more. Units include percentage, degrees Celsius, kilograms, and other standard units.
Constraints on Database and Operations Maintenance
Multi-source heterogeneous data sources require databases to support mixed storage of structured and unstructured data. High-frequency heat and batch updates require adequate concurrent connection counts to avoid write blocking. Fields include specialized unit-bearing parameters such as alloy composition percentage and pouring temperature. Predefined field validation rules prevent format errors. Strong association between heat numbers and mold cycles requires databases to support associated queries. Expired heat logs must be cleaned regularly to control storage capacity.
Configuration Recommendations
| Configuration Item | Recommended Value | Rationale |
|---|---|---|
PG_URL | postgresql://foundry_user:secure_pass@db-host:5432/foundry_prod?sslmode=require | Stores structured ledger data such as heat records and batching lists. Requires SSL encryption to secure sensitive parameter data |
DB_MAX_LINK | 15–25 | Matches write concurrency of approximately 20 heats per day for a single workshop, with redundancy reserved for batch report generation scenarios |
REDIS_URL | redis://redis-auth:redispass@redis-host:6379/1 | Caches frequently queried heat statistics and mold history data to reduce primary database load |
MONGODB_URI | mongodb://mongo-user:mongo-pass@mongo-host:27017/foundry_docs?authSource=admin | Stores unstructured documents such as casting process cards and material test reports, supports full-text search and attachment association |
| Automatic database cleanup cycle | 7 days | Regularly cleans expired heat logs to control database storage capacity |
Three Common Misconfigurations
- A "connection refused" or "invalid credentials" error occurs when connecting to the database. The cause is incorrect configuration of the username, password, or port parameters in
PG_URL, or the database port not being exposed for the Docker container. - A "too many connections" error appears during batch report generation. The cause is failure to set
DB_MAX_LINKto a value matching actual concurrency requirements, leading to connection pool exhaustion. - SQL data extraction fails after configuring the database connection. The cause is failure to select the appropriate database type based on ledger data structure. Structured ledger data is suitable for storage with PostgreSQL.
How to Verify Successful Configuration
- Use the database testing tool included with FastGPT v4.17.0 to attempt reading the three most recent heat records, confirming the connection is functional.
- Submit 10 batch heat write requests, check for connection exhaustion errors to verify the
DB_MAX_LINKconfiguration takes effect. - Inspect Redis cached heat statistics data to confirm update frequency matches business requirements.
- Upload a casting process card to verify storage and retrieval functionality for unstructured documents works correctly.
The values provided are common starting points and should be measured against the reader's own samples.