GCS for Data/Model Storage

इस ब्लॉग में हम Google Cloud Storage (GCS) का उपयोग सीखेंगे — datasets, ML models और application files को secure तरीके से store और manage करना।

📦 GCS for Data/Model Storage (Google Cloud Storage in Hindi)

Google Cloud Storage (GCS) Google Cloud Platform (GCP) की primary storage service है। यह scalable, secure और cost-effective storage solution है जहाँ आप datasets, trained ML models, application files और logs store कर सकते हैं। MLOps और Data Science workflows में GCS का role critical होता है, क्योंकि यह centralized storage देता है जिसे ML pipelines, APIs और analytics tools access कर सकते हैं।

🔹 GCS की Key Features

  • Scalable: किसी भी size की file (Bytes से लेकर Terabytes तक) store की जा सकती है।
  • Durable: Data multiple locations पर replicate होता है (99.999999999% durability)।
  • Secure: IAM roles और bucket-level policies से access control मिलता है।
  • Integration: BigQuery, AI Platform, Vertex AI और अन्य GCP services के साथ seamless integration।
  • Cost-effective: Multiple storage classes (Standard, Nearline, Coldline, Archive)।

🔹 GCS Bucket क्या है?

GCS में files को Objects कहा जाता है और objects हमेशा Buckets के अंदर store होते हैं। एक bucket project-specific resource है और उसमें आप datasets या models store करते हैं।

🔹 Bucket Creation Step-by-Step

  1. Console में जाएँ → Navigation Menu → Storage → Browser
  2. Create Bucket पर click करें
  3. Bucket name डालें (unique होना चाहिए)
  4. Location type चुनें (Region / Multi-Region / Dual-Region)
  5. Storage class चुनें (Standard, Nearline, Coldline, Archive)
  6. Access control define करें (Uniform / Fine-grained)
  7. Create पर click करें

⚡ Storage Classes Comparison

Storage Class Use Case Cost
Standard Frequent access (datasets for ML training) High
Nearline Access ~once a month (backup data) Medium
Coldline Access ~once a year (archival ML datasets) Low
Archive Long-term archive (rarely accessed models) Very Low

🔹 CLI और SDK Usage

आप gsutil CLI या Python SDK से भी GCS manage कर सकते हैं।

# Bucket बनाना
gsutil mb gs://my-ml-bucket/

# File upload करना
gsutil cp model.pkl gs://my-ml-bucket/models/

# File download करना
gsutil cp gs://my-ml-bucket/models/model.pkl ./
    

🔹 Security & IAM Best Practices

  • Uniform bucket-level access: सभी objects पर same permissions apply होती हैं।
  • IAM roles: सिर्फ जरूरी roles दें (Storage Admin, Storage Object Viewer)।
  • Service Accounts: ML pipelines और APIs के लिए अलग service account बनाएं।
  • Encryption: By default Google-managed keys, या custom KMS keys।
  • Lifecycle rules: Old data को automatically archive/delete करें।

⚡ Real-Life ML Example

मान लीजिए आपने एक Image Classification Model train किया है। - Training datasets (images) → gs://ml-datasets/images/ - Trained model file (model.pkl) → gs://ml-models/v1/ - API service instance model को GCS से load करता है। इस तरह GCS आपका central storage hub बन जाता है।

🏆 निष्कर्ष

Google Cloud Storage (GCS) datasets और ML models को manage करने का सबसे reliable तरीका है। चाहे आप Machine Learning pipeline बना रहे हों या production APIs deploy कर रहे हों, GCS एक secure, scalable और cost-efficient storage provide करता है। Storage classes, IAM policies और lifecycle rules को सही तरीके से configure करके आप performance और cost दोनों optimize कर सकते हैं।