Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
othmanadi avatar

Schema Architect

  • 1 installs
  • 1 repo stars
  • Updated April 6, 2026
  • othmanadi/schema-architect

Design multi-database schemas for SQLite, Redis, and Neo4j with type-safe Rust and Go bindings, migrations, and validation.

About

Designs production-ready database schemas across SQLite, Redis, and Neo4j and generates type-safe Rust and Go bindings, migrations, and validation. A developer uses it to architect a multi-database system with data models and caching layers.

  • Designs multi-database schemas for SQLite, Redis, and Neo4j
  • Generates type-safe Rust and Go bindings, migrations, and validation

Schema Architect by the numbers

  • 1 all-time installs (skills.sh)
  • Ranked #770 of 911 Databases skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/othmanadi/schema-architect --skill schema-architect

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1
repo stars1
Last updatedApril 6, 2026
Repositoryothmanadi/schema-architect

What it does

Design multi-database schemas for SQLite, Redis, and Neo4j with type-safe Rust and Go bindings, migrations, and validation.

Files

SKILL.mdMarkdownGitHub ↗

Schema Architect

Production-ready database schema design for SQLite + Redis + Neo4j with Rust and Go.

Workflow

Schema design involves these steps:

1. Gather requirements (stage, databases, language, domain) 2. Select architecture pattern 3. Generate schemas per database 4. Generate language bindings 5. Generate migrations and validation 6. Validate output (run validate_schema.py)

Step 1: Gather Requirements

Determine these before generating anything:

QuestionOptionsDefault
Stageearly (MVP/startup) or advanced (scale/enterprise)early
DatabasesAny combination of sqlite, redis, neo4jAll three
Languagerust, go, or bothBoth
DomainThe business domain (e-commerce, SaaS, IoT, etc.)Ask user

If the user provides a use case without specifying these, infer sensible defaults and confirm.

Step 2: Select Architecture Pattern

Early stage — optimized for speed, simplicity, iteration:

SQLite ──── primary store (OLTP, local-first, embedded)
Redis  ──── session cache + rate limiting + pub/sub events
Neo4j  ──── relationship queries only when graph is justified

Advanced stage — optimized for scale, observability, governance:

SQLite ──── edge/embedded nodes, local write-ahead, sync buffer
Redis  ──── distributed cache, streams pipeline, leaderboards
Neo4j  ──── knowledge graph, access control graph, recommendation engine

For integrated multi-DB architectures, read references/integration-patterns.md.

Step 3: Generate Schemas

For each selected database, read the corresponding reference and apply its patterns:

  • SQLite: Read references/sqlite.md — normalization, WAL mode, strict typing, indexes
  • Redis: Read references/redis.md — key namespacing, TTL policies, cache-aside pattern
  • Neo4j: Read references/neo4j.md — node labels, relationship types, Cypher constraints

Apply naming conventions from references/naming-conventions.md to ALL generated schemas.

Output per database

DatabaseFiles Generated
SQLiteschema.sql, migration files in migrations/ dir
Redisredis-schema.toml (key namespace + TTL config)
Neo4jconstraints.cypher, schema.cypher

Use templates from templates/ as starting points — fill in entity-specific content.

Step 4: Generate Language Bindings

For each selected language, read the corresponding reference:

  • Rust: Read references/rust-bindings.md — sqlx/diesel/sea-orm, redis-rs, neo4rs
  • Go: Read references/go-bindings.md — database/sql/gorm, go-redis, neo4j-go-driver

Generate type-safe model structs with proper derives/tags, connection helpers, and repository patterns.

Output per language

LanguageFiles Generated
Rustmodels.rs, db.rs (connection pool), cache.rs, graph.rs
Gomodels.go, db.go, cache.go, graph.go

Step 5: Generate Migrations and Validation

Generate versioned migration files following references/migration-patterns.md:

  • Timestamped filenames: YYYYMMDDHHMMSS_description.sql
  • Every migration has an up and down section
  • Include audit trail columns: created_at, updated_at, version
  • For advanced stage: add created_by, deleted_at (soft delete), tenant_id (multi-tenancy)

Step 6: Validate

Run the validation script against all generated files:

python3 /home/ubuntu/skills/schema-architect/scripts/validate_schema.py <output_directory>

The script checks naming conventions, foreign key consistency, index coverage, and migration ordering. Fix any reported issues before delivering.

Enterprise Patterns by Stage

Early Stage Patterns

Apply these for MVPs, prototypes, and startups:

PatternImplementation
Single-tenant SQLiteOne DB file per deployment, WAL mode, STRICT tables
Session cacheRedis strings with session:{user_id} keys, 24h TTL
Rate limitingRedis sorted sets with sliding window per API key
Simple relationshipsSQLite foreign keys first; Neo4j only if graph queries emerge
Soft deletedeleted_at column, never hard-delete user data
Optimistic lockingversion INTEGER NOT NULL DEFAULT 1 on mutable tables

Advanced Stage Patterns

Apply these for production systems at scale:

PatternImplementation
Multi-tenant isolationtenant_id on every table, row-level security, Redis key prefix t:{tid}:
CQRSSQLite for writes, Redis for read-through cache, Neo4j for complex queries
Event sourcingRedis Streams as event log, SQLite as snapshot store
Distributed cacheRedis Cluster with consistent hashing, cache-aside + write-through
Graph access controlNeo4j (:User)-[:HAS_ROLE]->(:Role)-[:PERMITS]->(:Resource)
Schema versioningMigration table with checksums, rollback scripts, blue-green deploys
Audit trailSeparate audit_log table with entity_type, entity_id, action, diff_json
Connection poolingRust: sqlx::Pool / Go: sql.DB with SetMaxOpenConns, Redis pool per service

Key Principles

These rules apply to ALL generated schemas regardless of database or stage:

1. Normalize to 3NF minimum — denormalize only with measured justification 2. Every table gets a primary key — prefer INTEGER PRIMARY KEY (SQLite) or UUIDs (distributed) 3. Every foreign key gets an index — no exceptions 4. Timestamps on everythingcreated_at and updated_at with UTC, never local time 5. Constraints at the DB level — NOT NULL, CHECK, UNIQUE enforced in schema, not just app code 6. Redis keys are namespaced{service}:{entity}:{id}:{field} pattern always 7. Neo4j relationships are verbsFOLLOWS, PURCHASED, BELONGS_TO, never nouns 8. Migrations are immutable — never edit a deployed migration, always create a new one 9. Document everything — inline SQL comments on non-obvious columns, README per schema dir

Related skills

Databasesdatabasesetl

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.