Help Center> Object Storage Service> User Guide> Back to Source (Beta Testing)

Back to Source (Beta Testing)

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. The back-to-source function is implemented by mirroring or redirection.

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

  • This feature is currently available only in the CN North-Beijing4, CN East-Shanghai1, CN East-Shanghai2, CN South-Guangzhou, and CN-Hong Kong regions.
  • 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.
  • A private bucket cannot be specified as the source site in a mirroring back-to-source rule. Change the bucket policy to Public Read, if you need to use the bucket as the source site.
  • 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.
  • An object cannot match two different mirroring back-to-source rules.
  • When both mirroring and redirection back-to-source rules are configured and the requested data matches both of the rules, OBS first proceeds according to the mirroring rule. If the requested data is not found at the source site, then OBS processes with the redirection rule.
  • Only buckets of version 3.0 or later support the mirroring back-to-source function.
  • A mirroring back-to-source rule takes effect five minutes later after any change to the rule.
  • A maximum of 10 mirroring back-to-source rules can be configured for a bucket.
  • The mirroring back-to-source function is offered for free.

Creating a mirroring back-to-source rule

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

Back-to-Source by Redirection

If a redirection back-to-source rule is configured for an OBS bucket and the requested data is not found in the bucket, the system will return a 3xx redirection response, when the back-to-source rule applies to the data, to redirect the request to a third-party source site, and then the requested data will be returned by the source site. Figure 2 illustrates the redirection back-to-source process.

Figure 2 Redirection back-to-source process

In addition, OBS provides the asynchronous migration solution based on the redirection back-to-source function. After the requested data is returned, OBS can asynchronously migrate the data from the source site to the bucket, so that no redirection is required if the same data is requested again. This function applies to the scenario of migrating continuously generated hot data from the source site to an OBS bucket. Figure 3 illustrates the asynchronous migration process.

Figure 3 Asynchronous migration process

Constraints

  • Asynchronous migration is not supported for objects that have multiple versions.
  • Redirection back-to-source rules and asynchronous migration do not apply to encrypted objects.
  • Parallel file systems do not support redirection back-to-source rules.
  • An object cannot match two different redirection back-to-source rules.
  • When both mirroring and redirection back-to-source rules are configured and the requested data matches both of the rules, OBS first proceeds according to the mirroring rule. If the requested data is not found at the source site, then OBS processes with the redirection rule.
  • If objects are deleted or updated at the source site, their status cannot be updated synchronously to the bucket in OBS.
  • Only buckets of version 3.0 or later support the redirection back-to-source function.
  • A maximum of five redirection back-to-source rules can be configured for a bucket.

Creating a redirection back-to-source rule

Creating a Back-to-Source Rule