Updated on 2024-01-02 GMT+08:00

Back to Source

When a client does not access the requested data in OBS, the 404 error is returned. However, OBS provides the back-to-source function to help you obtain the requested data from its source site if it is not found in OBS.

Back-to-Source by Mirroring

If a mirroring back-to-source rule is configured for an OBS bucket and the requested data is not found in the bucket, the system will retrieve the data, when the back-to-source rule applies to the data, from the origin server, upload it to the bucket, and then return it to the requesting client. This process does not interrupt services. Therefore, you can use this function to seamlessly migrate data from the origin server to OBS, or migrate services to OBS without being sensed by users, at low costs. Figure 1 illustrates the mirroring back-to-source process.

Figure 1 Back-to-source by mirroring

Constraints

Bucket versions

  • Only buckets of version 3.0 or later support the mirroring back-to-source function.

Time

  • A mirroring back-to-source rule takes effect five minutes later after any change to the rule.

Regions

Back to source is only available in some regions. For details, see Function Overview.

Number of rules

  • A maximum of 10 mirroring back-to-source rules can be configured for a bucket.

Functions

  • Anonymous users cannot configure mirroring back-to-source rules for a bucket.
  • Parallel file systems do not support mirroring back-to-source rules.
  • A mirroring back-to-source rule is not compatible with the static website hosting function. Specifically, if a 404 error occurs when objects are downloaded from an OBS hosted static website domain, it does not trigger the mirroring back-to-source process.
  • The bucket, to which a back-to-source rule is configured, cannot be specified as the source site.
  • Currently, mirroring back to source from private buckets is supported for only some cloud vendors.
  • The origin server cannot transfer data in Transfer-Encoding: chunked mode. That is, the response to the request for downloading an object from the origin server must contain the Content-Length header to specify the size of the source object.

    Specifically, in the Create/Edit Back-to-Source Rule window, you cannot specify Accept-Encoding for Do not pass specified parameters under the Pass all parameters option of HTTP Header Pass Rule.

    Figure 2 Configuration method

Permissions

  • To configure, obtain, or delete mirroring back-to-source rules, you must have the Tenant Administrator permission assigned by using IAM.
  • Mirroring back to source requires that an IAM agency must be created to grant OBS the obs:object:HeadObject and obs:object:PutObject permissions, so that OBS can pull data from its origin server.
  • If SSE-KMS is enabled for a bucket, the kms:cmk:get, kms:cmk:list, kms:cmk:create, kms:dek:create, kms:dek:crypto, and kms:dek:crypto permissions must be configured for the IAM agency for OBS.

Others

  • Back to source by mirroring is free now.
  • An object cannot match two different mirroring back-to-source rules.

Creating a Mirroring Back-to-Source Rule

You can create mirroring back-to-source rules on OBS Console or by calling APIs.