Stay organized with collections
Save and categorize content based on your preferences.
Depending on your inventory, sharding (or breaking up feeds into multiple
files) may be necessary.
When to use sharding
Feed exceeds 200 MB for 1 file (after gzip compression).
Example: Generated availability feed is 1 GB. This should be
sharded to 5+ separate files (or shards).
Partner inventory is distributed across systems and/or regions
resulting in difficulty reconciling the inventory.
Example: Partner has US and EU inventory that live in separate
systems. The feed may be generated with 2 files (or shards), 1 for US,
and 1 for EU with the same nonce and
generation_timestamp.
General rules
Each shard cannot exceed 200 MB for 1 file (after gzip compression).
We recommend no more than 20 shards per feed. If you have a business justification that
requires more than that amount, please contact support for further instruction.
Individual records (one Merchant object for example) must be sent in one shard,
they cannot be split across multiple shards. However, they don't have to be sent in the shard
with the same shard_number for future feeds.
For better performance, your data should be split evenly among
the shards so that all sharded files are similar in size.
How to shard feeds
You can shard the events feed by splitting a single JSON into separate JSON
files with non overlapping events and updating the file descriptor JSON with
the list of JSON file names.
Recommended: For each file (or shard), set the filename to indicate
the feed type, the timestamp and the shard number. Shards should be roughly
equal in size and are processed once all shards are uploaded.
It can be challenging for partners to consolidate inventory distributed
across multiple systems and or regions into a single feed. Sharding can be
used to resolve reconciliation challenges by setting each shard to match each
distributed system's inventory set.
For example, say a partner's inventory is separated into 2 regions (US and EU
inventory), which live in 2 separate systems.
The partner can break each feed into 2 files (or shards):
Use the following steps to ensure the feeds are properly processed:
Decide on an upload schedule, and configure each instance of inventory to
follow the schedule.
Assign unique shard numbers for each instance (e.g. US = N, EU = N + 1).
Set total_shards to the total number of shards.
At each scheduled upload time, decide on a
generation_timestamp. In set all filenames to hold the same
values for these two fields and list all expected file names in the
descriptor file.
generation_timestamp should be current or recent past
(ideally, the partner's read-at database timestamp)
After all shards are uploaded, Google groups the shards using
generation_timestamp and nonce.
Google will process the feed as one even though each shard represents a
different region of the partner's inventory and could be uploaded at a
different time of the day as long as the generation_timestamp
is the same across all shards.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-20 UTC."],[[["\u003cp\u003eSharding, or splitting feeds into multiple files, is necessary when a single feed file exceeds 200 MB after gzip compression or when inventory is distributed across various systems.\u003c/p\u003e\n"],["\u003cp\u003eEach shard must not exceed 200 MB after gzip compression, with a recommended maximum of 20 shards per feed.\u003c/p\u003e\n"],["\u003cp\u003eShard metadata requires \u003ccode\u003eprocessing_instruction\u003c/code\u003e, \u003ccode\u003eshard_number\u003c/code\u003e, \u003ccode\u003etotal_shards\u003c/code\u003e, \u003ccode\u003enonce\u003c/code\u003e, and \u003ccode\u003egeneration_timestamp\u003c/code\u003e to be set correctly.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003enonce\u003c/code\u003e and \u003ccode\u003egeneration_timestamp\u003c/code\u003e must be the same across all shards of a single feed to ensure they are processed as one unit, while \u003ccode\u003eshard_number\u003c/code\u003e should be unique for each shard.\u003c/p\u003e\n"],["\u003cp\u003eSharding can effectively handle inventory reconciliation issues arising from distributed systems by assigning a shard to each instance of the inventory.\u003c/p\u003e\n"]]],["Sharding divides large feeds into multiple files (shards) when a feed exceeds 200 MB (after compression) or when inventory is split across systems/regions. Each shard must be under 200 MB, with up to 20 shards per feed. Use `FeedMetadata` to set `shard_number`, `total_shards`, a shared `nonce`, and a common `generation_timestamp` across all shards. Shards should be evenly sized and uploaded before processing begins. The individual records can not be split across shards.\n"],null,["Depending on your inventory, sharding (or breaking up feeds into multiple\nfiles) may be necessary.\n| **Note:** Sharding might only be applicable to some of the feeds you submit and is dependent on the type of inventory submitted. Please reach out to your Google contact if you are unsure of the best approach.\n\nWhen to use sharding\n\n- Feed exceeds 200 MB for 1 file (after gzip compression).\n\n - **Example:** Generated availability feed is 1 GB. This should be sharded to 5+ separate files (or shards).\n- Partner inventory is distributed across systems and/or regions\n resulting in difficulty reconciling the inventory.\n\n - **Example:** Partner has US and EU inventory that live in separate systems. The feed may be generated with 2 files (or shards), 1 for US, and 1 for EU with the same `nonce` and `generation_timestamp`.\n\n| **Note:** Before using sharding, make sure you are [compressing your feed uploads with gzip](/actions-center/verticals/events/reference/tutorials/compression). Using gzip can reduce feed size by 10x or more, and may allow you to skip or defer sharding your feed.\n\nGeneral rules\n\n- Each shard cannot exceed 200 MB for 1 file (after gzip compression).\n- We recommend no more than 20 shards per feed. If you have a business justification that requires more than that amount, please contact support for further instruction.\n- Individual records (one `Merchant` object for example) must be sent in one shard, they cannot be split across multiple shards. However, they don't have to be sent in the shard with the same `shard_number` for future feeds.\n- For better performance, your data should be split evenly among the shards so that all sharded files are similar in size.\n\n| **Note:** Google processes feed files as soon as they're uploaded to the SFTP server. If the feed is sharded into multiple files, the process begins after you upload the last file. If your feed contains errors, you receive an email with the [feed error codes](/actions-center/verticals/events/reference/feeds/feed-errors).\n\nHow to shard feeds\n\nYou can shard the events feed by splitting a single JSON into separate JSON\nfiles with non overlapping events and updating the file descriptor JSON with\nthe list of JSON file names.\n\n*Recommended:* For each file (or shard), set the filename to indicate\nthe feed type, the timestamp and the shard number. Shards should be roughly\nequal in size and are processed once all shards are uploaded.\n\n**Sharded example** \n\nFile descriptor - event.feeddata.v1_1728306001.filedescriptor.json \n\n```scdoc\n{\n \"generation_timestamp\": 1728306001,\n \"name\": \"event.feeddata.v1\",\n \"data_file\": [\n \"event.feeddata.v1_1728306001_001.json\",\n \"event.feeddata.v1_1728306001_002.json\"\n ]\n}\n```\n\nShard 0 - event.feeddata.v1_1728306001_001.json \n\n```text\n{\n \"data\": [\n {\n \"id\": \"event-1\",\n ...\n },\n {\n \"id\": \"event-2\",\n ...\n }\n ]\n}\n```\n\nShard 1 - event.feeddata.v1_1728306001_002.json \n\n```text\n{\n \"data\": [\n {\n \"id\": \"event-3\",\n ...\n },\n {\n \"id\": \"event-4\",\n ...\n }\n ]\n}\n```\n\nShards for partner distributed inventory\n\nIt can be challenging for partners to consolidate inventory distributed\nacross multiple systems and or regions into a single feed. Sharding can be\nused to resolve reconciliation challenges by setting each shard to match each\ndistributed system's inventory set.\n\nFor example, say a partner's inventory is separated into 2 regions (US and EU\ninventory), which live in 2 separate systems.\n\nThe partner can break each feed into 2 files (or shards):\n\nUse the following steps to ensure the feeds are properly processed:\n\n1. Decide on an upload schedule, and configure each instance of inventory to follow the schedule.\n2. Assign unique shard numbers for each instance (e.g. US = N, EU = N + 1). Set `total_shards` to the total number of shards.\n3. At each scheduled upload time, decide on a `generation_timestamp`. In set all filenames to hold the same values for these two fields and list all expected file names in the descriptor file.\n - `generation_timestamp` should be current or recent past (ideally, the partner's read-at database timestamp)\n4. After all shards are uploaded, Google groups the shards using `generation_timestamp` and `nonce`.\n\n| **Note:** Feeds/shards arriving separately at different times is supported, but coordinated schedules is best. Feed processing occurs only when all shards in a feed set are uploaded.\n\nGoogle will process the feed as one even though each shard represents a\ndifferent region of the partner's inventory and could be uploaded at a\ndifferent time of the day as long as the `generation_timestamp`\nis the same across all shards."]]