非表示
Google Cloud Storage

Nearline Storage

Nearline Storage enables you to store data that is long-lived but infrequently accessed. Nearline data has the same durability and comparable availability as Standard storage but with lower storage costs. You can read more about it in the Nearline Storage White Paper.

Nearline Storage is appropriate for storing data in scenarios where slightly lower availability and slightly higher latency (typically just a few seconds) is an acceptable trade-off for lowered storage costs. For example:

  • Cold Data Storage - Infrequently accessed data, for example, data stored for legal or regulatory reasons, that should be stored at low cost but be available when needed.

  • Disaster recovery - In the event of a Disaster Recovery (DR) event, recovery time is key. Google Cloud Storage provides low latency access to data stored in the Nearline Storage class.

You enable Nearline at the bucket level, during bucket creation. Once a Nearline bucket is created, all bucket and object operations are exactly the same as with the standard storage class. New objects in the bucket are transparently stored with the Nearline configuration, and your billing for these objects will automatically reflect the lowered prices.

To change a bucket from Nearline Storage to another class, see Changing storage class. Note that because Nearline Storage is designed for data that is not frequently accessed, there are associated retrieval costs for accessing the data and early deletion. For more information, see pricing.

Creating a Nearline bucket

You enable Nearline Storage at the bucket level.

Google Developers Console

  1. In the Developers Console, go to Storage > Cloud Storage > Storage browser.
  2. Click Add a bucket and specify:
    • A bucket name subject to the bucket name requirements.
    • The Storage class as Nearline.
    • A location where bucket data will be stored.

    New Nearline Storage bucket.

  3. Click Create.

gsutil

Using gsutil mb.

$ gsutil mb -c NEARLINE gs://<bucket-name>/

JSON API

Using cURL and the JSON API.

curl -X POST --data-binary @nearline.json \
     -H 'Content-Type: application/json' \
     -H "Authorization: Bearer <auth token>" \
     https://www.googleapis.com/storage/v1/b?project=<project-id>

Where the nearline.json file contains the following information:

{
 "name": "<bucket-name>",
 "storageClass": "NEARLINE"
}

You can get an authorization access token from the OAuth 2.0 Playground. Configure the playground to use your own OAuth credentials.

XML API

Using cURL and the XML API.

curl -X PUT --data-binary @nearline.xml \
     -H "Authorization: Bearer <auth token>" \
     -H "x-goog-project-id: <project-id>" \
     https://storage.googleapis.com/<bucket-name>

Where the nearline.xml file contains the following information:

<CreateBucketConfiguration>
   <LocationConstraint>US</LocationConstraint>
   <StorageClass>NEARLINE</StorageClass>
</CreateBucketConfiguration>

You can get an authorization access token from the OAuth 2.0 Playground. Configure the playground to use your own OAuth credentials.

Verifying a Nearline bucket

Google Developers Console

  1. In the Developers Console, go to Storage > Cloud Storage > Storage browser.
  2. In the bucket list, find the bucket you want to verify, and check that its Storage Class is Nearline.

    Verify Nearline Storage bucket class.

gsutil

Using gsutil ls.

gsutil ls -L -b gs://<bucket-name>/

gs://<bucketname>/ :
     Storage class:         NEARLINE
     Location constraint:   US
     ...

JSON API

Using cURL and the JSON API.

curl -X GET -H "Authorization: Bearer <auth token>" \
     https://www.googleapis.com/storage/v1/b/<bucket-name>?fields=storageClass

The response will look like:

{
 "storageClass": "NEARLINE"
}

You can get an authorization access token from the OAuth 2.0 Playground. Configure the playground to use your own OAuth credentials.

XML API

Using cURL and the XML API.

curl -X GET -H "Authorization: Bearer <auth token>" \
     -H "x-goog-project-id: <project-id>" \
     https://storage.googleapis.com/<bucket-name>?storageClass

The response will look like:

<StorageClass>NEARLINE</StorageClass>

You can get an authorization access token from the OAuth 2.0 Playground. Configure the playground to use your own OAuth credentials.

Using a Nearline bucket

You can access data in a Nearline bucket in the same way you access data in a Standard bucket. The same APIs, tools, and UI that are used for Standard Storage are also used for Nearline Storage including the XML API and JSON API, the command-line gsutil tool, the Google Developers Console, and the client libraries.

Because Nearline Storage is designed for data that is not frequently accessed, there are associated retrieval costs for accessing the data and early deletion. For more information, see the pricing page.