@codai/cbd
Version:
Codai Better Database - High-Performance Vector Memory System with HPKV-inspired architecture and MCP server
119 lines • 3.17 kB
TypeScript
/**
* Intelligent Cloud Selection Engine
* Dynamically selects optimal cloud provider for each operation
* Based on performance, cost, latency, and availability criteria
*/
export type CloudProvider = 'aws' | 'azure' | 'gcp' | 'local';
export interface OperationCriteria {
scale: number;
consistency: 'strong' | 'eventual' | 'session';
latencyRequirement: number;
serverless: boolean;
analytics: boolean;
globalDistribution: boolean;
aiFeatures: boolean;
enterpriseSecurity: boolean;
documentProcessing: boolean;
machineLearning: boolean;
strongConsistency: boolean;
bigData: boolean;
realTimeAnalytics: boolean;
costSensitive: boolean;
}
export interface CloudScore {
provider: CloudProvider;
score: number;
reasoning: string[];
estimatedCost: number;
estimatedLatency: number;
}
export interface CloudSelectionResult {
selectedProvider: CloudProvider;
scores: CloudScore[];
confidence: number;
reasoning: string;
}
export type CloudSelectionStrategy = 'performance' | 'cost' | 'latency' | 'availability';
export declare class IntelligentCloudSelector {
private strategy;
private costMetrics;
private latencyMetrics;
constructor(strategy?: CloudSelectionStrategy);
/**
* Select optimal cloud provider for operation
*/
selectOptimalCloud(operationType: string, criteria: Partial<OperationCriteria>): Promise<CloudSelectionResult>;
/**
* Score all cloud providers for given criteria
*/
private scoreAllClouds;
/**
* Score individual cloud provider
*/
private scoreCloudProvider;
/**
* Score AWS for given criteria
*/
private scoreAWS;
/**
* Score Azure for given criteria
*/
private scoreAzure;
/**
* Score GCP for given criteria
*/
private scoreGCP;
/**
* Score local deployment
*/
private scoreLocal;
/**
* Apply strategy-specific weighting
*/
private applyStrategyWeighting;
/**
* Build full criteria with defaults
*/
private buildFullCriteria;
/**
* Calculate confidence in selection
*/
private calculateConfidence;
/**
* Generate human-readable reasoning
*/
private generateReasoning;
/**
* Cost estimation methods
*/
private estimateAWSCost;
private estimateAzureCost;
private estimateGCPCost;
/**
* Latency estimation methods
*/
private estimateAWSLatency;
private estimateAzureLatency;
private estimateGCPLatency;
private estimateLocalLatency;
/**
* Get average latency for provider
*/
private getAverageLatency;
/**
* Record performance metrics
*/
recordPerformanceMetric(provider: CloudProvider, latency: number, cost: number): void;
/**
* Update selection strategy
*/
setStrategy(strategy: CloudSelectionStrategy): void;
/**
* Get current performance metrics
*/
getMetrics(): Record<CloudProvider, {
avgLatency: number;
avgCost: number;
}>;
}
//# sourceMappingURL=IntelligentCloudSelector.d.ts.map