Help Center/ Content Delivery Network/ Best Practices/ Accelerating OBS Resources/ Synchronizing Data Stored on Multiple Clouds
Updated on 2023-12-07 GMT+08:00

Synchronizing Data Stored on Multiple Clouds

Dual-write

If data is generated on an application or generated on a client but written to an object storage service through the server, the dual-write solution is recommended. The architecture is as follows:

Applications can interconnect with SDKs of two object storage services to write files to the two object storage systems in synchronous or asynchronous mode. The upstream traffic of object storage services is free of charge. Therefore, using this architecture does not increase any cost.

Back-to-Origin

If an OBS bucket does not have the requested file, enable the back-to-origin function to redirect the client's request to the configured origin server. The data will be asynchronously obtained from the origin server and stored on Huawei Cloud Object Storage Service (OBS).

The procedure is as follows:

  1. A client requests a file from CDN.
  2. CDN retrieves the requested file from OBS.
  3. CDN receives an HTTP status code 302 from OBS if the requested file does not exist.
  4. OBS asynchronously requests the file from the configured origin server (third-party object storage service).
  5. CDN follows the redirect to obtain data from the third-party object storage service.
  6. The third-party object storage service responds to the file request from CDN.
  7. CDN returns the requested file to the client. When the client requests the same file next time, CDN directly fetches the file from OBS.

The back-to-origin function is triggered only when OBS initiates a request. Therefore, after a new file is uploaded to another object storage service, it is recommended that the application sends a GET request to OBS. The connection can then be closed without receiving entity data. This mechanism generates two copies of data traffic on another object storage service side because CDN and OBS both request the file from the configured origin server.

Serverless Upload

After a file is uploaded to another object storage service, you can use the function computing service to synchronize the file to Huawei Cloud OBS in serverless mode.

Figure 1 Serverless upload

This architecture requires users to enable the function computing service in other clouds and deploy the code for uploading files to OBS, which will generate the function computing service fee.