데이터 매퍼
객체와 DB 사이에서 데이터를 이동하되 객체·DB·매퍼를 서로 독립시키는 매퍼 계층이다.
구조와 동작 원리
구성 요소와 배치 원칙 (조사 기반 개념 설명 · 연결 순서나 토폴로지는 특정하지 않음)
매퍼 계층이 영속 데이터 저장소와 인메모리 도메인 표현 사이에서 양방향 변환을 수행한다.
도메인 표현과 영속 저장소를 서로 독립시키도록 변환 책임을 매퍼에 격리한다.
객체 모델과 관계형 DB는 데이터 구조화 방식이 달라 스키마 불일치가 생긴다.
기대 효과
인메모리 객체와 DB 엔티티를 분리해 단일 책임과 관심사 분리를 촉진한다.
트레이드오프
객체가 스스로 로드·저장하지 못하고 매퍼가 대신 하므로 추가 작업과 계층이 생긴다.
단순 응용에서 도메인 모델이 DB 구조와 꽤 일치하면 Data Mapper가 과할 수 있다.
운영 및 적용 가이드
종합 설명 · 원문 인용으로 검증된 항목과 구분됩니다. 실제 적용 전 확인이 필요합니다.
언제 사용하는가
도메인 객체와 관계형 스키마가 복잡하게 불일치하는 시스템에서 ORM/매핑 계층으로 사용한다. 의료·금융 등 표준/레거시 포맷 변환이 잦은 통합에서 원천 모델과 저장 모델을 분리하는 데 적합하다.
시나리오
대형 대학병원(약 1.5만 직원, 연 100만 외래 규모)이 HL7 v2·CDA와 독자 DB 데이터를 FHIR 저장소 및 분석 DB로 실시간 매핑해야 한다. 도메인 모델은 DB 스키마와 직접 결합하지 않아야 하고, 매핑 규칙 버전·부분 실패 정책·감사 추적이 필요하다. 온프레미스 Kubernetes에 무상태 매퍼 서비스를 배치하고 원천 DB 근처에서 실행하며, 실패 레코드는 격리 큐에 저장해 재처리한다.
배치 원칙
- 도메인 객체와 영속 모델 사이에 전용 매퍼/리포지토리 계층을 둔다
- 매핑 규칙과 스키마 정의는 코드·설정으로 버전 관리한다
- DB 접속 정보와 자격 증명은 Secret/외부 구성으로 분리한다
- 대량·스트리밍 매핑은 별도 워커로 분리한다
- Kubernetes에서는 무상태 Deployment, HPA, PDB, ConfigMap/Secret으로 배치한다
온프레미스
온프레미스에서는 매퍼와 DB를 가까운 네트워크 구역에 두고 연결 풀·타임아웃·재시도·서킷브레이커를 환경별로 고정한다. 배포는 컨테이너/패키지 파이프라인으로 자동화하고, 매핑 규칙 변경은 dry-run·롤백 가능한 버전으로 운영하며 DB 백업·감사 로그를 연계한다.
클라우드
클라우드에서는 관리형 DB·큐·시크릿·관측성 서비스를 사용하고 매퍼를 무상태 컨테이너로 오토스케일한다. 매핑 설정은 GitOps로 배포하고, 네트워크 egress·비용·멀티 AZ 장애 도메인을 고려해 재시도와 DLQ를 구성한다.
Kubernetes
Kubernetes에서는 매퍼를 무상태 Deployment로 배포하고 readiness/liveness, HPA, PDB, 롤링 업데이트를 적용한다. ConfigMap/Secret으로 매핑·접속 설정을 분리하고, 리소스 request/limit·PodDisruptionBudget·서킷브레이커·DLQ를 함께 운영한다.
장애 대응
대표 장애는 DB 연결 타임아웃, 스키마 변경/매핑 규칙 불일치, 필수 필드 누락, 재시도 폭주다. 실패 레코드를 reject table/DLQ로 격리하고 부분 데이터 허용 여부를 정책으로 명시하며, capped exponential backoff·circuit breaker·매핑 버전 롤백·dry-run 재처리·알림으로 대응한다.
14개 관점별 근거
조사 당시 근거 보유 여부입니다. 출처의 정확성과 최신성을 별도로 판단하세요.
정의·개요근거 있음
객체와 DB 사이에서 데이터를 이동하되 객체·DB·매퍼를 서로 독립시키는 매퍼 계층이다.
A layer of mappers that moves data between objects and a database while keeping them independent of each other and the mapper itself.해결하는 문제근거 있음
객체 모델과 관계형 DB는 데이터 구조화 방식이 달라 스키마 불일치가 생긴다.
Objects and relational databases have different mechanisms for structuring data.주요 구성 컴포넌트·리소스근거 있음
매퍼 계층이 영속 데이터 저장소와 인메모리 도메인 표현 사이에서 양방향 변환을 수행한다.
bidirectional transfer of data between a persistent data store (often a relational database) and an in-memory data representation데이터·에셋 배치 원칙근거 있음
도메인 표현과 영속 저장소를 서로 독립시키도록 변환 책임을 매퍼에 격리한다.
The goal of the pattern is to keep the in-memory representation and the persistent data store independent of each other대표 유스케이스근거 있음
객체지향 모델과 관계형 DB 사이를 잇는 ORM/매핑 계층이 필요한 응용에 적합하다.
In applications requiring an ORM tool to bridge the gap between object-oriented models and relational databases.시나리오 예시근거 있음
의료 분야에서 독자 포맷 데이터를 실시간으로 표준 모델(FHIR 등)로 매핑하는 통합 시나리오가 있다.
Designed to work with proprietary healthcare data - Mapping data in real-time부적합 상황·주의근거 있음
단순 응용에서 도메인 모델이 DB 구조와 꽤 일치하면 Data Mapper가 과할 수 있다.
In simple applications the Domain Model (116) is an uncomplicated structure that actually corresponds pretty closely to the database온프레미스 관점(개발·배포·운영)근거 있음
온프레미스 배포 시 자체 인프라의 Kubernetes 플랫폼이 기술 요구사항이 될 수 있다.
Yes. There’s only one technical requirement — the Kubernetes K8s platform should be deployed on your infrastructure.클라우드 관점(개발·배포·운영)근거 있음
클라우드 네이티브 구성은 Kubernetes 기반으로 확장성·보안·복원성을 겨냥한다.
environment configurations based on Kubernetes focuses on scalability, security and resilienceKubernetes 관점(개발·배포·운영)근거 있음
Kubernetes에서는 매퍼를 확장성·보안·복원성 고려한 환경 구성과 배포 관리로 운영한다.
Cloud Native’s environment configurations based on Kubernetes focuses on scalability, security and resilience장애 대응 관점근거 있음
매퍼는 외부 의존 장애를 없애지는 못하므로 실패 동작을 명시적·구성 가능하게 만들어야 한다.
A mapper does not remove that; what it can do is make the failure behaviour explicit and configurable.장점근거 있음
인메모리 객체와 DB 엔티티를 분리해 단일 책임과 관심사 분리를 촉진한다.
decouple the in-memory objects from the database entities to promote the Single Responsibility Principle단점·트레이드오프근거 있음
객체가 스스로 로드·저장하지 못하고 매퍼가 대신 하므로 추가 작업과 계층이 생긴다.
The trade-off is that the object can’t load or save itself. Something else, the mapper, has to do that work대표 기술·도구근거 있음
ORM 도구가 객체 모델과 관계형 DB 간 매핑을 담당하는 대표 기술로 언급된다.
In applications requiring an ORM tool to bridge the gap between object-oriented models and relational databases.추가 참고 문헌 (24)
- Data Mapper ↗
- Data Mapper Pattern in Java: Decoupling Data Storage from Business Logic | Java Design Patterns ↗
- Enterprise Application Architecture: Mapping to Relational Databases | Architectural Patterns | InformIT ↗
- Design Patterns for Data Persistence | Microsoft Learn ↗
- ISA: Data Mapper ↗
- Data mapper pattern ↗
- Architecting with Java Persistence: Patterns and Strategies - InfoQ ↗
- DataMapper, explained part by part | Vectree ↗
- Modern Integration with BIS: Cloud or Self-Managed ↗
- AI-Powered Healthcare Data Platform ↗
- Magic xpi | Integration Platform | Process Automation ↗
- On-Prem FHIR® Deployment for University Hospital Freiburg ↗
- EAS by Lynxmind | Order management, integration and migration on your Kubernetes ↗
- Fabric and TDM Services ↗
- DI Deployment Models ↗
- InteropX — Architecture | How Healthcare Messages Actually Move | Peerbits ↗
- Fault tolerance • Principles of Data Engineering ↗
- Failure Is a Feature — Sovereign by Design ↗
- Error Handling | jfxmap ↗
- Failure handling in distributed mapping with FxMap | FxMap ↗
- Error Handling | FxMap ↗
- Engineering for Failure: Data Resilience from Modern Data Platforms to Chinese Hyperscale Systems [English] ↗
- Error handling | Spate ↗
- Delivery Semantics | LyftData Docs ↗