Book a free call

How to Design a HIPAA-Compliant System Architecture

A HIPAA compliance architecture shows where patient data flows, who can reach it, and how every access is logged. Here is how to design one that auditors can follow.

Hertiv engineering teamReviewed by a senior engineer
7 min read
How to Design a HIPAA-Compliant System Architecture
On this page

Short answer

A HIPAA compliance architecture is the technical design of a system that handles protected health information: it maps where PHI flows, separates it from other data, encrypts it in transit and at rest, limits access by role, and records every access in tamper-proof logs. The design makes the safeguards required by the HIPAA Security Rule concrete, so each control has a named place in the system.

What is a HIPAA compliance architecture?

A HIPAA compliance architecture is the technical design of a system that handles protected health information, or PHI: the network layout, the data stores, the access rules and the logging that together meet the HIPAA Security Rule.

HIPAA itself does not prescribe products. It requires administrative, physical and technical safeguards, plus contracts and a written risk analysis. The architecture is where those requirements become concrete: which network segment holds the database, which key encrypts it, who can read it, and where the log of that access goes.

The design starts from one question: where does PHI flow? Until the team can trace one patient record from intake to the last log line, the architecture is a guess. A good design makes that trace easy to draw and easy to check, which is what auditors and customers ask for first.

How do you map where PHI flows?

You map PHI flows by listing every system, vendor and log store that touches patient data, and naming an owner for each stop. PHI shows up in more places than most teams expect, and the map is the foundation the rest of the design rests on.

The table below shows the usual places PHI appears and what each one needs.

Where PHI appearsWhat it needs
Primary database and backupsEncryption at rest, access by role
Application and access logsRedacted request bodies, tamper-proof store
Support tickets and chatAccess limits, retention rules
Analytics and telemetryNo identifiers, or a signed agreement
Email and notificationsMinimum content, vendor agreement
Test environmentsSynthetic data only, never production copies

Test environments deserve special attention. Loading production data into staging is one of the most common ways PHI escapes the controls built for production. Use synthetic data for tests, and treat any environment holding real patient data as production, with the same controls and the same audit trail.

How should the network be set up?

The network should separate the parts that hold PHI from everything else, so a compromise in one place cannot reach patient data. In practice that means private subnets for databases and internal services, with no direct route from the public internet.

Public traffic reaches the system through a small number of controlled entry points, usually a load balancer in front of the application. Internal services talk to each other inside the private network, and outbound access is limited to the vendors the system actually needs.

Segmentation also applies between environments. Production, staging and development live in separate networks with separate credentials, so a mistake in development cannot reach patient data. The same separation applies to administrative access: production access goes through a bastion or an identity-aware proxy, is time-limited, and is logged. This network thinking is part of the wider zero trust security approach, where no network location is trusted on its own.

How do you protect PHI at rest and in transit?

PHI must be encrypted in transit and at rest. In transit means TLS on every connection that carries patient data, including connections between internal services, not just the browser-to-server path.

At rest means the database, backups, file stores and logs are encrypted. The usual design is envelope encryption: a data key encrypts the data, and a master key held in a key management service encrypts the data key. That way keys can be rotated without re-encrypting every record.

Key management is where the design either holds or fails. Keys live in the key management service, never in code or in version control. Access to the keys is separate from access to the data, so a database administrator cannot read patient records and a developer cannot decrypt a backup. Rotate keys on a schedule, and test that rotation works before you need it.

Field-level encryption is worth adding for the most sensitive fields, such as diagnoses, so a breach of one layer does not expose the most sensitive content.

How do access control and audit logging work?

Access control starts with identity: every person and every service has its own account, and access is granted by role with least privilege. Shared admin accounts make audit trails meaningless, so they should not exist in a system that holds PHI.

Roles should match the work, not the org chart. A clinician sees the patients they treat, a billing clerk sees invoices but not diagnoses, and a support engineer sees metadata but not record contents. Access is reviewed on a schedule, and it is removed when a role changes or a person leaves.

Audit logging records who accessed what and when, and the logs are protected from tampering. That means logs go to a separate store that application code cannot rewrite, and access to the log store is itself logged. The test is simple: if an engineer cannot answer who read a given patient record last month, the logging design is not finished.

The process side of this is covered in the guide on how to implement HIPAA compliance.

How do you design backups, recovery and testing?

You design backups and recovery as part of the architecture, not as an afterthought, because the HIPAA Security Rule requires a contingency plan and the ability to restore PHI after an incident.

  1. Back up encrypted data only. Backups hold the same PHI as the live database, so they get the same encryption, the same access limits and the same retention rules.
  2. Test restores on a schedule. A backup that has never been restored is a hope, not a control. Restore quarterly and record the result.
  3. Keep test data synthetic. Never restore production backups into a test environment. Test restores go to an isolated, access-controlled area and are deleted afterwards.
  4. Plan for vendor failure. Know which vendors hold PHI, what their agreements cover, and what happens if one is unavailable.
  5. Rehearse the incident path. Walk through a breach scenario once a year: who is called, what is contained, and how patients are notified.
  6. Review access lists and logs monthly. Stale access and unreviewed logs are the two findings auditors raise most often.

Testing also covers the safeguards themselves. A short quarterly review of the data map, the access lists and the vendor agreements keeps the design current as the product changes, and it gives the team evidence ready for customer security reviews.

Example (hypothetical): a clinic booking system

Example (hypothetical): a clinic builds a booking app that stores patient names, phone numbers and appointment reasons. The team designs the architecture before writing code, starting with a PHI flow map.

The map shows PHI in six places: the booking database, nightly backups, application logs, a confirmation email, support tickets and an analytics tool. The team removes PHI from two of them: logs are redacted so field values never land in the log store, and the analytics tool receives only de-identified events.

The database sits in a private subnet with encryption at rest through the key management service. The API is the only service that can read it, and it uses a service account with read access limited to the patients of the clinic that made the request. The confirmation email carries the appointment date but not the reason for the visit.

The team counts the cost: the design adds about 40 hours of work up front, and the key management and log services cost about $120 a month. The first customer security review takes two days instead of two weeks, because the architecture document answers the questions the reviewer asks. The steps for building such a system are covered in the guide to build HIPAA compliant software.

What are the common mistakes?

The most common HIPAA architecture mistakes are treating compliance as a certificate, forgetting the logs, and letting PHI spread into systems the design never covered.

  • Treating compliance as a product. There is no official HIPAA certification, and buying a compliant hosting plan does not make the application compliant. The architecture has to cover the whole data path.
  • PHI in logs and telemetry. Request bodies, error traces and session replay tools are leaks even when the database is encrypted. Redact them by design.
  • Shared accounts and standing access. A shared admin login makes it impossible to say who did what, which defeats the audit control entirely.
  • Production data in test environments. Test data must be synthetic. Any environment holding real patient data is production and needs production controls.
  • Missing vendor agreements. Every vendor in the data path, including email, analytics and AI providers, needs a Business Associate Agreement before PHI flows to it.
  • No risk analysis. Without a documented, current risk analysis, the rest of the design is hard to defend, however good the technical controls are.

Key takeaways

  • Start with a PHI flow map: every system, vendor and log store that touches patient data
  • Segment the network so PHI lives in private subnets behind controlled entry points
  • Encrypt in transit and at rest, with keys held separately from the data
  • Give every person and service its own account, with least-privilege roles and tamper-proof logs
  • Test restores, keep test data synthetic, and review access lists and vendor agreements on a schedule

Frequently asked questions

What is a HIPAA compliance architecture?

It is the technical design of a system that handles protected health information: network layout, data stores, access rules and logging that together meet the HIPAA Security Rule. It turns the required safeguards into concrete parts of the system, each with a named place.

Is there such a thing as HIPAA certification?

No. There is no official HIPAA certification for a product or a company, and claims of being HIPAA certified are a warning sign. Compliance is shown through a risk analysis, documented safeguards and evidence, not a certificate.

Where does PHI leak most often?

In logs, error traces, support tickets, analytics tools and test environments loaded with production data. The database is usually the best-protected part; the leaks happen in the systems around it that the design forgot to cover.

Do I need a Business Associate Agreement with my cloud provider?

Yes, if the provider can receive PHI, including in logs or support sessions. You need a BAA in place before PHI flows to any vendor, and the same applies to email, analytics and AI providers in the data path.

Can I use production data for testing?

No. Test environments must use synthetic data. Any environment holding real patient data is production and needs production controls, including access limits, encryption and audit logging. Restoring production backups into test is one of the most common compliance failures.

How often should access be reviewed?

Access lists should be reviewed at least quarterly, and immediately when someone changes role or leaves. Audit logs should be reviewed on a schedule too, and the risk analysis updated whenever the system or its vendors change.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: software products in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Building a HIPAA-compliant system and need the architecture right? Talk to Hertiv.

A senior engineer replies within one business day. Or see our Data Security & Compliance service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to contact@hertiv.com.

Prefer email? Write to contact@hertiv.com
Estimate costBook a call