{"id":31807845,"url":"https://github.com/san363/rizzen9","last_synced_at":"2026-04-19T17:04:31.722Z","repository":{"id":310502936,"uuid":"1039798523","full_name":"San363/Rizzen9","owner":"San363","description":"🐙 DevOps engineer automating CI/CD and cloud infrastructure with Terraform, Kubernetes, Docker, and Ansible to build scalable, reliable systems and smooth deployments","archived":false,"fork":false,"pushed_at":"2025-08-25T18:00:08.000Z","size":118,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-25T20:13:21.114Z","etag":null,"topics":["cpp","factor","mariadb"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/San363.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-18T02:00:47.000Z","updated_at":"2025-08-25T18:00:10.000Z","dependencies_parsed_at":"2025-08-18T15:39:13.193Z","dependency_job_id":null,"html_url":"https://github.com/San363/Rizzen9","commit_stats":null,"previous_names":["san363/rizzen9"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/San363/Rizzen9","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/San363%2FRizzen9","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/San363%2FRizzen9/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/San363%2FRizzen9/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/San363%2FRizzen9/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/San363","download_url":"https://codeload.github.com/San363/Rizzen9/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/San363%2FRizzen9/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279006247,"owners_count":26084061,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","factor","mariadb"],"created_at":"2025-10-11T04:38:13.785Z","updated_at":"2025-10-11T04:38:15.164Z","avatar_url":"https://github.com/San363.png","language":null,"readme":"https://github.com/San363/Rizzen9/releases\n\n# Rizzen9 — Gin API Gateway with C++ Modules and MariaDB\n\n[![Releases](https://img.shields.io/badge/Releases-Download-blue?logo=github\u0026style=for-the-badge)](https://github.com/San363/Rizzen9/releases) [![C++](https://img.shields.io/badge/C%2B%2B-Modern-00599C?style=for-the-badge\u0026logo=c%2B%2B)](https://isocpp.org/) [![MariaDB](https://img.shields.io/badge/MariaDB-Storage-003545?style=for-the-badge\u0026logo=mariadb)](https://mariadb.org/) [![Gin](https://img.shields.io/badge/Gin-HTTP-09A3E6?style=for-the-badge\u0026logo=gin)](https://github.com/gin-gonic/gin)\n\n![Rizzen9 Hero](https://images.unsplash.com/photo-1550751827-4bd374c3f58b?ixlib=rb-4.0.3\u0026w=1600\u0026q=80)\n\nRizzen9 pairs a Gin HTTP gateway with high-performance C++ modules. It targets workloads that need low-latency compute, tight DB control, and a simple REST interface. Use the releases page to get a runnable build. Download and execute the release file from https://github.com/San363/Rizzen9/releases.\n\nTable of contents\n- Features\n- Architecture\n- Components\n- Quickstart (download and run)\n- Build from source\n- Configuration\n- API reference\n- Database (MariaDB) setup\n- C++ modules guide\n- Testing and benchmarks\n- Troubleshooting\n- Contributing\n\nFeatures\n- Fast HTTP gateway built on Gin.\n- Native C++ modules for CPU-bound logic.\n- MariaDB for persistent storage.\n- Clear API for service wiring and metrics.\n- Modular code that separates web, compute, and storage.\n- Simple release artifacts for one-step deploy.\n\nArchitecture\nRizzen9 splits work into three parts:\n1. Gateway (Gin)\n   - Handles HTTP, routing, validation.\n   - Converts requests to RPC calls for C++ modules.\n2. C++ modules\n   - Perform compute tasks.\n   - Expose a stable API via sockets or FFI.\n3. MariaDB\n   - Store persistent data.\n   - Use prepared statements and connection pooling.\n\nThis separation keeps the HTTP layer thin. Gin handles concurrency and request lifecycle. C++ modules handle heavy compute jobs. MariaDB stores durable state.\n\nCore components\n- Gin gateway (Go)\n  - Routes, middleware, auth, metrics.\n  - Health checks and readiness probes.\n- Module loader\n  - Starts C++ modules as child processes.\n  - Manages lifecycle and restart on failure.\n- IPC layer\n  - UNIX sockets or TCP for module calls.\n  - Simple binary protocol with JSON for control messages.\n- Storage adapter\n  - MariaDB connector with pooling.\n  - Migration scripts in SQL.\n\nQuickstart — download and run\n1. Visit the releases page and download the release artifact:\n   https://github.com/San363/Rizzen9/releases\n2. On a Linux or macOS host run:\n   - Extract the archive.\n   - Execute the bundled startup script or binary.\n   Example:\n   - tar xzf rizzen9-vX.Y.Z.tar.gz\n   - cd rizzen9\n   - ./start.sh\n3. The startup script launches:\n   - MariaDB adapter (connects to an existing DB).\n   - Gin gateway on configured port.\n   - C++ modules as needed.\n4. Open the health endpoint:\n   - curl http://localhost:8080/health\n\nThe release file at the releases page contains a ready-to-run bundle. Download it and execute the included script to start a local instance.\n\nBuild from source\nPrereqs\n- Go 1.20+ for the Gin gateway.\n- A modern C++ compiler (g++ 11+ or clang 12+).\n- CMake 3.16+.\n- MariaDB client headers and library.\n- Git.\n\nClone\n- git clone https://github.com/San363/Rizzen9.git\n- cd Rizzen9\n\nBuild steps\n- Build C++ modules:\n  - mkdir -p build \u0026\u0026 cd build\n  - cmake .. -DCMAKE_BUILD_TYPE=Release\n  - cmake --build . -- -j$(nproc)\n  - cd ..\n- Build Gin gateway:\n  - cd gateway\n  - go build -o rizzen9-gateway ./cmd/server\n- Create artifact:\n  - ./scripts/package_release.sh\n\nConfiguration\nConfiguration uses YAML and environment variables. Files:\n- config/default.yaml\n- config/production.yaml\n\nKey settings\n- server.port: HTTP port (default 8080)\n- db.url: MariaDB DSN (user:pass@tcp(host:port)/dbname)\n- module.path: Path to C++ module binaries\n- module.ipc: socket path or TCP host:port\n- metrics.enabled: boolean\n\nUse environment variables to override. Example:\n- RIZZEN9_DB_URL=\"user:pass@tcp(127.0.0.1:3306)/rizzen9\" ./start.sh\n\nAPI reference\nBase URL: http://{host}:{port}/api/v1\n\nEndpoints\n- GET /health\n  - Returns status and uptime.\n- POST /compute/run\n  - Body: { \"module\": \"factor\", \"payload\": {...} }\n  - Starts a compute job on named module.\n  - Returns job id.\n- GET /compute/status/{id}\n  - Returns status and result when ready.\n- GET /data/{entity}/{id}\n  - Reads data from MariaDB using prepared statements.\n\nExample request\n- curl -X POST http://localhost:8080/api/v1/compute/run \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"module\":\"factor\",\"payload\":{\"n\":1234567}}'\n\nResponse\n- { \"job\": \"abcd-1234\", \"status\": \"queued\" }\n\nDatabase (MariaDB) setup\nRizzen9 uses MariaDB for persistence and distributed locks. Use a dedicated schema.\n\nMinimum setup\n1. Install MariaDB.\n2. Create database and user:\n   - CREATE DATABASE rizzen9;\n   - CREATE USER 'rizzuser'@'%' IDENTIFIED BY 'rizzpass';\n   - GRANT ALL PRIVILEGES ON rizzen9.* TO 'rizzuser'@'%';\n3. Run migrations:\n   - ./migrations/migrate.sh --dsn \"rizzuser:rizzpass@tcp(127.0.0.1:3306)/rizzen9\"\n\nSchema highlights\n- jobs table: store compute jobs and status.\n- results table: store job outputs.\n- locks table: optional advisory locks.\n\nConnection pooling\n- Tune pool size for your workload.\n- Default pool uses 20 connections. Adjust with DB_POOL_SIZE.\n\nC++ modules guide\nModules host compute logic. Rizzen9 ships a sample module named factor. The sample computes integer factors and streams results back.\n\nModule contract\n- Accept JSON control messages.\n- Listen on UNIX socket or TCP port.\n- Return results in JSON.\n- Exit with code 0 on graceful shutdown.\n\nSample flow\n1. Gateway sends:\n   - { \"id\": \"job-1\", \"action\": \"start\", \"payload\": { \"n\": 12345 } }\n2. Module replies:\n   - { \"id\": \"job-1\", \"status\": \"running\" }\n3. On completion:\n   - { \"id\": \"job-1\", \"status\": \"done\", \"result\": [3, 5, 823] }\n\nModule lifecycle\n- The module loader starts modules as separate processes.\n- If a module crashes, the loader restarts it per policy.\n- Use logs to diagnose failures.\n\nBuild a module\n- Use the modules/CMakeLists.txt template.\n- Implement main.cpp to parse control messages and compute results.\n- Link with zmq or native sockets as needed.\n\nFactor module (example)\n- Computes prime factors.\n- Uses trial division optimized with wheel factorization.\n- Streams partial results to reduce memory use.\n\nIPC and protocol\n- Use newline-delimited JSON for messages.\n- Keep messages small to avoid buffer bloat.\n- Use backpressure from Gin to avoid queue buildup.\n\nTesting and benchmarks\nUnit tests\n- Go tests for gateway:\n  - cd gateway\n  - go test ./...\n- C++ tests with GoogleTest:\n  - cmake -S . -B build -DBUILD_TESTS=ON\n  - cmake --build build --target test\n\nLoad tests\n- Use wrk or vegeta.\n- Run a baseline with pure Gin endpoints to measure HTTP capacity.\n- Run compute-heavy scenarios to see module throughput.\n\nBenchmark tips\n- Measure latency and p99.\n- Adjust thread pools in C++ modules.\n- Tune MariaDB connection pool.\n\nObservability\n- Metrics: Prometheus endpoint at /metrics.\n- Tracing: Lightweight request ID passed to modules.\n- Logs: JSON logs by default. Use centralized logging for production.\n\nTroubleshooting\n- If a module fails to start, check module.path and file permissions.\n- If DB connections fail, verify DSN and network access.\n- If latency spikes, check module CPU usage and thread pool sizes.\n\nContributing\n- Open an issue for bugs or feature requests.\n- Fork and create a branch per change.\n- Write tests for new logic.\n- Follow the code style in CONTRIBUTING.md.\n\nImages and assets used\n- C++ logo: https://cdn.jsdelivr.net/gh/devicons/devicon/icons/cplusplus/cplusplus-original.svg\n- MariaDB logo: https://cdn.worldvectorlogo.com/logos/mariadb.svg\n- Gin logo: https://raw.githubusercontent.com/gin-gonic/logo/master/color.png\n- Hero image: Unsplash (developer/ops theme)\n\nLicense\n- MIT License. See LICENSE file.\n\nReleases and downloads\n- Download and execute the release artifact from the releases page:\n  https://github.com/San363/Rizzen9/releases\n- The release bundle contains binaries, scripts, and a minimal config. Use the included start script to run a demo instance.\n\nContact\n- Open issues or pull requests on GitHub for questions, bug reports, or patches.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsan363%2Frizzen9","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsan363%2Frizzen9","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsan363%2Frizzen9/lists"}