ArticlesProjectsWeeklyCredentialsAbout

MySQL Schema Design for NMS (1997)

The full DDL for a network management database: normalised tables for devices, interfaces, metrics and alarms, with indexes tuned for the query patterns that actually appear in monitoring systems.

mysqldatabasessqlschema-design

A normalised network management schema — devices, interfaces, metrics, alarms — with the indexes that make it fast.

Source code
# MySQL Schema for NMS (1997)

Code from the article [Relational Database Design with MySQL: Getting the Schema Right](https://rishisharma.in/articles/mysql-relational-design-98).

Requires MySQL 3.22+.

```sh
# Create the database and load the schema
mysql -u root -p < schema.sql

# Load sample data
mysql -u root -p nms_db < seed_data.sql

# Run the example queries
mysql -u root -p nms_db < queries.sql
```

## Contents

- `schema.sql` — DDL: tables, primary keys, foreign keys, indexes
- `seed_data.sql` — sample rows for devices, interfaces, metrics, alarms
- `queries.sql` — representative SELECT patterns with EXPLAIN comments