While the relational database (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/carlamndz/InventarioITU/llms.txt
Use this file to discover all available pages before exploring further.
ubicacion-db) tracks where a machine is and who it is assigned to, MongoDB tracks what that machine is made of. Each computer in the ITU Mendoza labs has a corresponding document in the inventario-db MongoDB database that records its CPU model, RAM configuration, storage devices, and connected peripherals. MongoDB was chosen for this layer because hardware profiles are naturally document-shaped — every machine can have a different number of drives, peripheral types, or custom fields — and a schema-flexible document store avoids the friction of altering relational tables every time a new component type is introduced or a batch of machines arrives with a non-standard configuration. The project’s relational backend supports both SQL Server and MySQL; see the data model reference for details on both engines.
Document Structure
Every hardware record is stored as a single MongoDB document whose_id matches the corresponding id in the relational equipos table. This shared key is the bridge between the two databases and allows the web application to assemble a complete equipment profile (location + hardware) in one page without a cross-database join.
Field Reference
| Field | Type | Description |
|---|---|---|
_id | String | Unique machine identifier; matches equipos.id in the relational DB |
ubicacion | String | Lab room name (redundant with the relational DB record, included for standalone queries) |
cpu.modelo | String | Full processor model name |
cpu.nucleos | Number | Physical core count |
cpu.frecuencia_ghz | Number | Base clock frequency in GHz |
ram.capacidad_gb | Number | Total installed RAM in gigabytes |
ram.tipo | String | Memory standard — e.g., DDR4, DDR3 |
ram.frecuencia_mhz | Number | Memory bus speed in MHz |
almacenamiento | Array | One object per physical drive: tipo (SSD/HDD) and capacidad_gb |
perifericos | Array | List of attached peripherals — e.g., "monitor", "teclado", "mouse" |
estado | String | Hardware health — operativo, degradado, or fuera de servicio |
ultima_actualizacion | String (ISO 8601) | Date the document was last modified |
Querying Hardware Data
Theinventario-db MongoDB collection supports flexible queries against any field in the document. Below are the most common patterns used by the web application and by administrators running ad-hoc checks. These examples use the official MongoDB Node.js driver; adapt the collection name and connection setup to match your own app/ implementation once the application code is in place.
Filter by Lab
Retrieve all machines in a specific lab room:Filter by Component Type or Specification
Find machines with less than 8 GB of RAM (useful for identifying upgrade candidates):Filter by Hardware Status
List every machine currently marked asdegradado or fuera de servicio:
Updating Records
Adding a New Machine
When a new computer arrives in a lab, insert a document using the same ID that was assigned to it in the relational database (ubicacion-db). Always set ultima_actualizacion to the current date so the history stays accurate.
Updating Hardware After an Upgrade
Use$set to update individual fields without rewriting the entire document. Always bump ultima_actualizacion in the same operation.
MongoDB Service: inventario-db
The MongoDB instance runs as the inventario-db service inside the Kubernetes cluster and is accessible on port 27017 via the cluster-internal DNS name.
| Setting | Value |
|---|---|
| Service name | inventario-db |
| Port | 27017 |
| Database name | inventario |
| Primary collection | equipos_hardware |
| Driver (Node.js) | mongodb (official driver) |
When you add Kubernetes manifests for the MongoDB deployment, place them under
k8s/mongodb/. Include a PersistentVolumeClaim for data durability and a Service definition that exposes port 27017 cluster-internally. See Kubernetes deployment for guidance on the overall manifest structure.