DiskManagement.constants.tsx83 lines · main
1import { PlanId } from '@/data/subscriptions/types'
2
3// Disk Storage expands automatically when the database reaches 90% of the disk size
4export const AUTOSCALING_THRESHOLD = 0.9
5
6export enum DiskType {
7 GP3 = 'gp3',
8 IO2 = 'io2',
9}
10
11// [Joshen] As per https://github.com/briven/platform/pull/20478
12export const DISK_AUTOSCALE_CONFIG_DEFAULTS = {
13 growthPercent: 50,
14 minIncrementSize: 4,
15 maxSizeGb: 60000,
16}
17
18export const DISK_PRICING = {
19 [DiskType.GP3]: {
20 storage: 0.125, // per GB per month
21 iops: 0.024, // per IOPS per month, charged after 3000 IOPS
22 throughput: 0.095, // per MB/s per month, charged after 125 MB/s
23 },
24 [DiskType.IO2]: {
25 storage: 0.195, // per GB per month
26 iops: 0.119, // per IOPS per month
27 },
28}
29
30export const DISK_LIMITS = {
31 [DiskType.GP3]: {
32 minStorage: 1,
33 maxStorage: 16384,
34 minIops: 3000,
35 maxIops: 16000,
36 minThroughput: 125,
37 maxThroughput: 1000,
38 includedIops: 3000,
39 includedThroughput: 125,
40 },
41 [DiskType.IO2]: {
42 minStorage: 4,
43 maxStorage: 61440,
44 minIops: 1500,
45 maxIops: 256000,
46 includedIops: 0,
47 includedThroughput: 0,
48 },
49}
50
51interface PlanDetails {
52 includedDiskGB: { gp3: number; io2: number }
53}
54
55export const PLAN_DETAILS: Record<PlanId, PlanDetails> = {
56 free: { includedDiskGB: { gp3: 1, io2: 0 } },
57 pro: { includedDiskGB: { gp3: 8, io2: 0 } },
58 team: { includedDiskGB: { gp3: 8, io2: 0 } },
59 enterprise: { includedDiskGB: { gp3: 8, io2: 0 } },
60 platform: { includedDiskGB: { gp3: 8, io2: 0 } },
61}
62
63export const RESTRICTED_COMPUTE_FOR_IOPS_ON_GP3 = ['ci_nano', 'ci_micro', 'ci_small', 'ci_medium']
64
65export const RESTRICTED_COMPUTE_FOR_THROUGHPUT_ON_GP3 = [
66 'ci_nano',
67 'ci_micro',
68 'ci_small',
69 'ci_medium',
70]
71
72export const DISK_TYPE_OPTIONS = [
73 {
74 type: 'gp3',
75 name: 'General Purpose SSD',
76 description: 'Balance between price and performance',
77 },
78 {
79 type: 'io2',
80 name: 'High Performance SSD',
81 description: 'High performance for mission critical applications',
82 },
83]