উদাহরণ: জেনারেট করা প্রাপ্যতা ফিড হল 1 GB। এটিকে 5+ পৃথক ফাইলে (বা শার্ড) শার্ড করা উচিত।
অংশীদার ইনভেন্টরি সিস্টেম এবং/অথবা অঞ্চল জুড়ে বিতরণ করা হয় যার ফলে ইনভেন্টরি সমন্বয় করতে অসুবিধা হয়।
উদাহরণ: অংশীদারের ইউএস এবং ইইউ ইনভেন্টরি রয়েছে যা আলাদা সিস্টেমে থাকে। ফিডটি 2টি ফাইল (বা শার্ড) দিয়ে তৈরি করা হতে পারে, 1টি US এর জন্য এবং 1টি EU-এর জন্য একই nonce এবং generation_timestamp সহ।
সাধারণ নিয়ম
প্রতিটি শার্ড 1 ফাইলের জন্য 200 MB অতিক্রম করতে পারে না (gzip কম্প্রেশনের পরে)।
আমরা প্রতি ফিডে 20 শার্ডের বেশি না দেওয়ার পরামর্শ দিই। আপনার যদি এমন কোনো ব্যবসায়িক ন্যায্যতা থাকে যার জন্য সেই পরিমাণের বেশি প্রয়োজন, অনুগ্রহ করে আরও নির্দেশের জন্য সহায়তার সাথে যোগাযোগ করুন।
পৃথক রেকর্ড (উদাহরণস্বরূপ একটি Merchant অবজেক্ট) অবশ্যই একটি শার্ডে পাঠাতে হবে, সেগুলি একাধিক শার্ডে বিভক্ত করা যাবে না। যাইহোক, ভবিষ্যতে ফিডের জন্য তাদের একই shard_number সহ শার্ডে পাঠাতে হবে না।
ভালো পারফরম্যান্সের জন্য, আপনার ডেটা শার্ডগুলির মধ্যে সমানভাবে বিভক্ত করা উচিত যাতে সমস্ত শার্ড ফাইলের আকার একই রকম হয়।
কিভাবে শার্ড ফিড
প্রতিটি ফাইলের জন্য (বা শার্ড), FeedMetadata নিম্নলিখিত সেট করুন:
processing_instructionPROCESS_AS_COMPLETE এ সেট করা হয়েছে।
shard_number ফিডের বর্তমান শার্ডে সেট করা হয়েছে (0 থেকে শুরু করে total_shards - 1টি বিরতি ছাড়াই)
total_shards ফিডের জন্য মোট শার্ডের সংখ্যা সেট করা হয়েছে (1 থেকে শুরু করে)।
একটি অনন্য শনাক্তকারীতে সেট করা nonce যা একই ফিডের সমস্ত শার্ড জুড়ে একই কিন্তু অন্যান্য ফিডের মান থেকে আলাদা। nonce অবশ্যই একটি ধনাত্মক int ( uint64 ) হতে হবে।
generation_timestamp হল ইউনিক্স এবং ইপোচ ফরম্যাটে টাইমস্ট্যাম্প। এটি ফিডের সমস্ত অংশ জুড়ে একই হওয়া উচিত।
প্রস্তাবিত: প্রতিটি ফাইলের জন্য (বা শার্ড), ফিডের ধরন, টাইমস্ট্যাম্প, শার্ড নম্বর এবং মোট শার্ড সংখ্যা নির্দেশ করতে ফাইলের নাম সেট করুন। শার্ডগুলি প্রায় সমান আকারের হওয়া উচিত এবং সমস্ত শার্ডগুলি আপলোড হয়ে গেলে প্রক্রিয়া করা হয়৷
অংশীদার বিতরণকৃত ইনভেন্টরির জন্য শার্ডিং ব্যবহার করা
অংশীদারদের জন্য একাধিক সিস্টেম বা অঞ্চল জুড়ে একটি একক ফিডে বিতরণ করা ইনভেন্টরি একত্রিত করা চ্যালেঞ্জিং হতে পারে। প্রতিটি বিতরণ করা সিস্টেমের ইনভেন্টরি সেটের সাথে মেলে প্রতিটি শার্ড সেট করে পুনর্মিলন চ্যালেঞ্জগুলি সমাধান করতে Sharding ব্যবহার করা যেতে পারে।
উদাহরণস্বরূপ, বলুন একজন অংশীদারের ইনভেন্টরি 2টি অঞ্চলে বিভক্ত (US এবং EU ইনভেন্টরি), যা 2টি পৃথক সিস্টেমে থাকে৷
অংশীদার প্রতিটি ফিডকে 2টি ফাইলে (বা শার্ড) ভাগ করতে পারে:
মার্চেন্ট ফিড: US এর জন্য 1 শার্ড, EU এর জন্য 1 শার্ড
পরিষেবা ফিড: US-এর জন্য 1 শার্ড, EU-এর জন্য 1 শার্ড৷
প্রাপ্যতা ফিড: US এর জন্য 1 শার্ড, EU এর জন্য 1 শার্ড
ফিডগুলি সঠিকভাবে প্রক্রিয়া করা হয়েছে তা নিশ্চিত করতে নীচের পদক্ষেপগুলি অনুসরণ করুন:
একটি আপলোড সময়সূচী নির্ধারণ করুন, এবং সময়সূচী অনুসরণ করতে ইনভেন্টরির প্রতিটি উদাহরণ কনফিগার করুন।
প্রতিটি উদাহরণের জন্য অনন্য শার্ড নম্বর বরাদ্দ করুন (যেমন US = N, EU = N + 1)। total_shards শার্ডের মোট সংখ্যায় সেট করুন।
প্রতিটি নির্ধারিত আপলোডের সময়ে, একটি generation_timestamp এবং nonce সিদ্ধান্ত নিন। FeedMetadata তে, এই দুটি ক্ষেত্রের জন্য একই মান ধরে রাখার জন্য সমস্ত দৃষ্টান্ত সেট করুন।
generation_timestamp বর্তমান বা সাম্প্রতিক অতীত হওয়া উচিত (আদর্শভাবে, অংশীদারের রিড-এ ডাটাবেস টাইমস্ট্যাম্প)
সমস্ত শার্ডগুলি আপলোড করার পরে, Google generation_timestamp এবং nonce মাধ্যমে শার্ডগুলিকে গোষ্ঠীভুক্ত করে।
Google ফিডটিকে একটি হিসাবে প্রসেস করবে যদিও প্রতিটি শার্ড অংশীদারের ইনভেনটরির একটি ভিন্ন অঞ্চলকে প্রতিনিধিত্ব করে এবং যতক্ষণ পর্যন্ত generation_timestamp সমস্ত শার্ডগুলিতে একই থাকে ততক্ষণ পর্যন্ত দিনের একটি ভিন্ন সময়ে আপলোড করা যেতে পারে।
[null,null,["2025-07-24 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eSharding, or splitting feeds into multiple files, is recommended when a feed exceeds 200MB after gzip compression or when inventory is distributed across various systems/regions.\u003c/p\u003e\n"],["\u003cp\u003eEach shard should not exceed 200MB after gzip compression, with a recommended maximum of 20 shards per feed.\u003c/p\u003e\n"],["\u003cp\u003eShards are processed as a complete feed once all shards are uploaded, and should contain the same \u003ccode\u003enonce\u003c/code\u003e and \u003ccode\u003egeneration_timestamp\u003c/code\u003e in their metadata.\u003c/p\u003e\n"],["\u003cp\u003eIndividual records must be sent in one shard, but can be moved to different shards in future feeds for load balancing.\u003c/p\u003e\n"],["\u003cp\u003ePartners with distributed inventory can utilize sharding to represent each system's inventory set within individual shards for easier reconciliation.\u003c/p\u003e\n"]]],["Sharding divides large feeds into multiple files when a single feed exceeds 200MB (after gzip compression) or when inventory is distributed across different systems/regions. Each shard must be under 200MB, and it is recommended to keep the total number of shards to 20 or fewer. Shards should be evenly sized and include `shard_number`, `total_shards`, a common `nonce`, and `generation_timestamp`. Sharding can also help with inventory reconciliation and data can be split by region or system. All shards must be uploaded to process the feed.\n"],null,["# Shard feed files\n\nDepending 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\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/reservations/bl/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\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/reservations/bl/reference/feeds/feed-errors).\n\nHow to shard feeds\n------------------\n\nFor each file (or shard), set the `FeedMetadata` to the\nfollowing:\n\n- `processing_instruction`set to `PROCESS_AS_COMPLETE`.\n- `shard_number` set to to the current shard of the feed (starting from 0 to `total_shards` - 1 without discontinuities)\n- `total_shards` set to the total number of shards for the feed (starting from 1).\n- `nonce` set to a unique identifier that is **the same** across all shards of **the same** feed but different from the value of other feeds. `nonce` must be a positive int (`uint64`).\n- `generation_timestamp` is the timestamp in unix and EPOCH format. This should be **the same** across all shards of the feed.\n\n*Recommended:* For each file (or shard), set the filename to indicate\nthe feed type, the timestamp, the shard number, and the total number of\nshards. Shards should be roughly equal in size and are processed once all\nshards are uploaded.\n\n- `Example:` \"availability_feed_1574117613_001_of_002.json.gz\"\n\n**Sharded Availability feed example** \n\n### Shard 0\n\n```scdoc\n{\n \"metadata\": {\n \"processing_instruction\": \"PROCESS_AS_COMPLETE\",\n \"shard_number\": 0,\n \"total_shards\": 3,\n \"nonce\": 111111,\n \"generation_timestamp\": 1524606581\n },\n \"service_availability\": [\n {\n \"availability\": [\n {\n \"spots_total\": 1,\n \"spots_open\": 1,\n \"duration_sec\": 3600,\n \"service_id\": \"1000\",\n \"start_sec\": 1577275200,\n \"merchant_id\": \"merchant1\",\n \"confirmation_mode\": \"CONFIRMATION_MODE_SYNCHRONOUS\"\n }\n ]\n }\n ]\n}\n```\n\n### Shard 1\n\n```scdoc\n{\n \"metadata\": {\n \"processing_instruction\": \"PROCESS_AS_COMPLETE\",\n \"shard_number\": 1,\n \"total_shards\": 3,\n \"nonce\": 111111,\n \"generation_timestamp\": 1524606581\n },\n \"service_availability\": [\n {\n \"availability\": [\n {\n \"spots_total\": 1,\n \"spots_open\": 1,\n \"duration_sec\": 3600,\n \"service_id\": \"1000\",\n \"start_sec\": 1577620800,\n \"merchant_id\": \"merchant2\",\n \"confirmation_mode\": \"CONFIRMATION_MODE_SYNCHRONOUS\"\n }\n ]\n }\n ]\n}\n```\n\n### Shard 2\n\n```scdoc\n{\n \"metadata\": {\n \"processing_instruction\": \"PROCESS_AS_COMPLETE\",\n \"shard_number\": 2,\n \"total_shards\": 3,\n \"nonce\": 111111,\n \"generation_timestamp\": 1524606581\n },\n \"service_availability\": [\n {\n \"availability\": [\n {\n \"spots_total\": 1,\n \"spots_open\": 1,\n \"duration_sec\": 3600,\n \"service_id\": \"1000\",\n \"start_sec\": 1576670400,\n \"merchant_id\": \"merchant3\",\n \"confirmation_mode\": \"CONFIRMATION_MODE_SYNCHRONOUS\"\n }\n ]\n }\n ]\n}\n```\n\nUsing sharding for partner distributed inventory\n------------------------------------------------\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\n- Merchants feed: 1 shard for US, 1 shard for EU\n- Services feed: 1 shard for US, 1 shard for EU\n- Availability feed: 1 shard for US, 1 shard for EU\n\nFollow the steps below 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` and `nonce`. In the `FeedMetadata`, set all instances to hold the same values for these two fields.\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 via `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.\n\n**Sharded Availability feed example by region** \n\n### Shard 0 - US Inventory\n\n```scdoc\n{\n \"metadata\": {\n \"processing_instruction\": \"PROCESS_AS_COMPLETE\",\n \"shard_number\": 0,\n \"total_shards\": 2,\n \"nonce\": 111111,\n \"generation_timestamp\": 1524606581\n },\n \"service_availability\": [\n {\n \"availability\": [\n {\n \"spots_total\": 1,\n \"spots_open\": 1,\n \"duration_sec\": 3600,\n \"service_id\": \"1000\",\n \"start_sec\": 1577275200,\n \"merchant_id\": \"US_merchant_1\",\n \"confirmation_mode\": \"CONFIRMATION_MODE_SYNCHRONOUS\"\n }\n ]\n }\n ]\n}\n```\n\n### Shard 1 - EU Inventory\n\n```scdoc\n{\n \"metadata\": {\n \"processing_instruction\": \"PROCESS_AS_COMPLETE\",\n \"shard_number\": 1,\n \"total_shards\": 2,\n \"nonce\": 111111,\n \"generation_timestamp\": 1524606581\n },\n \"service_availability\": [\n {\n \"availability\": [\n {\n \"spots_total\": 1,\n \"spots_open\": 1,\n \"duration_sec\": 3600,\n \"service_id\": \"1000\",\n \"start_sec\": 1577620800,\n \"merchant_id\": \"EU_merchant_1\",\n \"confirmation_mode\": \"CONFIRMATION_MODE_SYNCHRONOUS\"\n }\n ]\n }\n ]\n}\n```"]]