{
  "schema_version": "1.0",
  "organization": "p2-data-lab",
  "portal": "p2-managed-db-vector-calc",
  "live_meta_url": "https://p2-managed-db-vector-calc.pages.dev/data/meta.json",
  "openapi_url": "https://p2-managed-db-vector-calc.pages.dev/openapi.json",
  "public_datasets": [
    "https://p2-managed-db-vector-calc.pages.dev/data/db-vector-skus.json",
    "https://p2-managed-db-vector-calc.pages.dev/data/hnsw-memory-benchmarks.json"
  ],
  "calculator_inputs_schema": {
    "workload_mode": {
      "label": "Primary Architecture Pattern",
      "type": "select",
      "default": "HYBRID_OLTP_PLUS_PGVECTOR",
      "options": [
        "HYBRID_OLTP_PLUS_PGVECTOR",
        "HIGH_SCALE_KV_NOSQL",
        "DEDICATED_AI_VECTOR_SEARCH"
      ]
    },
    "oltp_storage_gb": {
      "label": "Primary Relational / Document Storage Volume (GB)",
      "type": "number",
      "default": 1200,
      "min": 10,
      "max": 100000
    },
    "peak_reads_per_sec": {
      "label": "Peak Read QPS (Queries / Point Reads per sec)",
      "type": "number",
      "default": 1500,
      "min": 1,
      "max": 500000
    },
    "peak_writes_per_sec": {
      "label": "Peak Write QPS (Inserts / Upserts per sec)",
      "type": "number",
      "default": 350,
      "min": 1,
      "max": 200000
    },
    "avg_to_peak_duty_cycle_pct": {
      "label": "Average-to-Peak Traffic Duty Cycle (% — governs Serverless vs Provisioned break-even)",
      "type": "number",
      "default": 28,
      "min": 2,
      "max": 100
    },
    "avg_item_payload_kb": {
      "label": "Average Row / Document / Metadata Size (KB)",
      "type": "number",
      "default": 2.5,
      "min": 0.25,
      "max": 400
    },
    "secondary_gsi_count": {
      "label": "Secondary Indexes (GSIs) Updated per Write",
      "type": "number",
      "default": 2,
      "min": 0,
      "max": 10
    },
    "vector_count_millions": {
      "label": "Indexed AI Embedding Vectors (Millions)",
      "type": "number",
      "default": 25,
      "min": 0,
      "max": 2000
    },
    "embedding_dimensions": {
      "label": "Embedding Dimension (e.g., 768, 1024, 1536, 3072)",
      "type": "select",
      "default": 1536,
      "options": [
        384,
        768,
        1024,
        1536,
        3072
      ]
    },
    "vector_quantization": {
      "label": "Vector Index Quantization Mode",
      "type": "select",
      "default": "FP16_2BYTE",
      "options": [
        "FP32_4BYTE",
        "FP16_2BYTE",
        "SQ8_INT8_1BYTE",
        "BINARY_BQ_0.125BYTE"
      ]
    },
    "hnsw_m_neighbors": {
      "label": "HNSW Bi-Directional Links Parameter (M)",
      "type": "select",
      "default": 16,
      "options": [
        8,
        16,
        32,
        64
      ]
    },
    "ha_multi_az_replicas": {
      "label": "HA / Read-Replica Topology Multiplier (1 = Single-AZ, 2 = Multi-AZ HA, 3 = HA + Read Replica)",
      "type": "select",
      "default": 2,
      "options": [
        1,
        2,
        3
      ]
    }
  },
  "formulas_summary": {
    "hnsw_ram_gb_required": "RAM_HNSW_GB = (vector_count_millions * 1e6 * (embedding_dimensions * bytes_per_dim(vector_quantization) + hnsw_m_neighbors * 2 * 4 + 64) * 1.20_os_buffer_headroom) / (1024^3)",
    "ddb_write_units_monthly": "WRU_mo = peak_writes_per_sec * (avg_to_peak_duty_cycle_pct / 100) * 2628000 * ceil(avg_item_payload_kb / 1.0) * (1 + secondary_gsi_count)",
    "ddb_read_units_monthly": "RRU_mo = peak_reads_per_sec * (avg_to_peak_duty_cycle_pct / 100) * 2628000 * ceil(avg_item_payload_kb / 4.0) * 0.5_eventual_or_1.0_strong",
    "ddb_on_demand_vs_provisioned": "Cost_DDB_OD = (WRU_mo / 1e6) * r_wru_million + (RRU_mo / 1e6) * r_rru_million + oltp_storage_gb * r_ddb_gb; Cost_DDB_Prov = 730 * (WCU_provisioned_with_headroom * r_wcu_hr + RCU_provisioned_with_headroom * r_rcu_hr) + oltp_storage_gb * r_ddb_gb",
    "cosmos_ru_monthly": "Cost_Cosmos = 730 * max(400, Peak_RUs_with_GSI) * r_cosmos_100ru_hr / 100 * ha_multi_az_replicas + oltp_storage_gb * r_cosmos_gb",
    "managed_pgvector_cluster": "Select minimum RAM-fitting live SKU from Azure Postgres Flexible / GCP Cloud SQL / AlloyDB where Instance_RAM_GB >= (RAM_HNSW_GB + OLTP_WorkingSet_GB); Cost_PG = 730 * Instance_Price_Hr * ha_multi_az_replicas + (oltp_storage_gb + RAM_HNSW_GB * 1.5) * r_ssd_gb_mo + Backup_Cost",
    "opensearch_serverless_vector": "OCU_search_index = max(2_or_4_min_ocu, ceil(RAM_HNSW_GB / 6.0) * 2); Cost_AOSS = 730 * OCU_search_index * r_ocu_hr + Storage_Cost"
  },
  "pro_api_endpoint": "https://p2-core-api.evsmtoken.workers.dev/v1/pro/p2-managed-db-vector-calc/dataset",
  "auth_header": "Authorization: Bearer <POLAR_LICENSE_KEY>",
  "purchase_tiers": [
    {
      "sku_key": "db-vector-sku-dataset",
      "product_id": "f5fd1834-483d-4db2-8985-935727c0f875",
      "name": "Multi-Cloud OLTP, NoSQL & Vector DB SKU Dataset (CSV/JSON)",
      "price_usd": 29,
      "billing": "one_time",
      "checkout_url": "https://buy.polar.sh/polar_cl_C2klp5ukunDIlp2Po9fwEkkrnoUD3eIXzY03p2nF8rF"
    },
    {
      "sku_key": "db-finops-pro-license",
      "product_id": "d8785b1c-b800-49e1-a3a6-6dfa3a7c9572",
      "name": "Pro Database & Vector Fleet Sizer CSV & API License Key",
      "price_usd": 24,
      "billing": "monthly",
      "checkout_url": "https://buy.polar.sh/polar_cl_xTnungqFif7zwTxQNyQ5yBIbcxJS8LYkgf8Yx3uQ2Cq"
    },
    {
      "sku_key": "staff-eng-db-finops-pack",
      "product_id": "c5840fec-3618-4793-9853-a0d3677522d1",
      "name": "Principal/VP Eng Database & RAG Vector FinOps Pack",
      "price_usd": 79,
      "billing": "one_time",
      "checkout_url": "https://buy.polar.sh/polar_cl_68sxF82SfLo6nazckBGXpfkAwf71KZKUiFwAW3oWIzR"
    }
  ],
  "master_all_portals_pass": {
    "master_all_portals_pro_monthly": {
      "product_id": "18e0b844-b764-41f0-9c3d-186362784997",
      "name": "All-Portals Master Pro API & Batch CSV License Key (Monthly)",
      "price_usd": 79,
      "billing": "monthly",
      "checkout_url": "https://buy.polar.sh/polar_cl_0P1axu2nXEDXECK8Z0k7I3sMndeo3hsdqpepv1LUcJT"
    },
    "enterprise_annual_data_pass": {
      "product_id": "8a5266eb-3aaf-4fb3-9aef-0e5bbfd17dc3",
      "name": "Annual Enterprise FinOps & Compliance Data Pass (All Portals)",
      "price_usd": 499,
      "billing": "yearly",
      "checkout_url": "https://buy.polar.sh/polar_cl_SPWfsAxuQAVHif3soxwqbq5zPAdNZFkN5CtQK3cZRft"
    }
  }
}