Two companies pay for one product. A manager from the first opens Monday’s report and sees the second company’s calls, invoices, names, or branch totals. Support calls it a filter mistake. The next release hides one column. A month later the export repeats the same leak, or a nightly email sends one customer’s summary to another. The product is still shared. The promise was not. Each customer was promised that their records stay with them.
You do not need a lecture on schemas. You need the places where this boundary usually fails, the question to ask before the next report or integration, and a check you can run with two logins. Speed is a separate issue. A faster report that still shows the wrong company is still wrong. This note stays on isolation. It is not a pitch for a replacement platform.
1. The report is where the leak becomes visible
Customers do not inspect your database. They open a page with their company name in the corner and a table in the middle. That is where the mistake shows up. Most often it is a report: monthly calls, unpaid invoices, branch comparison, sales totals. The report was built when there was only one company, or it was built by someone who could see every company and never noticed that the filter was optional.
The weak point is usually the company selector. It remembers the last company. It has an "all companies" value a customer can reach. Or the link in an email already contains another company’s id. The page was tested under an administrator account. Administrators are supposed to see across companies. Customers are not. An admin login does not test the promise you made to customers.
Use two real customer logins, or two test logins that must not see each other. Open the same report under both. Write down the rows. You are not checking the spinner yet. You are checking whether a name, branch, invoice, or total belongs to the other login. If the report is also slow, measure that after you confirm the rows are correct on the same page. The performance side is a separate pass: reports that make people wait. Do not let a slow page hide the wrong rows. Do not let a performance task widen the query "while we are here."
2. The nightly file and the email
The page can be correct while the night job is wrong. A scheduled task builds an export or sends a summary email. It may have been written as "open the database and walk the rows." When the second customer arrived, the task kept opening whichever database it was given, or it kept walking every row because nobody added the customer to the message that starts the job.
On one multi-tenant CRM, each branch had its own database. The split was part of the product shape from the start. Migrations and indexes were built around it. Background work had a second rule too: a repeated run must not send a second email or write a second score. And the worker had to reject a connection that did not match the customer named in the message. A job that opens "the" database and trusts the message will happily write one customer’s rows as another customer’s. The queue will not stop it. The message has to name the customer, and the worker has to refuse the connection that disagrees.
You can ask for this without reading the worker code. Which job sends the email or builds the file? Which customer is that run allowed to touch? What happens if the job starts twice? If the answer is "it uses the main database," ask what "main" means now that more than one customer exists. The shape of a safe retry, and why a second process does not fix a confused message, is in when work leaves the web request.
3. The person who is allowed to see everyone
Somebody has to see across customers. You do. Support does. Sometimes the implementation partner does. That access is not the bug. The bug is an account that can switch companies without the page clearly saying which company is open. Or a switch that is really just a bookmark a customer can forward. Or one shared login left in a chat for everyone who ever joined a call. Then the leak happens through a person who thought they were looking at their own company.
Make the current company obvious on the page. Make switching a deliberate action that leaves a record. Do not keep one shared password for every implementer who has touched the product. When an agency hands the product to a new developer, this account should be in the first handover note, not discovered on the live system. That pack is the agency handover.
4. Search, a new integration, a new column
Search is the other place where the mix appears. A search box looks across every customer because the index was built on a shared table and the customer boundary was left out. A missing index makes search feel broken because it takes too long. A missing boundary makes search dangerous because the right name appears under the wrong company. Those are different faults. If you fix speed without fixing isolation, the wrong rows arrive sooner. On the CRM above, indexes were part of the branch split. They were not a later speed patch on top of one shared pile.
A new integration breaks the boundary in a quieter way. Telephony, messaging, accounting, or call scoring sends an identifier, and your product writes a row. If the worker trusts that identifier and writes into whichever database it already had open, the call lands in the wrong branch. On that product, integrations followed the same rule as reports. The message named the branch. The worker used that branch’s database. Accounting and messaging did not get a special exception because they were "just a sync."
Before the next report, export, search field, or integration, add one line to the request: checked as two customers who must not see each other. If the only place you can run that check is production, do not make real customers the first test. A copy, even a rough one, is where a wrong query is allowed to show the wrong rows. Patching the live product to "see whether the filter holds" is the kind of production edit covered in why a live site is a bad place to find out.
One database per branch is a shape that has worked, with migrations and indexes built around the split. One database for everyone can also work, if every path is forced to the customer and you have proved it with the two logins. The failure is the path that forgets. Another product’s layout does not prove yours is safe. It also does not justify a rebuild before you have opened the report twice.
5. A short plan that is not a new platform
Today: run the two-login check on the report people already trust, and on one export or email. Write down what each login saw. Next: list the jobs and integrations, each with the customer that run may touch, and what a second run is allowed to do. Later: every new page starts with the line about two customers. A replacement product is a later discussion, and only if the current one cannot keep that line. Most of the time it can. It was simply shipped without this check.
When to bring in a specialist
Open the two logins yourself. You do not need a developer to spot another company’s name in a table. Ask for help when you cannot get a second login, when nobody can say which database a job opens, when an integration has already written rows you cannot attribute to a customer, or when the only proposed fix is a faster query that still does not name the customer.
That is the work I take on in products that already have customers: boundary first, then the report or the job. Services cover SaaS and backend systems, the reporting around them, and the integrations that write back into them. Selected work keeps each result next to the operation that produced it, including a CRM where each branch had its own database. One customer’s rows in another’s report is exactly what the technical audit and code review looks for. If you want a second look, write to me. Send the report name and what the two logins showed. Do not send a dump of customer rows.