복합 객체의 ETag 값은 MD5 해시를 기준으로 하지 않습니다. 그리고 클라이언트 코드는 HTTP/1.1의 IETF 사양에 따라 기본 객체가 변경될 때마다 변경된다는 것을 제외하고 복합 객체 ETag에 대해 어떤 것도 가정하지 않습니다.
각 복합 객체에는 복합 객체 내에 포함된 비복합 객체의 수를 계산하는 구성 요소 수 메타데이터 필드가 있습니다.
복합 객체를 다른 위치나 스토리지 클래스로 다시 작성하면 결과는 구성요소 수가 1인 복합 객체입니다.
복합 객체 무결성 검사
Cloud Storage는 업로드 시 각 소스 객체의 무결성을 검사하고, 다운로드 시 호출자가 결과로 생성된 복합 객체의 무결성 검사를 수행할 수 있도록 CRC32C를 사용합니다. CRC32C는 해당 구성요소의 CRC32C 값에서 효율적으로 계산할 수 있는 오류 감지 코드입니다. 애플리케이션에서 다음과 같이 CRC32C를 사용해야 합니다.
소스 객체를 업로드할 때 객체 메타데이터 페이지에 나열된 라이브러리 중 하나와 같이 CRC32C 라이브러리를 사용하여 각 객체의 CRC32C를 계산하고 요청에 그 값을 포함해야 합니다. 제공된 값에 따라 Cloud Storage에서 각 업로드의 유효성을 검사합니다.
조합 작업은 소스 객체가 올바르게 어셈블되었는지 자동으로 확인하며 작성 요청의 일부로 제공된 모든 CRC32C 값을 무시합니다. 결과로 생성된 복합 객체의 CRC32C가 응답으로 반환됩니다.
업로드 시점과 조합 시점 사이에 애플리케이션이 소스 객체를 변경할 가능성이 있는 경우 경합 상태가 발생하지 않도록 소스 객체에 세대별 이름을 지정해야 합니다. 또는 원하는 소스 객체의 CRC32C 값에서 CRC32C 값을 빌드한 후 조합 작업에서 반환된 CRC32C 값과 비교할 수 있습니다.
다운로드할 때는 다운로드한 객체의 CRC32C를 계산하여 응답에 포함된 값과 비교해야 합니다.
제한된 추가 및 편집
조합 작업을 사용하면 제한적인 객체 첨부 및 수정을 수행할 수 있습니다.
첨부 작업을 수행하기 위해서는 새로운 임시 객체에 데이터를 업로드하고, 이 임시 객체와 함께 첨부하려는 객체를 조합하고, 선택적으로 조합 작업의 출력 이름을 원래 객체와 동일하게 지정하고, 임시 객체를 삭제합니다.
예를 들어 gcloud CLI에서 문자열 new data를 기존 Cloud Storage 객체에 추가하는 일련의 명령어는 다음과 같습니다.
조합을 사용하여 기본적인 객체 편집을 지원할 수도 있습니다.
예를 들어 시퀀스 {Y1, Y2, Y3}에서 객체 X를 조합하고, Y2의 콘텐츠를 바꾸고, 동일한 구성요소에서 X를 재조합할 수 있습니다.
이를 위해서는 Y1, Y2, Y3가 삭제되지 않은 상태로 유지되어야 하므로 해당 구성요소 및 복합물에 대한 비용이 청구됩니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-05(UTC)"],[],[],null,["# Composite objects\n\n[Create](/storage/docs/composing-objects)\n\nThis page describes composite objects, which you create from existing objects\nwithout transferring additional object data. Composite objects are useful for\nmaking [appends to an existing object](#appends), as well as for recreating\nobjects that you [uploaded as multiple components in parallel](/storage/docs/parallel-composite-uploads).\n\nCompose operation\n-----------------\n\nThe compose operation concatenates the data in a given sequence of source\nobjects to create a new object called a *composite object*. The source objects\nall must:\n\n- Have the same [storage class](/storage/docs/storage-classes).\n- Be stored in the same Cloud Storage bucket.\n\nWhen you perform a composition:\n\n- The source objects are unaffected.\n- You can use between 1 and 32 source objects.\n- Source objects can themselves be composite objects.\n\nThe composite object that results from a composition:\n\n- Has the same storage class as the source objects.\n- Does not change if the source objects are subsequently replaced or deleted.\n\nWhen using [`gcloud storage`](/sdk/gcloud/reference/storage) to perform object composition, the object that\nresults has a [`Content-Type`](/storage/docs/metadata#content-type) set to match the `Content-Type` of the first\nsource object.\n\nComposite object metadata\n-------------------------\n\nThere are several differences between the metadata of a composite object and\nthe metadata of other objects:\n\n- Composite objects *do not* have an MD5 hash metadata field.\n\n- The ETag value of a composite object is not based on an MD5 hash, and client\n code should make no assumptions about composite object ETags except that\n they change whenever the underlying object changes per the\n [IETF specification for HTTP/1.1](https://datatracker.ietf.org/doc/html/rfc7232#section-2.3).\n\n | **Caution:** Exercise caution when first using composite objects, since any clients expecting to find an MD5 digest within the ETag header may conclude that object data has been corrupted, which could trigger endless data retransmission attempts.\n- Each composite object has a *component count* metadata field, which counts the\n number of non-composite objects contained within the composite object.\n\n - If you rewrite a composite object to a different location or storage class, the result is a composite object with a component count of 1.\n\nIntegrity Checking Composite Objects\n------------------------------------\n\nCloud Storage uses [CRC32C](https://datatracker.ietf.org/doc/html/rfc4960#appendix-B) for integrity checking each\nsource object at upload time and for allowing the caller to perform an integrity\ncheck of the resulting composite object when it is downloaded. CRC32C is an\nerror detecting code that can be efficiently calculated from the CRC32C\nvalues of its components. Your application should use CRC32C as follows:\n\n- When uploading source objects, you should calculate the CRC32C for each object using a CRC32C library, such as one of those listed in the [Object metadata page](/storage/docs/metadata#crc32c), and include that value in your request. Based on the values you provide, Cloud Storage [validates each upload](/storage/docs/data-validation).\n- The compose operation automatically checks that the source objects are correctly assembled, and it ignores any CRC32C value you provide as part of the compose request. A CRC32C of the resulting composite object is returned in the response.\n- If your application could change source objects between the time of uploading and composing those objects, you should specify generation-specific names for the source objects to avoid race conditions. Alternatively, you can build a CRC32C value from the CRC32C values of the intended source objects and compare it to the CRC32C value returned by the compose operation.\n- At download time, you should calculate the CRC32C of the downloaded object and compare that with the value included in the response.\n\n| **Note:** CRC32C is not intended to protect against [\"man-in-the-middle\"](https://en.wikipedia.org/wiki/Man-in-the-middle_attack) attacks, where someone modifies the content in a way that still matches the provided checksum. Protection against such attacks is provided by using SSL connections when uploading and downloading objects, which is the default for many tools and libraries, such as the Google Cloud CLI.\n\nLimited Append and Edit\n-----------------------\n\nYou can use the compose operation to perform limited object appends and edits.\n\nYou accomplish appending by uploading data to a temporary new object, composing\nthe object you wish to append with this temporary object, optionally naming the\noutput of the compose operation the same as the original object, and deleting\nthe temporary object.\n\nFor example, in the [gcloud CLI](/sdk/gcloud), the series of commands to\nappend the string `new data` to an existing Cloud Storage object is\nthe following: \n\n```\n$ echo 'new data' | gcloud storage cp - gs://bucket/temporary_object\n$ gcloud storage objects compose gs://bucket/object_to_append gs://bucket/temporary_object \\\n gs://bucket/object_to_append\n$ gcloud storage rm gs://bucket/temporary_object\n```\n\nYou can also use composition to support a basic flavor of object editing.\nFor example, you could compose an object *X* from the sequence *{Y1, Y2, Y3}* ,\nreplace the contents of *Y2* , and recompose *X* from those same components.\nNote that this requires that *Y1* , *Y2* , and *Y3* be left undeleted, so you\nwill be billed for those components as well as for the composite.\n| **Caution:** Compose operations create a new version of an object. When performing appends in a bucket with [Object Versioning](/storage/docs/object-versioning) enabled, be sure that you properly manage the noncurrent version of the object that each append generates.\n\nWhat's next\n-----------\n\n- [Compose an object](/storage/docs/composing-objects).\n- Learn about [parallel composite uploads](/storage/docs/parallel-composite-uploads).\n- Learn about [Multipart uploads](/storage/docs/multipart-uploads), an alternative way to upload objects in multiple chunks for XML API users."]]