What data this category includes
The data for this category comes from Gerber files, drill files, and BOM lists provided by the client, along with CAM system data, production equipment parameters, bath test results, AOI inspection reports, electrical testing data, and laboratory cross-section reports. Daily generated documents include engineering production instructions, Gerber analysis records, drilling and lamination parameters, chemical solution analysis records, and AOI defect reports. Data update frequency follows each production batch or each shift, with some equipment data collected continuously. Data fields cover layer specifications, drill hole diameters, lamination process temperature and pressure, defect locations and types, with units including millimeters, degrees Celsius, megapascals, and others.
What constraints these characteristics impose on database and operations
Multiple heterogeneous data sources require the database to support mixed storage of structured and semi-structured data, to accommodate different formats of production documents and equipment data. High-frequency batch updates and continuous data collection require properly configured connection pool parameters to avoid connection exhaustion during concurrent writes. Ledger queries based on production batch and time dimensions require building indexes for these dimensions to improve query efficiency. Data involving process parameters and inspection results has strict accuracy requirements, so data validation rules must be configured to prevent production issues caused by abnormal written data.
How to set configurations
| Configuration Item | Recommended Setting | Rationale |
|---|---|---|
MONGODB_URI | mongodb://<username>:<password>@<host>:<port>/fastgpt?authSource=admin | Adapts to the storage needs of PCB manufacturing multi-source heterogeneous data, supports storage of semi-structured Gerber analysis records and inspection reports, and is compatible with the FastGPT v4.17.0 database architecture |
PG_URL | postgresql://<username>:<password>@<host>:<port>/fastgpt_pcb?sslmode=require | Stores structured production batch parameters and ledger fields, supports fast indexed queries by batch and time |
DB_MAX_LINK | 20–30 connections | Matches the concurrent write volume of equipment data collected continuously per shift, prevents write failures caused by connection exhaustion |
REDIS_URL | redis://<password>@<host>:<port>/0 | Caches frequently queried production batch ledger data to reduce generation delay for summary reports |
Three common configuration mistakes
- Attempting to connect to the FastGPT local MongoDB instance via MongoDB Compass fails, with connection timeout or authentication failure prompts. The cause is incorrect configuration of access whitelists and port mappings in
MONGODB_URI, and failure to expose the corresponding MongoDB port inside the container during local Docker deployment. - Database connection errors occur after packaging and deploying via Docker, with prompts that the database address cannot be resolved. The cause is failure to correctly modify the connection parameters of
MONGODB_URIorPG_URLin the deployment configuration file or environment variables, preventing the container from accessing external database services. - After importing a production batch Excel ledger file, some drilling parameter fields are empty or have abnormal formats. The cause is a mismatch between the parameter units in the Excel file and the units preset in the database fields, and failure to uniformly convert units to millimeters or inches before import, leading to field parsing failures.
How to confirm the configuration is correct
- Run the built-in database connection test tool to verify the connection status of
MONGODB_URIandPG_URL, confirming there are no timeout or authentication failure errors. - Import a standard PCB production batch Excel file, check that all process parameter fields are properly written to the database with no null values or parsing errors.
- Submit a production ledger summary request, confirm that the report generation time meets expectations, with no prolonged timeouts or empty results.
- View the Redis cache access logs, confirm that frequently queried production batch data is correctly cached, with no frequent repeated database queries.
The values provided are common starting points and should be measured against the reader's own samples.