Research Paper & Open Initiative v1.0

Every record in its own country, one system for all

The FoundationCX way to handle data spread across many countries simply, keeping personal data inside its home jurisdiction.

Author: FoundationCX Team
Date:
Contact: info@foundationcx.com
1 minute

A decision-maker who wants the idea

Recommended sections: Part 1

10 minutes

A business owner or manager who wants to understand

Recommended sections: Parts 1–2

20 minutes

Deciding to buy or run such a system

Recommended sections: Parts 1–4

30 minutes

An engineer or technology lead

Recommended sections: Parts 5–6

20 minutes

A lawyer or compliance officer

Recommended sections: Part 4, plus the Sources section

Part 1: The idea in one minute

  1. The problem: your company or partner serves clients in Egypt, Saudi Arabia, Europe and the US, and each country restricts people’s data leaving it.
  2. What many miss: the law cares not only where the database sits, but where any program that reads, processes or copies the data runs. Reading data from another country counts as moving it, even if nothing is saved.
  3. The solution: each country gets a complete “home” (the program, the database and the backups, all inside it). On top sits one interface: the user signs in once and sees each country’s data coming straight from its home.
  4. What reaches the centre: numbers and totals only, never names or phone numbers.
  5. The result: one system in the user’s eyes, personal data that stays in its country, and the least possible licensing and contract work.

Part 2: The plain explanation

2.1 Example: one partner, clients in four countries

Sara is an Egyptian partner who sells our systems. She has a client in Cairo, one in Riyadh, one in Berlin and one in Dubai. She wants one screen with her clients, deals and commissions.

  • Sara’s own data (name, phone, bank account) is Egyptian, so it lives in Egypt.
  • The Riyadh client’s data (company name, the people we deal with) is Saudi, so it lives in Saudi Arabia.
  • The same goes for Berlin in Europe and Dubai in the UAE.

2.2 An analogy: a bank with branches in several countries

Each branch keeps its customers’ files in its own country, and its staff work on them there. Head office sees only consolidated reports.

  • The branch is the country’s “home”: program and data together.
  • The single card is the single sign-on: one login, and the user reaches every branch they are allowed into.
  • Head office is the centre, and it sees only totals.

2.3 Three common beliefs that are not accurate

BeliefReality
”It’s enough for the database to be in the country”The program reading it, the backups, the mail and the error logs are all data or processing. If they are abroad, the data has left
”We’ll only read from abroad and store nothing”Reading is a transfer: Egypt’s law says “making available”, Kenya’s 2026 guidance says so explicitly, and European practice leans the same way
”The law requires the server to be in-country”Mostly it does not. Laws put conditions on data leaving, and keeping it home is the simplest way to meet them

2.4 Who sees what

PartySeesFrom where
Sara, the partnerAll her clients and deals on one screenEach client straight from its country’s home to her screen
The Riyadh clientOnly its own dataThe Saudi home
Programme management at the centreNumber of deals, their value, commissionsTotals sent by the homes, no personal data
Technical supportNothing by defaultTemporary access the client approves, logged

Part 3: For decision-makers

3.1 When do we open a home in a new country?

When a client or partner covers its cost. A home is not opened “just in case”.

  • Until then: the deal is recorded with company data only (name, sector, value, status), without contact persons unless they agree in writing.
  • Europe and the US: neither requires a server in each country, so one home for Europe and one for the US are enough, unless a client’s contract asks otherwise.

3.2 Ten questions for any system you buy or build

  1. What is each client’s country, and is it in the contract?
  2. Where are the database and files?
  3. Where does the program that reads and processes the data run?
  4. Where are the backups and the disaster-recovery copy?
  5. Where are the encryption keys?
  6. Where does support log in from, and on what legal basis?
  7. Where do mail and SMS pass?
  8. Where are the error logs and monitoring tools?
  9. What reaches the centre? Only totals?
  10. Is there a register proving all of this to an auditor or regulator?

Part 4: What the laws say

MarketMust data stay in-country?When may it leave?Breach noticeTop penalty
Egypt (Law 151/2020; Regulations 816/2025; grace period ended 31/10/2026)No general rule; classified government data is hosted in EgyptA PDPC licence per destination, protection not lower than Egypt’s, and the data subject’s consent. Storing abroad is a transfer72 h (immediately if national security is involved)≥3 months’ prison and/or EGP 0.5–5M
Saudi Arabia (PDPL; Transfer Regulation updated 2024)No general rule; government bodies fall under the NCA Cloud Cybersecurity Controls (CCC-2:2024)Adequacy list or SDAIA standard clauses, with a risk assessment in defined cases72 hSAR 5M, doubled on repeat
UAE (Decree-Law 45/2021)No general rule; health data may not be stored abroad without an official exemption (Federal Law 2/2019)Adequate country, binding contract or express consentSet by the regulationsExecutive Regulations not issued as of mid-2026, per international law firms
EU (GDPR)NoAdequacy, or standard clauses with an impact assessment. The EU–US framework was upheld by the General Court on 3/9/202572 h€20M or 4% of turnover
Bahrain, Morocco, OmanNoStrict: adequacy list or authorisation; in Oman, explicit consent before any transferVariesVaries
QatarNoFree flow by defaultYesFines
Kuwait (CITRA licensees)NoAfter notifying the user24 hPer licence
KenyaYes for strategic dataWith safeguards; remote access is a transfer72 hFines
IndiaNo, except some sectors such as paymentsAllowed except to barred countries, from 13/5/2027YesUp to INR 250 crore
USNoFree, but transfers to “countries of concern” are barredState lawsVaries by state

Each row’s source and reading date are listed under Sources at the end of the paper.


Part 5: Technical details

5.1 The governing principle

Data and the program that processes it live together inside the country. The code can be one; the running is local.

5.2 Four ways we assessed

WayDescriptionVerdict
1. One program connected to many databasesOne server (say, in Egypt) reads each country’s database✘ Reading from abroad is a transfer. In ERPNext a request is bound to one database, so the framework would need rebuilding
2. A middle layer that gathers at read time and stores nothingFederated queries (Trino, MariaDB FederatedX/CONNECT)✘ Every page view is a transfer, logs and caches keep copies, and it bypasses the system’s permissions
3. One interface, many homesA complete home per country with the same code; single sign-on; the browser calls each home directly and shows everything on one screen✔ Recommended for full systems
4. A data vault per countryThe central system stores tokens instead of names and phones; the real values sit in a vault in each country and the browser fetches them directly✔ Fits systems with little personal data (like a partner portal); not a full ERP

5.3 The overall shape

5.4 Where each kind of data lives

DataLocation
The user’s personal data (name, phone, bank account)Their country
The client and its contact personsThe client’s country
The user’s presence in other countries’ homesA pseudonymous ID only
A deal’s status, value and commissionIn the client’s home; reaches the centre as totals
The central directoryClient ID, country, URL, plan and status only

5.5 Operating rules

  1. Sign-in: single, from the user’s home, over OAuth2; each home verifies the token.
  2. Addresses: each home has a country subdomain; there is no global login page that looks people up by e-mail.
  3. Support: no standing access. Access is temporary and time-boxed, approved by the client, logged inside the home, and backed by the contract.
  4. Backups and recovery: inside the same country, through a second provider if needed.
  5. Encryption keys: inside the country.
  6. Sub-processors (mail, SMS, monitoring): in-country or self-hosted. CDNs are used for DNS only.
  7. Totals: have a minimum threshold so small counts cannot identify people.
  8. Releases: one for all homes; tried on one site first, then rolled through the sites one by one without stopping at the first error.
  9. Residency register: per home, recording the data, its location, sub-processors and who accessed it.

5.6 Applying it to ERPNext/Frappe

  • Available out of the box: a separate site per client with its own database and backups; independent server groups per country; Frappe can act as an OAuth2 sign-in provider; a REST API and per-site CORS.
  • To avoid: different clients in one site separated only by the “Company” field. In v16 that separation leaks through reports and notifications.

Part 6: What large companies do

  • Microsoft completed the EU Data Boundary on 26/2/2025 in three phases; the last covered support data and logs, the hardest part.
  • Salesforce runs the same platform in about twenty countries, the UAE among them. It states that some data may leave and sells an add-on for more control.
  • AWS runs a separate European cloud operated by EU residents, so residency covers the people, not only the machines.
  • Atlassian and Slack let the customer choose a region and publish what that covers.
  • Google in Dammam has encryption keys run by a Saudi partner; the customer can refuse access to them.

Links for these examples are under Sources at the end of the paper.


Part 7: An invitation to the community

We propose this method as an open reference:

  • a law comparison table, updated regularly with its sources;
  • a free checklist for any company;
  • a documented reference design on ERPNext for anyone who wants to apply it.

Corrections from lawyers and engineers are welcome at info@foundationcx.com.

Frequently asked questions

Is it enough for the database to be in the country? ▼

The program reading it, the backups, the mail and the error logs are all data or processing. If they are abroad, the data has left.

Can we only read from abroad and store nothing? ▼

Reading is a transfer: Egypt's law says "making available", Kenya's 2026 guidance says so explicitly, and European practice leans the same way.

Does the law require the server to be in-country? ▼

Mostly it does not. Laws put conditions on data leaving, and keeping it home is the simplest way to meet them.

Glossary

Data residency
Data and its processing staying inside a given country
Cross-border transfer
Data leaving the country in any form: copying, storing, reading or making available
Home (cell)
A complete copy of the system running inside one country
Centre
The global part of the system; it holds no personal data
Totals
Aggregate numbers that do not point to people
Pseudonymous ID / token
A value that stands in for a personal detail and reveals it only by going back to its country
Standard clauses
A model contract issued by a regulator to cover a transfer
Adequacy list
Countries a regulator considers to offer adequate protection

Sources

  1. [1]
    Egypt Law 151/2020, Article 7 (72-hour notice), Arabic text https://masaar.net/ar/egypt_laws/ Read on: 14/11/2026
  2. [2]
    UAE Federal Law 2/2019 on ICT in health fields https://uaelegislation.gov.ae/en/legislations/1209 Read on: 14/11/2026
  3. [3]
  4. [4]
    Kenya Data Protection Act 2019, section 43 (ODPC) https://www.odpc.go.ke/wp-content/uploads/2024/02/TheDataProtectionAct__No24of2019.pdf Read on: 14/11/2026
  5. [5]
    India DPDP Act 2023, Schedule of penalties https://www.dpdpa.com/theschedule.html Read on: 14/11/2026
  6. [6]
    Covington, Middle East Hot Topics 2026 Mid-Year Review (UAE regulations status) https://www.cov.com/en/news-and-insights/insights/2026/08/middle-east-hot-topics-2026-mid-year-review Read on: 14/11/2026
  7. [7]
    Egypt Data Protection Law 151/2020 & Regulations 816/2025 https://itida.gov.eg Read on: 13/11/2026
  8. [8]
    Saudi Personal Data Protection Law & Transfer Regulation (SDAIA) https://sdaia.gov.sa Read on: 13/11/2026
  9. [9]
    UAE Federal Decree-Law No. 45/2021 https://uaelegislation.gov.ae Read on: 13/11/2026
  10. [10]
    EU General Data Protection Regulation (GDPR) https://eur-lex.europa.eu Read on: 13/11/2026
  11. [11]
    Kenya ODPC Guidance Notes on Cross-Border Data Transfers https://www.odpc.go.ke Read on: 13/11/2026
  12. [12]
    India Digital Personal Data Protection Act 2023 & DPDP Rules 2025 https://www.meity.gov.in Read on: 13/11/2026
  13. [13]
    Microsoft EU Data Boundary Architecture https://learn.microsoft.com Read on: 13/11/2026

How to cite this paper v1.0

Use standard APA reference format or the BibTeX entry below:

FoundationCX Team. (2026). Every record in its own country, one system for all (Version 1.0). FoundationCX Research. Available at: https://foundationcx.com/research/data-residency/
Show BibTeX Citation
@techreport{foundationcx2026residency,
  author      = {FoundationCX Team},
  title       = {Every record in its own country, one system for all},
  institution = {FoundationCX},
  year        = {2026},
  number      = {v1.0},
  url         = {https://foundationcx.com/research/data-residency/}
}

Version history

v1.0

· First public edition

An 18-market law comparison, the “a home in every country, one interface” pattern, and how it applies to ERPNext/Frappe. We update the paper when a law changes or a correction reaches us.

Analogy: A bank with branches in several countries Diagram
Analogy: A bank with branches in several countries Shows how each country branch retains its client records locally, accessed via a single card, sending only aggregate totals to head office. User / Partner Single Card (Single Sign-On) Bank Branches (Independent Homes) EG Cairo Branch (Egypt) Program + Data locally MariaDB + App SA Riyadh Branch (Saudi Arabia) Program + Data locally MariaDB + App EU Berlin Branch (Europe) Program + Data locally MariaDB + App AE Dubai Branch (UAE) Program + Data locally MariaDB + App Consolidated totals only (no personal data) Head Office (The Centre) Counts, volume, overall metrics
72 h being verified

Breach Notification Window

Egypt, Saudi Arabia, EU, Kenya

Egypt Law 151 Art. 7, SDAIA Reg. Art. 24, GDPR Art. 33

24 h

Fastest Breach Clock in Gulf

Kuwait (CITRA Licensed Providers)

CITRA Decision 26/2024 Reg. Art. 6(1)

18 markets

Jurisdictions Compared

Egypt, GCC, EU, East/West Africa, India, US

Law comparison table, Part 4

EGP 0.5–5M

Top Transfer Fine in Egypt

Unlawful export fine plus >=3 months imprisonment

Egypt Personal Data Law 151/2020 Art. 42

SAR 5M

Top PDPL Fine in Saudi Arabia

Doubled on repeat, up to 2 yrs prison for sensitive leak

Saudi PDPL Art. 34 & Transfer Regulation

EUR 20M / 4%

Maximum GDPR Sanction

€20 million or 4% of worldwide annual turnover

EU General Data Protection Regulation Art. 83

Markets Grid: Cross-Border Data Transfer Strictness Regulatory Map
Markets Grid: Cross-Border Data Transfer Strictness Classification of 13 major jurisdictions into three regulatory tiers: strict exit requirements, conditional adequacy/safeguards, and open baseline flow. Tier 1: Strict on Data Leaving Requires prior administrative licences, prior explicit consent, or strict adequacy lists. STRICT Egypt Licence per destination; remote access is transfer STRICT Morocco Prior CNDP licence required before transfer STRICT Oman Explicit user consent prior to any transfer STRICT Bahrain Authority adequacy list or prior transfer permit STRICT Saudi Arabia Adequacy or SDAIA SCCs + transfer risk assess. Tier 2: Conditional on Safeguards Permits transfers with standard contractual clauses (SCCs), adequacy, or impact assessments. CONDITIONAL European Union GDPR Adequacy / SCCs + Schrems II transfer TIA CONDITIONAL United Arab Emirates Adequacy, binding contract, or explicit user consent CONDITIONAL Kenya Strategic data in-country; remote access is transfer CONDITIONAL Nigeria GAID 2025 instruments + annual compliance audit CONDITIONAL Jordan Equivalent protection or MoDEE instructions Tier 3: Open / Baseline Free Flow Defaults to unrestricted flow, subject only to negative barred lists or user notice. OPEN Qatar Default freedom of data movement under processor accountability OPEN India Unrestricted baseline flow; negative barred list from May 2027 OPEN United States Unrestricted baseline flow; restrictions on countries of concern Regulatory Tier Legend (identified by explicit text and color): Strict Conditional Open Baseline
Comparison of the Four Architecture Patterns

Evaluation of four architectural approaches for cross-border data handling: two rejected and two accepted based on technical and legal compliance.

  1. Rejected ✘

    1. One program to many databases

    A central server querying each country's database on demand

    Remote reading constitutes a cross-border transfer; requires rewriting ERP framework

  2. Rejected ✘

    2. Middle query layer without storage

    Federated queries (Trino, FederatedX) aggregating at read time

    Every screen view is a transfer; logs and caches retain uncontrolled copies

  3. Recommended ✔

    3. One interface, many homes

    Complete independent home per country with single sign-on direct access

    Data and processing live together locally; only aggregated totals leave the country

  4. Accepted in part ✔

    4. Local data vault per country

    Central system holds tokens; real personal values reside in local vault

    Fits light systems (e.g. partner portals); unsuitable for a complete ERP

Architecture: One interface, many homes Technical Architecture
Architecture: One interface, many homes Shows the browser communicating directly with independent country homes, while the central system receives only aggregate totals without personal data. Browser (One Screen) OAuth2 Single Sign-On from user's home Egypt Home Frappe/ERP Application Local MariaDB Database Backups + Mail + Keys In-country provider Saudi Home Frappe/ERP Application Local MariaDB Database Backups + Mail + Keys In-country cloud (KSA) Europe Home Frappe/ERP Application Local MariaDB Database Backups + Mail + Keys EU region US Home Frappe/ERP Application Local MariaDB Database Backups + Mail + Keys US cloud provider Totals only (counts, amounts) ── no personal data Centre: Client directory & countries, releases, reports (Holds and processes no personal data)
Totals Pattern: Blocking Raw Records, Passing Aggregates Only Architecture Pattern
Totals Pattern: Blocking Raw Records, Passing Aggregates Only Architectural pattern illustrating personal records strictly contained in-country while only k-anonymised aggregated KPIs cross national borders. In-Country Domain (Local Branch) In-Country Database • Full customer names & contacts • Individual deal & order items • Phone numbers, addresses & emails • Detailed per-transaction logs Aggregation & Threshold Filter Removes identifiers, applies a minimum-count threshold Aggregation & threshold engine BORDER ❌ Personal Data Strictly Blocked ✔ Anonymised Totals Only The centre (no personal data) Permitted Inflow at Headquarters • Number of deals • Deal value and commissions • System health metrics ✔ Zero PII Crosses National Border