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.
A decision-maker who wants the idea
Recommended sections: Part 1
A business owner or manager who wants to understand
Recommended sections: Parts 1–2
Deciding to buy or run such a system
Recommended sections: Parts 1–4
An engineer or technology lead
Recommended sections: Parts 5–6
A lawyer or compliance officer
Recommended sections: Part 4, plus the Sources section
Part 1: The idea in one minute
- 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.
- 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.
- 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.
- What reaches the centre: numbers and totals only, never names or phone numbers.
- 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
| Belief | Reality |
|---|---|
| ”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
| Party | Sees | From where |
|---|---|---|
| Sara, the partner | All her clients and deals on one screen | Each client straight from its country’s home to her screen |
| The Riyadh client | Only its own data | The Saudi home |
| Programme management at the centre | Number of deals, their value, commissions | Totals sent by the homes, no personal data |
| Technical support | Nothing by default | Temporary 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
- What is each client’s country, and is it in the contract?
- Where are the database and files?
- Where does the program that reads and processes the data run?
- Where are the backups and the disaster-recovery copy?
- Where are the encryption keys?
- Where does support log in from, and on what legal basis?
- Where do mail and SMS pass?
- Where are the error logs and monitoring tools?
- What reaches the centre? Only totals?
- Is there a register proving all of this to an auditor or regulator?
Part 4: What the laws say
| Market | Must data stay in-country? | When may it leave? | Breach notice | Top penalty |
|---|---|---|---|---|
| Egypt (Law 151/2020; Regulations 816/2025; grace period ended 31/10/2026) | No general rule; classified government data is hosted in Egypt | A PDPC licence per destination, protection not lower than Egypt’s, and the data subject’s consent. Storing abroad is a transfer | 72 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 cases | 72 h | SAR 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 consent | Set by the regulations | Executive Regulations not issued as of mid-2026, per international law firms |
| EU (GDPR) | No | Adequacy, or standard clauses with an impact assessment. The EU–US framework was upheld by the General Court on 3/9/2025 | 72 h | €20M or 4% of turnover |
| Bahrain, Morocco, Oman | No | Strict: adequacy list or authorisation; in Oman, explicit consent before any transfer | Varies | Varies |
| Qatar | No | Free flow by default | Yes | Fines |
| Kuwait (CITRA licensees) | No | After notifying the user | 24 h | Per licence |
| Kenya | Yes for strategic data | With safeguards; remote access is a transfer | 72 h | Fines |
| India | No, except some sectors such as payments | Allowed except to barred countries, from 13/5/2027 | Yes | Up to INR 250 crore |
| US | No | Free, but transfers to “countries of concern” are barred | State laws | Varies 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
| Way | Description | Verdict |
|---|---|---|
| 1. One program connected to many databases | One 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 nothing | Federated 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 homes | A 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 country | The 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
| Data | Location |
|---|---|
| The user’s personal data (name, phone, bank account) | Their country |
| The client and its contact persons | The client’s country |
| The user’s presence in other countries’ homes | A pseudonymous ID only |
| A deal’s status, value and commission | In the client’s home; reaches the centre as totals |
| The central directory | Client ID, country, URL, plan and status only |
5.5 Operating rules
- Sign-in: single, from the user’s home, over OAuth2; each home verifies the token.
- Addresses: each home has a country subdomain; there is no global login page that looks people up by e-mail.
- Support: no standing access. Access is temporary and time-boxed, approved by the client, logged inside the home, and backed by the contract.
- Backups and recovery: inside the same country, through a second provider if needed.
- Encryption keys: inside the country.
- Sub-processors (mail, SMS, monitoring): in-country or self-hosted. CDNs are used for DNS only.
- Totals: have a minimum threshold so small counts cannot identify people.
- Releases: one for all homes; tried on one site first, then rolled through the sites one by one without stopping at the first error.
- 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] Egypt Law 151/2020, Article 7 (72-hour notice), Arabic text https://masaar.net/ar/egypt_laws/ Read on: 14/11/2026
- [2] UAE Federal Law 2/2019 on ICT in health fields https://uaelegislation.gov.ae/en/legislations/1209 Read on: 14/11/2026
- [3] NCA Cloud Cybersecurity Controls CCC-2:2024 https://cdn.nca.gov.sa/api/files/public/upload/6d5408a3-d8e6-4e96-963b-2c7198e5b7c2_CCC-2-2024-EN-.pdf Read on: 14/11/2026
- [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] India DPDP Act 2023, Schedule of penalties https://www.dpdpa.com/theschedule.html Read on: 14/11/2026
- [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]
- [8] Saudi Personal Data Protection Law & Transfer Regulation (SDAIA) https://sdaia.gov.sa Read on: 13/11/2026
- [9]
- [10]
- [11]
- [12] India Digital Personal Data Protection Act 2023 & DPDP Rules 2025 https://www.meity.gov.in Read on: 13/11/2026
- [13]
How to cite this paper v1.0
Use standard APA reference format or the BibTeX entry below:
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
· 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.
Breach Notification Window
Egypt, Saudi Arabia, EU, Kenya
Egypt Law 151 Art. 7, SDAIA Reg. Art. 24, GDPR Art. 33
Fastest Breach Clock in Gulf
Kuwait (CITRA Licensed Providers)
CITRA Decision 26/2024 Reg. Art. 6(1)
Jurisdictions Compared
Egypt, GCC, EU, East/West Africa, India, US
Law comparison table, Part 4
Top Transfer Fine in Egypt
Unlawful export fine plus >=3 months imprisonment
Egypt Personal Data Law 151/2020 Art. 42
Top PDPL Fine in Saudi Arabia
Doubled on repeat, up to 2 yrs prison for sensitive leak
Saudi PDPL Art. 34 & Transfer Regulation
Maximum GDPR Sanction
€20 million or 4% of worldwide annual turnover
EU General Data Protection Regulation Art. 83
Evaluation of four architectural approaches for cross-border data handling: two rejected and two accepted based on technical and legal compliance.
- 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
- 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
- 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
- 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