Cloud Storage Gateway (CSG) is a gateway service that can be deployed in on-premises data centers and on Alibaba Cloud. CSG uses Alibaba Cloud Object Storage Service (OSS) buckets as backend storage and provides standard file services through the Network File System (NFS) and Server Message Block (SMB) protocols, as well as block storage services through the Internet Small Computer Systems Interface (iSCSI) protocol.
CSG supports two types of gateways:
-
File gateways
File gateways map objects and folders in OSS buckets to files and directories in File Storage NAS file systems. You can read and write objects in a specified OSS bucket through standard NFS and SMB protocols. File gateways use local storage to cache hot data, providing high-performance access to the large storage space of OSS buckets. File gateways are compatible with Portable Operating System Interface (POSIX) and third-party backup software. For small file backup or sharing, we recommend standard or basic file gateways. For high performance requirements or multi-client concurrent access to shared data, we recommend enhanced or advanced file gateways.
-
Block gateways
Block gateways create storage volumes in OSS and allow you to access OSS through the iSCSI protocol. Local applications can access these volumes as iSCSI targets. Block gateways operate in two modes: write-through and cache. In write-through mode, volume data is sliced and synchronized to the cloud, which suits scenarios with high-speed links such as leased lines. In cache mode, local cache disks accelerate read and write operations and transfer cached data to the cloud asynchronously, which suits scenarios that require fast local data access and transfer data to OSS in a normal speed.
Scenarios
CSG is applicable to the following scenarios:
-
Storage scale-out and data migration
CSG uses intelligent caching algorithms to automatically identify hot and cold data. Cold data is stored in the cloud while hot data is retained in the local cache for fast access. When you connect your on-premises data center to cloud storage, users can access data seamlessly. This enables you to expand storage from your data center to the cloud. CSG also stores a full copy of data in the cloud to guarantee data integrity.
-
Cloud disaster recovery
As more users run workloads in the cloud, the reliability and continuity of these workloads become critical. CSG supports virtualization technologies, allowing you to connect third-party services to Alibaba Cloud services for disaster recovery.
-
Data sharing and distribution in multiple regions
You can deploy CSG instances in multiple regions and associate them with the same OSS bucket to share and distribute files across regions. This is useful for branch offices that need to synchronize and share data.
-
Compatibility with legacy applications
Some users run both legacy and modern applications in the cloud. Legacy applications migrated from on-premises data centers use standard storage protocols such as NFS, SMB, and iSCSI, while modern applications typically support object access protocols. Communication between applications that use different protocols is complex. CSG bridges these protocols and enables data exchange between legacy and modern applications.
-
An alternative to ossfs and ossftp
ossfs and ossftp are open-source tools for uploading files to OSS through file protocols. However, they are not recommended for production environments due to low POSIX compatibility. Mounting file systems to multiple clients with ossfs or ossftp requires additional configuration and can be time-consuming. As an alternative, CSG lets you create a gateway instance and mount an NFS share in Linux or map an SMB share to a network drive in Windows. You can then manage data in OSS buckets the same way as in a local file system.
Performance
CSG is deployed between applications and OSS. Therefore, CSG performance depends on multiple factors, including local disk speed and configuration, bandwidth between the iSCSI initiator and the gateway, storage capacity allocated to the gateway virtual machine, and bandwidth between the gateway virtual machine and OSS. To achieve low-latency data access, configure sufficient local cache for recently accessed data. The recommended cache capacity can be calculated as: Recommended local cache capacity = [Application bandwidth (Mbit/s) - Backend bandwidth of the gateway (Mbit/s)] × Write duration (seconds) × 1.2. For better local access performance, estimate the total amount of hot data, compare it with the recommended cache capacity, and use the larger value as the local cache disk capacity. Gateway synchronization bandwidth depends on OSS bandwidth. OSS provides up to 10 Gbit/s of bandwidth per user. Bandwidth varies slightly among clusters in different regions. For more information, contact OSS technical support in the relevant region.
CSG supports the transfer acceleration feature that increases the data transfer rate across regions by using the public bandwidth of gateways. You can enable transfer acceleration when or after you create a share.
Data durability and service availability
In cache mode, data is written to disk using synchronous I/O to prevent data loss from power failures. CSG ensures the durability and reliability of local cache data by using Alibaba Cloud disks. The reliability of on-premises gateways depends on your virtual environment's backend storage. We recommend that you use RAID storage or a distributed storage system for local cache disks. CSG refreshes and uploads data from local cache disks to OSS buckets. Alibaba Cloud OSS guarantees 99.9999999999% (twelve 9's) designed data reliability, ensuring data security when transferring data from CSG to Alibaba Cloud.
Scalability and elasticity
CSG uses OSS buckets as backend storage, inheriting the scalability and elasticity of OSS. Unlike common file systems where storing large numbers of files in a single directory can cause issues, OSS has no limit on total storage capacity or the capacity of a single bucket. You can store an unlimited number of objects in a bucket. OSS stores copies of your data on different servers in the same region, all backed by the high-performance infrastructure of Alibaba Cloud.
Security
CSG supports user identity management and resource access control through Resource Access Management (RAM). RAM allows you to create and manage multiple RAM users under an Alibaba Cloud account and grant specific permissions to each user. This lets you control access to different Alibaba Cloud resources without sharing your AccessKey pairs. You can assign minimal permissions to each RAM user to reduce security risks. For more information, see Use RAM to implement account-based access control.
CSG encrypts data transferred from gateways to OSS buckets. You can also enable OSS server-side encryption and configure a CMK so that files uploaded from a share to OSS are automatically encrypted using the specified CMK.
Operations
On the CSG console, you can deploy a gateway virtual machine to an on-premises data center or an ECS instance, configure file or block gateways, and create cache disks and shares. You can also manage CSG through API operations that support sending GET requests using HTTP or HTTPS.
Cost model
CSG is billed based on resource usage. Cloud-deployed gateways are billed based on gateway specifications, cache types, and public network bandwidth, and support both pay-as-you-go and subscription billing. On-premises gateways run on your own virtual machines and cache resources, and Alibaba Cloud charges only for the gateway software license. For more information, see Billable items and billing methods.