ericdmoore / feedBarber

🍽💈💇The FeedBarber is a feed proxy that can trim up, and shape up, condition, and pretty up your unkept feeds.
MIT License
0 stars 0 forks source link

Storage Portability #14

Open ericdmoore opened 2 years ago

ericdmoore commented 2 years ago
Provider Product Name 1st TB Storage US $/GB Ingress $/GB egress $/GB per 10k requests
AWS S3 $0.023 $0.00 $0.09 after free 100Gb $0.05
Azure Blob Storage $0.018 $0.00 $0.00 / NA? $0.017 blended rate Assuming 4x read over write
GCP Cloud Storage $0.02 $0.00 $0.12 $0.05
Bunny.net Storage $0.02*replica factor $0.00 $0.00 for API - $0.01 via CDN $0.00
Cloudflare R2 $0.015 $0.00 $0.00 ~$0.01 blended @4xRead
Blackblaze B2 $0.005 $0.00 $0.01 $0.01

...etc all offer dirt cheap file storage can we abstract those away such that there is a common interface?

perhaps:


interface CloudBlobStoreInit{
   region?:string,
   prefix? : string, 
   credentials: AWSCredentials | AzureCredentials | GCPCredentials | BackBlazeCredentials | CloudflareCredentials | {}
}

interface CloudBlobStore{
  cloudName: string,
  serviceName: string,
  region: string, // name is based on Cloud Co
  list( pathprefix: string, providerData: unknown ) => AsyncIterable <{path:string,  _: ProviderSpecifics }>
  read ( path: string, providerData: unknown ) => Promise<{body: UInt8Array, _: ProviderSpecifics }>,
  write( path: string:  data: UInt8Array, providerData: unknown)=> Promise<{body: UInt8Array, _: ProviderSpecifics }>,
  delete( path: string) => Promise<{isDeleted: boolean, _: ProviderSpecifics }>
}

type CloudBlobStoreFactory = (init: CloudBlobStoreInit) => Promise<CloudBlobStore>
ericdmoore commented 2 years ago

Within a platform dashboard, the user would setup a named "blob store" using the "init" data structure - and then would be able to use it within plugin configs.

ericdmoore commented 2 years ago

The platform should define A, B, & C scenarios. with various size payloads and varied read write operations work loads...

So users could see pricing for each provider under scenario "A, B, & C" (differing by their standard definitions). Overtime, the user could collect data from their own usage - for "Scenario:Me"

ericdmoore commented 2 years ago

Is there room here for WebTorrent wrapping of these? with the file-storage as a seed? S3 -> web torrent url for example?