Skip to content

Latest commit

 

History

History
141 lines (112 loc) · 5.31 KB

File metadata and controls

141 lines (112 loc) · 5.31 KB

YDB Capacity Calculator

Overview

The YDB Capacity Calculator is a single-page web application designed to help capacity planners determine server requirements for YDB clusters. The application implements two key use cases:

  1. Calculate Servers Needed: Determine how many servers are required based on specific capacity requirements
  2. Calculate Capacity Provided: Determine what capacity is provided by a given server configuration and server count

This tool implements all the business rules specified in the YDB capacity planning documentation.

Features

  • Dual Functionality: Toggle between calculating server requirements or provided capacity
  • Comprehensive Input: Capture all relevant server configuration parameters
  • Business Rule Compliance: Implements all YDB capacity planning business rules
  • Real-time Calculation: Instant results based on user inputs
  • Data Persistence: Server configuration automatically saved in local storage
  • Responsive Design: Works on desktop and mobile devices
  • Error Handling: Clear validation and error messages
  • YDB Branding: Uses official YDB colors and styling

Getting Started

  1. Clone or download this repository
  2. Open index.html in any modern web browser
  3. Start calculating your YDB capacity requirements!

Deployment

The application is deployed to Yandex Cloud S3 bucket with static website hosting:

Quick Deploy

./deploy.sh

For detailed deployment instructions, see How to Deploy.

Documentation

The project includes comprehensive documentation in the docs folder:

User Documentation

Technical Documentation

Deployment Documentation

Usage

Servers Needed Mode

  1. Click the "Calculate Servers Needed" toggle
  2. Enter your server configuration parameters
  3. Enter your capacity requirements
  4. Click "Calculate Servers" to see the results

Resources Provided Mode

  1. Click the "Calculate Capacity Provided" toggle
  2. Enter your server configuration parameters
  3. Enter the number of servers in your configuration
  4. Click "Calculate Capacity" to see the results

Business Rules Implemented

  • Storage groups consist of 9 VDisks each
  • Reserve calculation (1% or minimum 18 VDisks)
  • System resource reservations (CPU cores and RAM)
  • Storage device resource reservations
  • Minimum server count enforcement (12 servers)

Technical Implementation

  • Frontend: HTML5, CSS3, Vanilla JavaScript
  • Storage: Browser local storage for configuration persistence
  • Architecture: Single-page application with dynamic UI updates
  • Validation: Client-side input validation with user-friendly error messages

Browser Support

The application works in all modern browsers that support:

  • HTML5
  • CSS3
  • JavaScript ES6+
  • Local Storage

Development

Running Tests

Browser-based Smoke Tests (Recommended)

  1. Open test-runner.html in your web browser
  2. Click "Run All Tests"
  3. View results in real-time

See Smoke Tests Documentation for detailed information.

Node.js Unit Tests

npm test

Project Structure

ydb-capacity-calculator/
├── index.html          # Main application entry point
├── css/               # Stylesheets
│   ├── styles.css     # Application styles
│   └── ydb-tech.css   # YDB technical styles
├── js/                # JavaScript files
│   ├── calculator.js  # Main calculator logic
│   └── core.js       # Core calculation functions
├── images/            # Image assets
├── docs/              # Documentation
├── test/              # Node.js test files
├── test-runner.html   # Browser-based smoke tests
├── deploy.sh          # Deployment script
└── deply/             # Deployment configuration
    └── settings.txt   # S3 credentials (not in git)

Contributing

  1. Make changes to the application files
  2. Test locally by opening index.html in a browser
  3. Run smoke tests: Open test-runner.html and click "Run All Tests"
  4. Run unit tests: npm test
  5. Deploy: ./deploy.sh

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Support

For questions about using this calculator, please refer to the YDB documentation or contact YDB support.