Skip to main content

A tool to autonomously spin up dockerized PostgreSQL databases.

Project description

🚀 Blitzkrieg ⚡

The Ultimate Database Operations Manager

Automate, manage, and scale your database operations seamlessly with Docker and Kubernetes.

OverviewFeaturesAdvanced FeaturesZero-Config AutomationPrerequisitesInstallationUsageDatabase SupportScaling and Load BalancingUser FlowsError HandlingSecurityCLI CommandsContributingMonitoring and AlertsFAQRoadmapSupportAcknowledgementsLicense


Badges

Version Python 3.7+ License


Overview

Blitzkrieg is a comprehensive tool aimed at simplifying database operations. It offers automation, scalability, and a beautiful CLI interface. Whether you are looking to spin up a PostgreSQL or Vector database, Blitzkrieg has you covered. It even manages pgAdmin instances, all containerized via Docker and orchestrated through Kubernetes.


Current Features

  • Easy Setup: A single command deploys a fully functional PostgreSQL database, eliminating complex setup procedures and minimizing time to deployment.
  • Beautiful CLI: Powered by Rich and Questionary, this CLI elevates your interaction with terminal operations, providing an aesthetically pleasing and intuitive user experience.
  • Docker Integration: Ensures seamless containerization of databases and pgAdmin instances, providing a consistent environment for development and production.
  • Automated Local PgAdmin Server Instance Creation: Automatically spins up a local PgAdmin server instance with pre-configured settings, allowing for immediate web-based database management.
  • Automated Postgres Instance Creation: Initiates and manages PostgreSQL instances with tailor-made configurations, streamlining database provisioning and ensuring optimal settings for performance.

Upcoming Features

  • Auto-Configuration for PostgreSQL in PgAdmin: Automate the initial setup and registration of PostgreSQL servers in the pgAdmin interface, allowing you to manage and access your servers from the get-go under the 'Servers' group in the pgAdmin UI.
  • Built-In Meta-Database: Incorporate a self-managed meta-database that centralizes the management and orchestration of all database instances, streamlining operations and providing a unified view of system health and metrics.
  • Automated Backups: Implement scheduled backups to safeguard your data, with restoration capabilities for resilience against data loss.
  • Kubernetes Support: Leverage Kubernetes to facilitate automatic scaling and ensure high availability of your database instances.
  • Load Balancing: Distribute incoming database traffic evenly across instances to maintain performance and availability.
  • Monitoring and Alerts: Integrate with Prometheus and Grafana to provide real-time monitoring and alerting for your databases, ensuring you're always informed of their status.

Zero-Config Automation 🤖

With Blitzkrieg's Zero-Config Automation, you don't have to worry about the nitty-gritty details of setting up databases. Here's how it can work:

Database Details

Upon initialization, Blitzkrieg will auto-generate the database names, table schemas, and other essential details based on the project name and environmental context. This takes the guesswork out of naming conventions and schema structures, and it ensures that your database setup adheres to best practices.

Credentials

Blitzkrieg will automatically generate secure credentials for your databases. These credentials are then encrypted and stored in a secure vault that only authorized users can access. This eliminates the need for manual password management while enhancing security.

Kubernetes Configuration

Blitzkrieg comes with a set of best-practices templates for Kubernetes. These templates define how your databases should be orchestrated, scaled, and managed. You don't have to be a Kubernetes expert to benefit from its powerful features.

Meta-Database

A meta-database will be auto-generated during the initialization process. This database will contain tables that help in managing the instances you deploy. Each entry will have metadata like instance name, status, health metrics, and more, allowing for easy management and monitoring.

pgAdmin

Blitzkrieg will automatically deploy a pgAdmin instance and connect it to your PostgreSQL databases using the securely generated credentials. This means you get a fully functional, ready-to-use database management UI right out of the box.

Application Connection

If Blitzkrieg detects a common programming language or framework in your project, it will auto-inject the necessary code snippets and environment variables to establish a database connection. This saves you the hassle of manually updating your application code to connect to the new databases.

Scaling and Monitoring

Blitzkrieg uses sensible defaults to handle scaling and monitoring. If the system detects high resource utilization, it will automatically trigger scaling operations. Monitoring is handled via integrated support for Prometheus and Grafana, providing real-time insights into your databases' performance.

Backups

Blitzkrieg sets up a standard backup process that runs at regular intervals. This ensures that your data is safe and that you can recover quickly in case of any mishaps.

By integrating these features into a seamless, automated process, Blitzkrieg eliminates the need for manual configuration and lets you focus on what matters most: building and scaling your applications.


Prerequisites

  • Python 3.7 or higher
  • Docker installed and running
  • Kubernetes cluster (for advanced features)

Installation

Install Blitzkrieg using pip:

pip install blitzkrieg

Usage

Initialize a PostgreSQL database and pgAdmin with:

blitz init postgres pgadmin

Follow the on-screen prompts to customize your setup.

Blitzkrieg Create Project Flow


Database Support

Currently supports:

  • PostgreSQL
  • Vector databases (Coming Soon!)

Scaling and Load Balancing

Blitzkrieg utilizes Kubernetes to automatically scale your database operations. Consult our Kubernetes guide for more details.


User Flows

Database Initialization

  1. Run blitz init to initialize your databases and a meta-database.
  2. The meta-database is created with tables to manage instances.
  3. Credentials are generated and stored securely.

Connecting Existing Codebases

  1. Use blitz connect to connect existing codebases to a new database.
  2. The command detects the programming language and injects the necessary database connection code.
  3. Environment variables for the database connection are set automatically.

Error Handling

Blitzkrieg employs advanced error-handling mechanisms:

  • Retry Mechanisms: For handling transient failures.
  • Circuit Breakers: To prevent overloading services.
  • Detailed Logs: For effective debugging and traceability.

Security

  • Vault Integration: All sensitive data like database credentials are securely stored.
  • RBAC: Role-based access control is implemented for all database instances.
  • Data Encryption: All data is encrypted both at rest and in transit.

CLI Commands

  • blitz init: Initialize your databases and a meta-database.
  • blitz connect: Connect an existing codebase to a new database.
  • blitz deploy: Deploy databases to a Kubernetes cluster.
  • blitz scale: Scale your database instances up or down.
  • blitz backup: Trigger an immediate backup of your databases.

Contributing

Community contributions are always welcome! Please read our Contributing Guidelines for more details.


Monitoring and Alerts

Blitzkrieg is integrated with Prometheus and Grafana. This allows you to set up dashboards for real-time monitoring and configure alerts based on various metrics.


FAQ

Q: How do I connect multiple codebases?
A: Use blitz connect for each codebase.

Q: Can Blitzkrieg be used for non-Python projects?
A: Yes, Blitzkrieg is language-agnostic when it comes to managing databases.


Roadmap

  • Support for additional database types like MySQL and MongoDB.
  • Real-time performance analytics.
  • Advanced caching mechanisms.

Support

If you encounter issues or have feature requests, please open an issue on our GitHub Repository.


Acknowledgements

A special thanks to the open-source community and the libraries and tools that made this project possible.


License

Blitzkrieg is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

blitzkrieg-0.1.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

blitzkrieg-0.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file blitzkrieg-0.1.tar.gz.

File metadata

  • Download URL: blitzkrieg-0.1.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for blitzkrieg-0.1.tar.gz
Algorithm Hash digest
SHA256 1626667a412b98e1af951aa980c02a6c7741a7b6a5a1a61c10f922cc03910bdd
MD5 e4a2873cef85eca574b07eedd1073cc6
BLAKE2b-256 1c91fc92a483922d24191c3bb2c1b7dac2eb02eb4a45848426f6f5cf2aea8675

See more details on using hashes here.

File details

Details for the file blitzkrieg-0.1-py3-none-any.whl.

File metadata

  • Download URL: blitzkrieg-0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for blitzkrieg-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 353498ef140bdb19261b13c52e7b75df69864aaf737c653ebef6a45a1fd10d1f
MD5 6fe2fc8cdc9817cb425ccb84d3c1c517
BLAKE2b-256 eea4101f528c940f2944038a9e0acd54192cf68cb10a63755742d9dd86b5462a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page