Zpět na blog
Compliance

Data Localization: Navigating Emerging Global Requirements

Tým GetCookiesOctober 30, 202514 min čtení
Data LocalizationGlobal PrivacyArchitectureCompliance

TLDR: Russia blocked LinkedIn. China fined Didi $1.2B. Over 100 countries now mandate where your data lives. Your consent records need to stay with the data they govern—across borders that are closing fast.

Read full summary

Analysis of data localization trends across 40+ jurisdictions. Learn how residency requirements affect consent management, CMP selection criteria for multi-region compliance, and architectural patterns for data sovereignty.

Summary by Claude AI

The SaaS Company That Couldn't Expand to China

Illustrative scenario: a composite example, not a specific reported case.

A US-based analytics company had 50,000 customers worldwide when they decided to enter the Chinese market. Their architecture was simple: all data flowed to AWS US-East, where their consent management, analytics processing, and customer dashboards lived.

Then they discovered China's Personal Information Protection Law (PIPL). Personal data of Chinese citizens had to be stored in China. Security assessments were required for cross-border transfers. Their entire architecture—designed for a borderless internet—couldn't work.

The remediation took 14 months and $3.2 million. They built a separate Chinese infrastructure, implemented data classification systems to route Chinese user data correctly, and obtained certifications from Chinese authorities. Their competitors who had built multi-region from the start captured the market during that delay.


title: "Data Localization Trends 2025: Global Requirements and Technical Implementation Guide" slug: "data-localization-trends-2025" excerpt: "Navigate the complex world of data localization requirements across China, India, Russia, Vietnam, and emerging markets. Technical strategies for multi-region data architecture, consent management, and compliance infrastructure." category: "Regulations" tags: ["Data Localization", "PIPL", "Data Residency", "Cross-Border Transfers", "Multi-Region Architecture", "Compliance", "Global Privacy"] publishedAt: "2025-01-22" readTime: "19 min read"

What is data localization and why is it important in 2025?

Data localization (also called data residency) requires organizations to store and process certain data within the physical borders of a specific country. In 2025, over 100 countries have enacted some form of data localization requirement. For global businesses, this means maintaining infrastructure across multiple jurisdictions, implementing geo-specific data routing, and ensuring consent records stay with the data they govern.

Introduction

The global internet was built on the principle that data flows freely across borders. That era is ending. From China's sweeping Personal Information Protection Law (PIPL) to India's Digital Personal Data Protection Act, countries are increasingly demanding that certain data stays within their borders.

We've helped multinational companies navigate data localization requirements across 40+ jurisdictions, and the complexity continues to grow. What started as national security concerns has expanded to encompass personal data, financial records, health information, and even seemingly mundane website analytics. The challenge isn't just legal—it's architectural. How do you build systems that respect data sovereignty while maintaining a coherent global service?

This guide covers the current data localization landscape, explains the requirements in key jurisdictions, and provides technical strategies for building compliant multi-region data infrastructure. Whether you're expanding into new markets or retrofitting existing systems, you'll find practical implementation guidance here.

Understanding Data Localization Requirements

Types of Data Localization

Data localization isn't monolithic. Requirements vary significantly in scope and strictness:

┌─────────────────────────────────────────────────────────────────────┐
│                    Data Localization Spectrum                        │
├─────────────────────────────────────────────────────────────────────┤
│                                                                      │
│  STORAGE LOCALIZATION (Most Common)                                 │
│  ─────────────────────────────────                                  │
│  Data must be stored locally, but copies can exist elsewhere        │
│  Example: Russia (personal data), Australia (health records)        │
│                                                                      │
│  PROCESSING LOCALIZATION                                            │
│  ─────────────────────────                                          │
│  Data must be processed locally, not just stored                    │
│  Example: China (critical information infrastructure)               │
│                                                                      │
│  TRANSFER RESTRICTIONS                                               │
│  ────────────────────                                                │
│  Data can be processed anywhere but needs approval to leave         │
│  Example: GDPR adequacy, India DPDP transfer rules                  │
│                                                                      │
│  STRICT LOCALIZATION                                                 │
│  ──────────────────                                                  │
│  Data cannot leave the country under any circumstances              │
│  Example: China (certain government data), Russia (FSB data)        │
│                                                                      │
│  SECTOR-SPECIFIC LOCALIZATION                                        │
│  ──────────────────────────                                          │
│  Only certain data types (financial, health, telecom) restricted    │
│  Example: Indonesia (financial), Vietnam (critical sectors)         │
│                                                                      │
└─────────────────────────────────────────────────────────────────────┘

Why Countries Require Data Localization

Understanding the motivations helps predict how requirements will evolve:

  1. National Security: Access to data during investigations, protection from foreign surveillance
  2. Law Enforcement: Easier access to evidence without international legal processes
  3. Economic Development: Building local data center industry, creating tech jobs
  4. Digital Sovereignty: Reducing dependence on foreign technology companies
  5. Privacy Protection: Belief that local laws better protect citizens
  6. Geopolitical Positioning: Asserting independence from Western tech dominance

Key Jurisdictions and Requirements

China: PIPL and Data Export Rules

China's Personal Information Protection Law (PIPL), combined with the Data Security Law and Cybersecurity Law, creates the most comprehensive data localization regime globally.

Key Requirements:

interface ChinaDataRequirements {
  // Personal information rules
  personalInformation: {
    storageRequired: boolean; // Must store in China if processing PI of China residents
    transferRequirements: {
      securityAssessment: boolean; // Required for large-scale transfers
      standardContract: boolean; // CAC-approved contracts
      certification: boolean; // Personal info protection certification
    };
    thresholds: {
      subjectsRequiringAssessment: number; // 1,000,000+ personal info subjects
      sensitiveSubjectsThreshold: number; // 100,000+ sensitive PI subjects
    };
  };

  // Critical information infrastructure
  cii: {
    strictLocalization: boolean; // Must stay in China
    securityAssessmentRequired: boolean;
    governmentApproval: boolean;
  };

  // Important data (non-personal)
  importantData: {
    catalogueRequired: boolean;
    securityAssessment: boolean;
    exportRestrictions: boolean;
  };
}

const chinaRequirements: ChinaDataRequirements = {
  personalInformation: {
    storageRequired: true,
    transferRequirements: {
      securityAssessment: true,
      standardContract: true,
      certification: true
    },
    thresholds: {
      subjectsRequiringAssessment: 1000000,
      sensitiveSubjectsThreshold: 100000
    }
  },
  cii: {
    strictLocalization: true,
    securityAssessmentRequired: true,
    governmentApproval: true
  },
  importantData: {
    catalogueRequired: true,
    securityAssessment: true,
    exportRestrictions: true
  }
};

Transfer Mechanisms (in order of complexity):

  1. Security Assessment - Required for CII operators and large-scale transfers
  2. Standard Contract - CAC-published contract filed with local authorities
  3. Certification - Third-party protection certification

India: Digital Personal Data Protection Act

India's DPDP Act (2023) takes a nuanced approach to data localization:

Key Points:

  • No blanket localization requirement
  • Government can notify countries where transfers are prohibited
  • Sensitive personal data has stricter requirements
  • Financial data (RBI regulations) has separate localization mandates
interface IndiaDataRequirements {
  // DPDP Act requirements
  generalPersonalData: {
    localizationRequired: boolean;
    transferRestrictions: 'notification-based'; // Govt can prohibit specific countries
  };

  // RBI requirements (financial sector)
  financialData: {
    paymentSystemData: {
      localizationRequired: true;
      copyAbroadAllowed: boolean;
    };
    storageDeadline: string; // Must store in India
  };

  // Sector-specific
  sectors: {
    telecom: { localizationRequired: boolean };
    health: { localizationRequired: boolean };
    government: { localizationRequired: boolean };
  };
}

const indiaRequirements: IndiaDataRequirements = {
  generalPersonalData: {
    localizationRequired: false,
    transferRestrictions: 'notification-based'
  },
  financialData: {
    paymentSystemData: {
      localizationRequired: true,
      copyAbroadAllowed: true // Can maintain copy abroad for processing
    },
    storageDeadline: 'Within 24 hours of processing'
  },
  sectors: {
    telecom: { localizationRequired: true }, // Subscribers data
    health: { localizationRequired: false }, // No current mandate
    government: { localizationRequired: true }
  }
};

Russia: Personal Data Law

Russia has strict data localization since 2015:

Requirements:

  • Personal data of Russian citizens must be stored in databases located in Russia
  • Processing abroad is allowed if local copy exists
  • Violations can result in website blocking
interface RussiaDataRequirements {
  personalData: {
    primaryStorageLocation: 'Russia';
    processingAbroad: boolean; // Allowed
    copyRequired: boolean; // Must maintain Russian copy
    syncRequirement: 'Primary database must be in Russia';
  };

  enforcement: {
    websiteBlocking: boolean; // Roskomnadzor can block sites
    fines: {
      individual: number; // Up to 100,000 RUB
      legal_entity: number; // Up to 18,000,000 RUB
    };
    inspections: boolean;
  };

  registryRequirement: {
    personalDataOperatorRegistry: boolean; // Must register with Roskomnadzor
    notificationRequired: boolean;
  };
}

Vietnam: Cybersecurity Law

Vietnam's requirements focus on both storage and localization:

Key Requirements:

  • Companies providing telecom, internet, or value-added services must store data locally
  • Local office requirement for certain providers
  • Important data and personal data of Vietnamese users
interface VietnamDataRequirements {
  applicableEntities: string[];
  localization: {
    dataTypes: ['personal_data', 'important_data', 'user_data'];
    storageRequired: boolean;
    localOfficeRequired: boolean;
    timeframe: string; // Within specified period after request
  };

  sectors: {
    telecom: { fullLocalization: boolean };
    internet: { fullLocalization: boolean };
    socialMedia: { localOfficeRequired: boolean };
    gaming: { localStorageRequired: boolean };
  };
}

const vietnamRequirements: VietnamDataRequirements = {
  applicableEntities: [
    'Telecom service providers',
    'Internet service providers',
    'Value-added services providers',
    'Social networks',
    'Online gaming providers'
  ],
  localization: {
    dataTypes: ['personal_data', 'important_data', 'user_data'],
    storageRequired: true,
    localOfficeRequired: true,
    timeframe: '36 months from effective date'
  },
  sectors: {
    telecom: { fullLocalization: true },
    internet: { fullLocalization: true },
    socialMedia: { localOfficeRequired: true },
    gaming: { localStorageRequired: true }
  }
};

Indonesia: Government Regulation 71

Indonesia requires storage in local data centers:

Key Requirements:

  • Electronic system operators must have local data centers
  • Strategic electronic systems have stricter requirements
  • Public systems must use local infrastructure

Other Notable Jurisdictions

Country Requirement Type Key Data Types Notes
Saudi Arabia Storage Personal, financial PDPL requires local storage
Turkey Storage Personal data KVKK localization provisions
Nigeria Storage Personal, government NDPR localization rules
Kazakhstan Storage Personal data Post-Soviet localization
Brazil Transfer restrictions Personal (LGPD) Adequacy-based transfers
South Korea Transfer restrictions Personal (PIPA) Cross-border consent required

Technical Implementation Strategies

Multi-Region Database Architecture

Building infrastructure that respects data localization requires careful architecture:

// Multi-region data architecture for localization compliance
interface MultiRegionConfig {
  regions: {
    id: string;
    name: string;
    dataCenter: string;
    jurisdiction: string[];
    localizationRequirements: {
      strictLocalization: boolean;
      primaryStorageRequired: boolean;
      crossBorderTransferAllowed: boolean;
      transferMechanism?: string;
    };
  }[];

  routingRules: {
    defaultRegion: string;
    geoRouting: boolean;
    userChoiceAllowed: boolean;
  };

  replicationStrategy: {
    type: 'none' | 'partial' | 'full';
    excludedData: string[];
    syncDirection: 'unidirectional' | 'bidirectional';
  };
}

const globalConfig: MultiRegionConfig = {
  regions: [
    {
      id: 'cn-shanghai',
      name: 'China (Shanghai)',
      dataCenter: 'Alibaba Cloud Shanghai',
      jurisdiction: ['CN'],
      localizationRequirements: {
        strictLocalization: true,
        primaryStorageRequired: true,
        crossBorderTransferAllowed: false,
        transferMechanism: 'security_assessment'
      }
    },
    {
      id: 'eu-frankfurt',
      name: 'Europe (Frankfurt)',
      dataCenter: 'AWS eu-central-1',
      jurisdiction: ['EU', 'EEA', 'CH'],
      localizationRequirements: {
        strictLocalization: false,
        primaryStorageRequired: false,
        crossBorderTransferAllowed: true,
        transferMechanism: 'adequacy_scc'
      }
    },
    {
      id: 'ru-moscow',
      name: 'Russia (Moscow)',
      dataCenter: 'Yandex Cloud Moscow',
      jurisdiction: ['RU'],
      localizationRequirements: {
        strictLocalization: true,
        primaryStorageRequired: true,
        crossBorderTransferAllowed: true,
        transferMechanism: 'local_copy_required'
      }
    },
    {
      id: 'in-mumbai',
      name: 'India (Mumbai)',
      dataCenter: 'AWS ap-south-1',
      jurisdiction: ['IN'],
      localizationRequirements: {
        strictLocalization: false, // Except financial data
        primaryStorageRequired: false,
        crossBorderTransferAllowed: true,
        transferMechanism: 'notification_based'
      }
    },
    {
      id: 'us-virginia',
      name: 'United States (Virginia)',
      dataCenter: 'AWS us-east-1',
      jurisdiction: ['US', 'DEFAULT'],
      localizationRequirements: {
        strictLocalization: false,
        primaryStorageRequired: false,
        crossBorderTransferAllowed: true
      }
    }
  ],
  routingRules: {
    defaultRegion: 'us-virginia',
    geoRouting: true,
    userChoiceAllowed: false // Must enforce localization
  },
  replicationStrategy: {
    type: 'partial',
    excludedData: ['personal_identifiers', 'financial_data', 'health_data'],
    syncDirection: 'unidirectional'
  }
};

Data Routing Service

Implement a service that routes data to the appropriate region:

// Data routing service for localization compliance
interface UserLocation {
  country: string;
  region?: string;
  determinedBy: 'ip' | 'account' | 'explicit';
  confidence: number;
}

interface DataClassification {
  type: 'personal' | 'sensitive' | 'financial' | 'health' | 'general';
  jurisdiction: string;
  localizationRequired: boolean;
  allowedRegions: string[];
}

class DataLocalizationRouter {
  private config: MultiRegionConfig;
  private geoService: GeoIPService;

  constructor(config: MultiRegionConfig) {
    this.config = config;
    this.geoService = new GeoIPService();
  }

  async determineUserLocation(
    ipAddress: string,
    accountCountry?: string
  ): Promise<UserLocation> {
    // Account country takes precedence
    if (accountCountry) {
      return {
        country: accountCountry,
        determinedBy: 'account',
        confidence: 1.0
      };
    }

    // Fall back to IP geolocation
    const geoResult = await this.geoService.lookup(ipAddress);
    return {
      country: geoResult.country,
      region: geoResult.region,
      determinedBy: 'ip',
      confidence: geoResult.accuracy
    };
  }

  classifyData(dataType: string, userLocation: UserLocation): DataClassification {
    const country = userLocation.country;

    // Check localization requirements
    const region = this.config.regions.find(r =>
      r.jurisdiction.includes(country)
    );

    if (!region) {
      // No specific requirements - use default
      return {
        type: 'general',
        jurisdiction: country,
        localizationRequired: false,
        allowedRegions: this.config.regions.map(r => r.id)
      };
    }

    // Apply jurisdiction-specific rules
    if (region.localizationRequirements.strictLocalization) {
      return {
        type: this.getDataType(dataType),
        jurisdiction: country,
        localizationRequired: true,
        allowedRegions: [region.id]
      };
    }

    return {
      type: this.getDataType(dataType),
      jurisdiction: country,
      localizationRequired: region.localizationRequirements.primaryStorageRequired,
      allowedRegions: this.getAllowedRegions(region)
    };
  }

  async routeData(
    data: any,
    dataType: string,
    userLocation: UserLocation
  ): Promise<{ region: string; endpoint: string }> {
    const classification = this.classifyData(dataType, userLocation);

    // Find the best region
    const targetRegion = this.selectRegion(classification);

    return {
      region: targetRegion.id,
      endpoint: this.getRegionEndpoint(targetRegion.id)
    };
  }

  private selectRegion(classification: DataClassification): typeof this.config.regions[0] {
    // If localization required, use the first allowed region
    if (classification.localizationRequired) {
      const region = this.config.regions.find(r =>
        classification.allowedRegions.includes(r.id)
      );
      if (!region) {
        throw new Error(
          `No compliant region found for jurisdiction: ${classification.jurisdiction}`
        );
      }
      return region;
    }

    // Otherwise, use latency-based routing or default
    return this.config.regions.find(r =>
      r.jurisdiction.includes('DEFAULT')
    ) || this.config.regions[0];
  }

  private getAllowedRegions(region: typeof this.config.regions[0]): string[] {
    if (!region.localizationRequirements.crossBorderTransferAllowed) {
      return [region.id];
    }

    // Get regions that allow transfers from this jurisdiction
    return this.config.regions
      .filter(r => !r.localizationRequirements.strictLocalization || r.id === region.id)
      .map(r => r.id);
  }

  private getDataType(dataType: string): DataClassification['type'] {
    const typeMap: Record<string, DataClassification['type']> = {
      'pii': 'personal',
      'financial': 'financial',
      'health': 'health',
      'sensitive': 'sensitive'
    };
    return typeMap[dataType] || 'general';
  }

  private getRegionEndpoint(regionId: string): string {
    const endpoints: Record<string, string> = {
      'cn-shanghai': 'https://api.cn.example.com',
      'eu-frankfurt': 'https://api.eu.example.com',
      'ru-moscow': 'https://api.ru.example.com',
      'in-mumbai': 'https://api.in.example.com',
      'us-virginia': 'https://api.example.com'
    };
    return endpoints[regionId] || endpoints['us-virginia'];
  }
}

Consent Record Localization

Consent records must stay with the data they govern:

// Consent storage that respects localization requirements
interface LocalizedConsent {
  consentId: string;
  userId: string;
  jurisdiction: string;
  storageRegion: string;
  consent: {
    analytics: boolean;
    marketing: boolean;
    functional: boolean;
    thirdPartySharing: boolean;
    crossBorderTransfer: boolean;
  };
  metadata: {
    collectedAt: Date;
    expiresAt: Date;
    version: string;
    language: string;
    legalBasis: string[];
  };
  audit: {
    originalIp: string;
    userAgent: string;
    geoLocation: string;
    consentMethod: string;
  };
}

class LocalizedConsentService {
  private router: DataLocalizationRouter;
  private regionalStores: Map<string, ConsentStore>;

  constructor(router: DataLocalizationRouter) {
    this.router = router;
    this.regionalStores = new Map();

    // Initialize regional consent stores
    this.initializeRegionalStores();
  }

  private initializeRegionalStores(): void {
    // Each region has its own consent database
    const regions = ['cn-shanghai', 'eu-frankfurt', 'ru-moscow', 'in-mumbai', 'us-virginia'];

    regions.forEach(region => {
      this.regionalStores.set(region, new ConsentStore({
        region,
        connectionString: this.getConnectionString(region),
        encryption: true
      }));
    });
  }

  async storeConsent(
    userId: string,
    consent: LocalizedConsent['consent'],
    userLocation: UserLocation
  ): Promise<LocalizedConsent> {
    // Determine the correct region for this consent record
    const routing = await this.router.routeData(
      consent,
      'consent_record',
      userLocation
    );

    const consentRecord: LocalizedConsent = {
      consentId: this.generateConsentId(),
      userId,
      jurisdiction: userLocation.country,
      storageRegion: routing.region,
      consent,
      metadata: {
        collectedAt: new Date(),
        expiresAt: this.calculateExpiry(userLocation.country),
        version: '2.0',
        language: this.getLanguage(userLocation.country),
        legalBasis: this.getLegalBasis(userLocation.country)
      },
      audit: {
        originalIp: 'hashed', // Store hashed for audit
        userAgent: 'stored',
        geoLocation: userLocation.country,
        consentMethod: 'explicit_banner'
      }
    };

    // Store in the correct regional database
    const store = this.regionalStores.get(routing.region);
    if (!store) {
      throw new Error(`No consent store for region: ${routing.region}`);
    }

    await store.save(consentRecord);

    // Log for compliance audit
    await this.auditLog({
      action: 'consent_stored',
      region: routing.region,
      jurisdiction: userLocation.country,
      timestamp: new Date()
    });

    return consentRecord;
  }

  async getConsent(
    userId: string,
    userLocation: UserLocation
  ): Promise<LocalizedConsent | null> {
    // Find consent in the user's jurisdiction's store
    const routing = await this.router.routeData(
      { userId },
      'consent_record',
      userLocation
    );

    const store = this.regionalStores.get(routing.region);
    if (!store) {
      return null;
    }

    return store.findByUserId(userId);
  }

  async migrateConsent(
    userId: string,
    fromRegion: string,
    toRegion: string
  ): Promise<void> {
    // Handle user relocation between jurisdictions
    const fromStore = this.regionalStores.get(fromRegion);
    const toStore = this.regionalStores.get(toRegion);

    if (!fromStore || !toStore) {
      throw new Error('Invalid region specified');
    }

    // Check if migration is allowed
    if (!this.isMigrationAllowed(fromRegion, toRegion)) {
      throw new Error(
        `Migration from ${fromRegion} to ${toRegion} not allowed due to localization requirements`
      );
    }

    const consent = await fromStore.findByUserId(userId);
    if (!consent) {
      return; // No consent to migrate
    }

    // Update region and re-store
    consent.storageRegion = toRegion;
    await toStore.save(consent);

    // Handle the old record according to regulations
    // Some jurisdictions require keeping a copy
    if (this.requiresLocalCopy(fromRegion)) {
      await fromStore.markAsSecondary(userId);
    } else {
      await fromStore.delete(userId);
    }
  }

  private isMigrationAllowed(fromRegion: string, toRegion: string): boolean {
    // Check if the source region allows data export
    const strictLocalizationRegions = ['cn-shanghai'];
    return !strictLocalizationRegions.includes(fromRegion);
  }

  private requiresLocalCopy(region: string): boolean {
    return region === 'ru-moscow'; // Russia requires local copy
  }

  private calculateExpiry(country: string): Date {
    const expiryDays: Record<string, number> = {
      'EU': 365, // 1 year for GDPR
      'GB': 365,
      'US': 365 * 2, // Longer in US
      'DEFAULT': 365
    };

    const days = expiryDays[country] || expiryDays['DEFAULT'];
    const expiry = new Date();
    expiry.setDate(expiry.getDate() + days);
    return expiry;
  }

  private getLegalBasis(country: string): string[] {
    // Return applicable legal basis for the jurisdiction
    const basis: Record<string, string[]> = {
      'CN': ['PIPL Art. 13', 'explicit_consent'],
      'EU': ['GDPR Art. 6(1)(a)', 'explicit_consent'],
      'RU': ['152-FZ', 'consent'],
      'IN': ['DPDP 2023', 'consent'],
      'DEFAULT': ['consent']
    };

    return basis[country] || basis['DEFAULT'];
  }
}

CMP Integration with Localization

Integrate your consent management platform with localization requirements:

// CMP configuration with localization awareness
interface LocalizationAwareCMPConfig {
  // Region-specific configurations
  regions: {
    [region: string]: {
      enabled: boolean;
      languages: string[];
      consentTypes: string[];
      defaultConsent: Record<string, boolean>;
      legalDisclosures: {
        dataController: string;
        dataLocation: string;
        crossBorderInfo: string;
        localRepresentative?: string;
      };
      bannerConfig: {
        position: string;
        requireExplicitConsent: boolean;
        showRejectButton: boolean;
        granularControl: boolean;
      };
    };
  };

  // API endpoints per region
  endpoints: {
    [region: string]: {
      consent: string;
      preferences: string;
      dsar: string;
    };
  };
}

class LocalizationAwareCMP {
  private config: LocalizationAwareCMPConfig;
  private router: DataLocalizationRouter;
  private consentService: LocalizedConsentService;

  constructor(
    config: LocalizationAwareCMPConfig,
    router: DataLocalizationRouter
  ) {
    this.config = config;
    this.router = router;
    this.consentService = new LocalizedConsentService(router);
  }

  async initialize(userIp: string, accountCountry?: string): Promise<void> {
    // Determine user location
    const location = await this.router.determineUserLocation(userIp, accountCountry);

    // Get region-specific configuration
    const regionConfig = this.getRegionConfig(location.country);

    // Load appropriate consent banner
    await this.loadBanner(regionConfig, location);

    // Check for existing consent
    const existingConsent = await this.consentService.getConsent(
      this.getUserId(),
      location
    );

    if (existingConsent && !this.isExpired(existingConsent)) {
      // Apply existing consent
      this.applyConsent(existingConsent);
    } else {
      // Show consent banner
      this.showBanner();
    }
  }

  private getRegionConfig(country: string): LocalizationAwareCMPConfig['regions'][string] {
    // Map country to region
    const regionMap: Record<string, string> = {
      'CN': 'china',
      'RU': 'russia',
      'IN': 'india',
      'VN': 'vietnam',
      // EU countries
      'DE': 'eu', 'FR': 'eu', 'IT': 'eu', 'ES': 'eu',
      // Default
      'US': 'default'
    };

    const region = regionMap[country] || 'default';
    return this.config.regions[region] || this.config.regions['default'];
  }

  private async loadBanner(
    config: LocalizationAwareCMPConfig['regions'][string],
    location: UserLocation
  ): Promise<void> {
    // Render banner with localized content
    const banner = new ConsentBanner({
      position: config.bannerConfig.position,
      requireExplicitConsent: config.bannerConfig.requireExplicitConsent,
      showRejectButton: config.bannerConfig.showRejectButton,
      granularControl: config.bannerConfig.granularControl,
      language: config.languages[0],
      disclosures: {
        ...config.legalDisclosures,
        dataLocation: this.formatDataLocation(location)
      },
      onAccept: (consent) => this.handleConsent(consent, location),
      onReject: () => this.handleReject(location),
      onPreferences: (prefs) => this.handlePreferences(prefs, location)
    });

    await banner.render();
  }

  private formatDataLocation(location: UserLocation): string {
    const routing = await this.router.routeData({}, 'personal', location);
    const regionNames: Record<string, string> = {
      'cn-shanghai': 'Shanghai, China',
      'eu-frankfurt': 'Frankfurt, Germany (EU)',
      'ru-moscow': 'Moscow, Russia',
      'in-mumbai': 'Mumbai, India',
      'us-virginia': 'Virginia, United States'
    };

    return regionNames[routing.region] || 'Your region';
  }

  private async handleConsent(
    consent: Record<string, boolean>,
    location: UserLocation
  ): Promise<void> {
    // Store consent in appropriate region
    await this.consentService.storeConsent(
      this.getUserId(),
      {
        analytics: consent.analytics || false,
        marketing: consent.marketing || false,
        functional: consent.functional || false,
        thirdPartySharing: consent.thirdParty || false,
        crossBorderTransfer: consent.crossBorder || false
      },
      location
    );

    // Apply consent to tracking
    this.applyToTracking(consent);

    // Update Google Consent Mode
    this.updateGoogleConsentMode(consent);

    // Log consent event
    this.logConsentEvent('accepted', location);
  }

  private updateGoogleConsentMode(consent: Record<string, boolean>): void {
    if (typeof gtag !== 'undefined') {
      gtag('consent', 'update', {
        'analytics_storage': consent.analytics ? 'granted' : 'denied',
        'ad_storage': consent.marketing ? 'granted' : 'denied',
        'ad_user_data': consent.marketing ? 'granted' : 'denied',
        'ad_personalization': consent.marketing ? 'granted' : 'denied',
        'functionality_storage': consent.functional ? 'granted' : 'denied',
        'personalization_storage': consent.functional ? 'granted' : 'denied'
      });
    }
  }
}

Implications for CMPs

Consent Management Platforms need to be localization-aware:

Geographic Detection

Your CMP needs accurate geo-detection to route data correctly:

interface GeoDetectionStrategy {
  // Primary: Server-side IP geolocation
  serverSide: {
    provider: 'maxmind' | 'ipinfo' | 'cloudflare';
    accuracy: 'country' | 'region' | 'city';
    caching: boolean;
  };

  // Fallback: User account country
  accountBased: {
    trustAccountCountry: boolean;
    allowUserOverride: boolean;
  };

  // Client hints (emerging standard)
  clientHints: {
    enabled: boolean;
    fallbackToIp: boolean;
  };
}

async function determineJurisdiction(
  request: Request,
  user?: User
): Promise<string> {
  // Priority 1: Explicit user account setting
  if (user?.residenceCountry) {
    return user.residenceCountry;
  }

  // Priority 2: Client hints (privacy-preserving)
  const clientCountry = request.headers.get('Sec-CH-UA-Country');
  if (clientCountry) {
    return clientCountry;
  }

  // Priority 3: Cloudflare/CDN country header
  const cfCountry = request.headers.get('CF-IPCountry');
  if (cfCountry) {
    return cfCountry;
  }

  // Priority 4: Server-side IP lookup
  const ip = getClientIP(request);
  const geoResult = await geoIP.lookup(ip);
  return geoResult.country;
}

Multi-Region Consent Storage

┌─────────────────────────────────────────────────────────────────────┐
│                Multi-Region Consent Architecture                     │
├─────────────────────────────────────────────────────────────────────┤
│                                                                      │
│    User Request                                                      │
│         │                                                            │
│         ▼                                                            │
│  ┌─────────────┐                                                    │
│  │  Geo Router │ ────────────────────────────────────┐              │
│  └──────┬──────┘                                     │              │
│         │                                             │              │
│    ┌────┴────────────────────────────────────┐       │              │
│    │                                          │       │              │
│    ▼               ▼               ▼          ▼       │              │
│ ┌──────┐       ┌──────┐       ┌──────┐   ┌──────┐   │              │
│ │ CN   │       │ EU   │       │ RU   │   │ US   │   │              │
│ │Region│       │Region│       │Region│   │Region│   │              │
│ └──┬───┘       └──┬───┘       └──┬───┘   └──┬───┘   │              │
│    │              │              │          │        │              │
│    ▼              ▼              ▼          ▼        │              │
│ ┌──────┐       ┌──────┐       ┌──────┐   ┌──────┐   │              │
│ │Local │       │Local │       │Local │   │Local │   │              │
│ │  DB  │       │  DB  │       │  DB  │   │  DB  │   │              │
│ └──────┘       └──────┘       └──────┘   └──────┘   │              │
│                                                      │              │
│    ◄─────── No Cross-Region Sync ────────►          │              │
│    (Strict localization regions)                     │              │
│                                                      │              │
│    ◄─────── Metadata Sync Only ─────────►           │              │
│    (For global user experience)                      │              │
│                                                                      │
└─────────────────────────────────────────────────────────────────────┘

Best Practices for Data Localization Compliance

1. Map Your Data Flows

Before implementing, understand where your data goes:

interface DataFlowMapping {
  dataType: string;
  source: {
    collection: string; // Where collected
    method: string; // How collected
  };
  processing: {
    location: string[];
    purposes: string[];
    processors: string[];
  };
  storage: {
    primary: string;
    backup: string[];
    retention: string;
  };
  transfers: {
    destinations: string[];
    mechanisms: string[];
    purposes: string[];
  };
}

// Create comprehensive data flow map
const dataFlows: DataFlowMapping[] = [
  {
    dataType: 'User Profile Data',
    source: {
      collection: 'Registration Form',
      method: 'Direct collection'
    },
    processing: {
      location: ['User\'s region'],
      purposes: ['Account management', 'Service delivery'],
      processors: ['Internal']
    },
    storage: {
      primary: 'User\'s jurisdiction',
      backup: ['Disaster recovery region'],
      retention: '5 years after account closure'
    },
    transfers: {
      destinations: ['None - locally stored'],
      mechanisms: ['N/A'],
      purposes: ['N/A']
    }
  },
  {
    dataType: 'Analytics Data',
    source: {
      collection: 'Website/App',
      method: 'Cookies/SDK'
    },
    processing: {
      location: ['US (Google Analytics)', 'User region (first-party)'],
      purposes: ['Usage analysis', 'Service improvement'],
      processors: ['Google', 'Internal']
    },
    storage: {
      primary: 'US (GA), User region (first-party)',
      backup: [],
      retention: '26 months'
    },
    transfers: {
      destinations: ['US'],
      mechanisms: ['SCCs', 'Consent'],
      purposes: ['Analytics processing']
    }
  }
];

2. Implement Defense in Depth

Multiple layers of compliance protection:

  1. Application Layer: Route data based on user jurisdiction
  2. Database Layer: Enforce geographic constraints
  3. Network Layer: Prevent cross-region access
  4. Audit Layer: Monitor and log all data movements

3. Plan for Regulatory Change

Build flexibility into your architecture:

// Feature flags for regulatory requirements
const regulatoryFlags = {
  china: {
    strictLocalization: true,
    securityAssessmentRequired: true,
    crossBorderAllowed: false
  },
  india: {
    strictLocalization: false, // May change
    sectoralRequirements: {
      financial: true,
      telecom: true
    }
  },
  brazil: {
    localization: false, // Currently transfer-based
    watchForChanges: true
  }
};

// Easy to update when regulations change
function updateRegulation(country: string, changes: Partial<typeof regulatoryFlags.china>) {
  regulatoryFlags[country] = { ...regulatoryFlags[country], ...changes };
  // Trigger re-routing of affected data
  revalidateDataRouting(country);
}

Preparing for the Future

Data localization is no longer optional for global businesses. The trend is clear: more countries are implementing storage and processing requirements, and existing requirements are becoming stricter.

Key takeaways for 2025:

  1. Audit your current data flows - Understand where data is collected, processed, and stored
  2. Invest in multi-region infrastructure - The cost of retrofitting is higher than building correctly from the start
  3. Keep consent records with the data - Consent must be stored in the same jurisdiction as the data it governs
  4. Implement robust geo-detection - Accurate jurisdiction determination is the foundation of compliance
  5. Plan for change - Build flexibility into your architecture as regulations continue to evolve
  6. Work with local counsel - Requirements vary by sector and data type; get jurisdiction-specific advice

The companies that treat data localization as a strategic capability rather than a compliance burden will have significant advantages as global privacy regulation continues to evolve. Start building your multi-region data strategy now.

G

Tým GetCookies

Napsal a udržuje tým GetCookies ve společnosti Getia AS v Oslu v Norsku. Tento článek poskytuje obecné informace o souhlasu s cookies a není právním poradenstvím.

Naskenujte svůj web zdarma

Bezplatný plán zobrazuje banner na jednom webu a nabízí tři skeny cookies měsíčně. Bez karty, bez obchodních hovorů.