Sensitive data should live in as few places as possible, each with access rules you have tested and a contract that says who is responsible for it. Card numbers belong with your payment processor as tokens, and for patient and personal data you can use your own database with real controls, a vault or tokenization service, a platform that signs a business associate agreement, or a managed service that takes custody. The right choice depends on the type of data, who signs what, and what your team can actually run.

Start with the type of data

Different data comes with different rules, so sort yours before you pick a home. Cardholder data is the card number and the details tied to it, and PCI DSS governs it. Protected health information, or PHI, is health information that identifies a person and is handled by a covered entity, such as a clinic or health plan, or by a business associate working for one. HIPAA governs PHI. Personal data covers names, emails, addresses and similar records, and state privacy laws and your customer contracts govern it.

DataMain rulesSensible default home
Card numbersPCI DSSYour processor's hosted payment fields, with only tokens and the last four digits kept by you
Patient data (PHI)HIPAA and your business associate agreementsA provider that signs a BAA, set up with controls you can prove
Personal dataState privacy laws and customer contractsYour own database with tested access rules
Secrets and API keysYour providers' terms and your own security programA secrets vault or server-side environment variables, never browser code

Card data is the easiest call. Stripe's Checkout and Elements collect card details in fields served from Stripe's domain, so card numbers never touch your servers, and Stripe maps both to SAQ A, a short self-assessment questionnaire. If you send raw card numbers to Stripe's API yourself, you must prove compliance every year with SAQ D, the most demanding one (Stripe PCI guide). Stripe also says the card type, last four digits and expiration date it returns are not subject to PCI, so you can store those (Stripe integration security guide). If your checkout embeds the payment form in your own page, a 2025 rule also asks you to confirm that page is protected from script attacks (PCI SSC FAQ 1588), which we explain in SAQ A After 2025. Our guide to PCI compliance with Stripe covers what you still own.

Can you keep sensitive data in your own database?

For personal data, your own database is often the right home, as long as you give it real controls. Real controls are specific.

  • Access rules enforced in the database, such as row level security, and tested with two accounts and fake records.
  • Encryption in transit and at rest.
  • Audit logs that show who read and changed which records.
  • Backups you have restored at least once.
  • Separate development and production databases, with fake data in development.
  • Keys on the server only, with the most powerful ones held by the fewest people.

The default setup can fall short. A November 2026 crawl of 159,041 Lovable projects found 24,664 sites returning database records without a login, though the authors stress that this is not a breach rate and the sample is not representative (Techzine). If your app was built on Lovable, read its terms before you store anything regulated. They bar HIPAA-covered health information and payment card data unless your plan or a separate written agreement allows it (Lovable Terms). Building it yourself fits when your team has database skills and your buyers will accept your own controls with evidence.

Buying a vault or tokenization service

Tokenization swaps a sensitive value, such as a card number, for a random stand-in called a token. The real value sits in the vendor's vault, and your systems store only the token. That shrinks what you hold and moves much of the protection work to a company built for it.

Developer vaults start near $1,000 a month. As of November 2026, Basis Theory lists its entry plan at $995 a month with 20,000 tokens, Evervault lists $995 a month plus usage, and VGS says its plans start at $1,000 a month. Basis Theory's higher, unpriced tier adds options for personal and health data, and VGS's Growth package lists a PCI compliance subscription and a VGS-provided auditor.

A vault earns its cost when you need card data that moves between several processors, network tokens, or field-level protection for personal or health data. If you take payments through one processor, its hosted fields already keep card numbers off your systems. Either way, you still decide who in your app may ask for a real value back, and when.

Renting a platform that signs a BAA

A business associate agreement, or BAA, is the contract HIPAA requires between a covered entity and a vendor that handles its patient data, and between that vendor and its own subcontractors. HHS guidance treats a cloud provider that stores electronic PHI as a business associate even if it holds only encrypted data and no key (HHS cloud computing guidance). Many platforms now sign one.

ProviderBAA path, as of November 2026Watch for
AWS, Microsoft Azure, Google CloudA BAA covering a defined list of eligible servicesOnly covered services may hold PHI, and Google's list does not name Firebase-branded products
SupabaseTeam plan from $599 a month plus a HIPAA add-on with no published priceYou apply the recommended controls
VercelPro plan plus a $350 a month add-onChanges to the standard BAA need Enterprise, per its changelog
Fly.ioFree on all plans since November 18, 2026SOC 2 report only under NDA
NeonNo extra cost on the Scale plan for now, with a 15% surcharge plannedNo PHI in table names, column names, metadata or logs
ConvexProfessional plan at $25 per developer a monthNot on the Free or Starter plans

The providers that spell out responsibility say their BAA covers their part only. Microsoft says it does not inspect, approve or monitor the applications you deploy, and that using Azure does not by itself make your solution compliant (Microsoft Azure HIPAA). Supabase says applying its recommended controls falls to the customer (Supabase HIPAA docs). AWS notes there is no HIPAA certification for a cloud provider, and Google Cloud lists exactly which services its BAA covers. That split is called shared responsibility, and it means you still configure access, logging and keys. Our guide to which hosting and database providers sign a BAA goes provider by provider.

Handing custody to a managed service

The fourth option is to let someone else run the data layer and sign for it. Microsoft describes the structure in its HIPAA guidance. A software provider running a healthcare solution on Azure can sign BAAs directly with its own customers, who then need no BAA with Microsoft. The provider becomes your business associate, and its cloud host becomes its subcontractor.

This is how our Secure Data Foundation works. Fusion hosts the sensitive data, signs a BAA for patient data, and keeps card numbers with your payment processor as tokens. Whoever you choose, get the split of duties in writing and ask these questions first.

  • Will you sign a BAA, and do your own subcontractors sign one with you? HIPAA requires the same terms to flow down the chain (45 CFR 164.504).
  • Who are your subprocessors, and how will you tell me about changes?
  • Who owns sign-in and access rules in my app, and who owns them in the data layer?
  • What evidence will I get for my auditor, such as logs, access reviews and backup tests?
  • How fast will you tell me about a breach? Neon, for comparison, promises notice within five business days.
  • How do I get my data out if I leave?
  • What independent assurance do you hold yourself, such as a SOC 2 report?

Five questions that decide where your data lives

  1. What type of data is it? Card numbers point to the processor. Patient data points to a BAA. Personal data gives you the most room to choose.
  2. Who signs what? List every contract the choice needs, such as BAAs, data processing agreements and your processor's attestation, and who signs each one.
  3. Where does shared responsibility split? Write down what the provider covers and what stays with you, line by line.
  4. What can your team run? Someone has to patch, monitor, rotate keys and answer alerts. If nobody on your team will, choose an option where someone else does.
  5. What evidence will you need? Auditors and customers ask for logs, access reviews and backup tests. Pick the option that produces them as a matter of routine.
OptionGood fit whenYou still own
Your own databasePersonal data and a team with database skillsEverything, including the evidence
Vault or tokenizationCard data across several processors, or field-level protectionWho may request real values, and the app around the vault
Platform that signs a BAAPatient data and a team that can configure the platform wellConfiguration, access rules, logging and keys
Managed custodianRegulated data and nobody to run the data layerYour app, your contracts and the answers to the questions above

Mistakes that put data in the wrong place

  • Typing real patient or card data into a builder whose terms bar it. Build and test with fake records.
  • Assuming a provider's BAA covers every product it sells. Check the covered list, such as Google's, before you store PHI.
  • Logging whole requests, so names and diagnoses land in log files. Neon and Render both say PHI must never go in logs or resource names, and Neon also warns against putting it in support tickets.
  • Building custom card fields. Stripe says handling raw card numbers can mean meeting more than 300 PCI DSS controls.
  • Letting copies spread into spreadsheets, support tickets and AI chats, where no access rule follows them.

What to do next

Write down every place your sensitive data lives today, including exports, logs and test databases. That list is the start of a data map, and it makes the trade-offs concrete. The free 2-minute self-check shows where you stand, and the Compliance Readiness Review starts with a full data map and a two-account access test, then ranks what to fix. If you would rather hand off custody, see how the Secure Data Foundation works. For the habits that keep data in its place while you build, read Building Fast Without Building Exposed.