Files
llm-wiki/raw/official-docs/transactions-production-considerations-mongodb-official.md

101 lines
13 KiB
Markdown

---
title: official-doc / MongoDB — Production Considerations for Transactions (Runtime & Oplog Size Limits)
source_type: official-doc
url: https://www.mongodb.com/docs/manual/core/transactions-production-consideration/
archive_url:
related_branches: [feature-mongo-runtime-baseline-contract]
related_projects: []
tags: [official-doc, ca-skeleton, persistence, mongodb, transaction]
created: 2026-07-28
---
# official-doc / MongoDB — Production Considerations for Transactions (Runtime & Oplog Size Limits)
> Layer: `raw/` — 외부 자료(공식 문서 / 대기업 기술 블로그)의 **원문 발췌·출처 기록**.
> 본 템플릿은 `raw/official-docs/` 와 `raw/company-tech-blogs/` 두 폴더가 공유.
> 검증된 요약은 `/ingest` 후 `wiki/concepts/`에 `source-summary-template` 형식으로 별도 작성. 원본은 raw에 영구 보관.
## source_type 허용값
`source_type: official-doc` — MongoDB 공식 매뉴얼(레퍼런스) 문서. 형제 자료 [[raw/official-docs/transactions-mongodb-official]]의 "Production Considerations 페이지 참조" gap 을 닫기 위해 그 페이지 자체를 dispatch.
## Parent / 활용 branch
| Branch | 이 자료가 정당화하는 결정 |
|---|---|
| [[raw/branch-notes/feature-mongo-runtime-baseline-contract]] | (부분) multi-document transaction 은 시간·크기 한계를 가지므로 무제한 사용을 전제하지 않고, 한계 초과 시 동작을 계약에 명시한다 — runtime limit("less than one minute" 기본값 + `transactionLifetimeLimitSeconds` 초과 시 periodic cleanup 에 의한 abort)과 oplog entry 크기 한계(16MB, transaction 전체가 아닌 entry 단위) 근거. **주의**: 이 URL 은 "transient transaction error 재시도 책임을 애플리케이션 계약으로 못박는다" 결정은 정당화하지 못한다 — `TransientTransactionError`/`UnknownTransactionCommitResult` 라벨이 이 URL 본문에 없음(Self-Grep 0 매치, 아래 Usage Boundaries 참조). 이 결정은 별도 URL(드라이버별 에러 처리 가이드) dispatch 필요 |
## 출처
- 원본 URL: https://www.mongodb.com/docs/manual/core/transactions-production-consideration/
- 아카이브 URL: (미제공)
- 저자 / 조직: MongoDB, Inc. (공식 매뉴얼)
- 발행일: (문서 자체에 명시 없음 — 버전별 롤링 업데이트되는 레퍼런스 페이지. 2026-07-28 fetch 시점 기준 breadcrumb 상 "Database Manual 8.3 (Current)" 확인)
- 마지막 확인일: 2026-07-28
## 왜 저장했는지
`feature-mongo-runtime-baseline-contract` branch 가 "transaction 은 시간·크기 한계를 가지므로 무제한 사용을 전제하지 않는다"를 구체 수치(runtime limit 기본값, oplog entry 크기 제한)로 뒷받침하기 위해 보관. 형제 자료 [[raw/official-docs/transactions-mongodb-official]]의 Claim `MONGO-TXN-C9`가 "구체 수치는 이 URL 범위 밖"이라며 위임한 페이지가 바로 이 문서.
## 핵심 인용
> [§Availability] "MongoDB standalone deployments do not support transactions. To use transactions, your deployment must be a multiple node replica set."
> [§Runtime Limit] "By default, a transaction must have a runtime of less than one minute. You can modify this limit using transactionLifetimeLimitSeconds for the mongod instances." [...] "Transactions that exceeds this limit are considered expired and will be aborted by a periodic cleanup process."
> [§Oplog Size Limit] "MongoDB creates as many oplog entries as necessary to the encapsulate all write operations in a transaction, instead of a single entry for all write operations in the transaction." [...] "each oplog entry still must be within the BSON document size limit of 16MB."
> [§WiredTiger Cache] "When you encounter an error during individual operation in the transaction, abort and retry the transaction."
> [§WiredTiger Cache — Note] "If a transaction is too large to ever fit in the WiredTiger cache, the transaction aborts and returns a TransactionTooLargeForCache error."
## Claims Extracted
| Claim ID | Claim | Evidence quote | Strength | Applies to | Does not prove |
|---|---|---|---|---|---|
| MONGO-TXN-PROD-C1 | MongoDB standalone 배포는 transaction 을 지원하지 않으며, transaction 을 쓰려면 multiple-node replica set 이어야 한다 | [§Availability] "MongoDB standalone deployments do not support transactions. To use transactions, your deployment must be a multiple node replica set." | `official-vendor-doc` | 모든 MongoDB 배포 형태(standalone vs replica set/sharded cluster) 판단 | sharded cluster 고유 추가 제약(별도 "Production Considerations (Sharded Clusters)" 페이지로 위임됨)까지는 다루지 않음 |
| MONGO-TXN-PROD-C2 | Transaction 은 기본적으로 1분(one minute) 미만의 runtime 을 가져야 하며, 이 한계는 `transactionLifetimeLimitSeconds` 파라미터(sharded cluster 는 모든 shard replica set member 에 동일 적용)로 조정 가능하고, 한계를 초과한 transaction 은 expired 로 간주되어 periodic cleanup 프로세스에 의해 abort 된다 | [§Runtime Limit] "By default, a transaction must have a runtime of less than one minute. You can modify this limit using transactionLifetimeLimitSeconds for the mongod instances." [...] "Transactions that exceeds this limit are considered expired and will be aborted by a periodic cleanup process." | `official-vendor-doc` | replica-set/sharded-cluster 배포의 `mongod` 인스턴스 런타임 한계 | **`transactionLifetimeLimitSeconds` 의 정확한 기본 정수값(예: 60)은 이 문장에 없다** — 원문은 "less than one minute" 이라고만 서술하며 정수 초 표기는 없음. 정확한 기본 정수값은 이 URL 범위 밖(파라미터 레퍼런스 페이지 확인 필요, 아래 Usage Boundaries 참조) |
| MONGO-TXN-PROD-C3 | Transaction 이 여러 write 연산을 포함해도 단일 oplog entry 가 아니라 필요한 만큼의 여러 oplog entry 로 기록되며, 이로써 이전에 있던 "transaction 전체 16MB 크기 제한"은 제거되지만, 개별 oplog entry 각각은 여전히 16MB BSON document 크기 제한을 지켜야 한다 | [§Oplog Size Limit] "MongoDB creates as many oplog entries as necessary to the encapsulate all write operations in a transaction, instead of a single entry for all write operations in the transaction." [...] "each oplog entry still must be within the BSON document size limit of 16MB." | `official-vendor-doc` | transaction 내 여러 write 연산의 oplog 기록 방식과 크기 한계 | transaction 이 포함할 수 있는 write 연산의 "개수" 자체에 대한 상한은 이 문장이 규정하지 않음 — 다루는 것은 개별 oplog entry 의 BSON 크기 한계뿐 |
| MONGO-TXN-PROD-C4 | Transaction 이 WiredTiger cache 에 담기기에 너무 크면 `TransactionTooLargeForCache` 에러와 함께 abort 된다 | [§WiredTiger Cache — Note] "If a transaction is too large to ever fit in the WiredTiger cache, the transaction aborts and returns a TransactionTooLargeForCache error." | `official-vendor-doc` | WiredTiger storage engine 을 사용하는 배포에서 대용량 transaction 실행 시 실패 모드 | 이 에러가 발생하는 정확한 크기 임계값(캐시 크기 대비 비율 등)은 이 문장에 없음 |
| MONGO-TXN-PROD-C5 | WiredTiger cache pressure 를 막기 위해, transaction 내 개별 연산에서 에러를 만나면 그 transaction 을 abort 하고 재시도(retry)하라고 권고한다 | [§WiredTiger Cache] "When you encounter an error during individual operation in the transaction, abort and retry the transaction." | `official-vendor-doc` | WiredTiger cache pressure 완화 목적의 일반적 "에러 시 abort+retry" 운영 권고 | **이것은 `TransientTransactionError`/`UnknownTransactionCommitResult` 에러 라벨 기반의 표준 재시도 프로토콜이 아니다.** 이 URL 본문에는 두 라벨 모두 존재하지 않는다(Self-Grep 확인, 0 매치) — 이 문장은 "왜 abort+retry 를 하는가"(cache pressure 완화)를 말할 뿐, 애플리케이션이 라벨을 어떻게 감지해 전체 transaction 을 재시도해야 하는지의 프로토콜은 다루지 않음. 그 프로토콜은 드라이버별 에러 처리 가이드(별도 URL)의 범위 |
### Strength 허용값
- `official-standard` — RFC, 표준 사양, 언어/프로토콜 표준
- `official-vendor-doc` — Spring, Keycloak, AWS, Google, MongoDB 등 공식 벤더 문서
- `official-reference` — 공식 reference/API 문서
- `company-case-study` — 대기업/실무 기술 블로그의 특정 사례
- `engineering-blog` — 개인/팀 블로그의 엔지니어링 해설
- `tutorial` — 튜토리얼/가이드. 일반화 금지
- `needs-confirmation` — 원문만으로는 적용 판단 불가
## Usage Boundaries
- 이 자료가 직접 증명하는 것:
- `MONGO-TXN-PROD-C1`: standalone 배포는 transaction 미지원, multi-node replica set 필요
- `MONGO-TXN-PROD-C2`: transaction runtime 기본 한계는 "1분 미만"이며 `transactionLifetimeLimitSeconds` 로 조정, 초과 시 periodic cleanup 이 abort
- `MONGO-TXN-PROD-C3`: oplog entry 는 transaction 당 여러 개로 기록되어 transaction 전체 16MB 제한은 없지만, entry 단위 16MB BSON 제한은 여전히 존재
- `MONGO-TXN-PROD-C4`: cache 초과 시 `TransactionTooLargeForCache` 에러로 abort
- `MONGO-TXN-PROD-C5`: 개별 연산 에러 시 abort+retry 하라는 cache-pressure 완화 목적의 일반 권고
- 이 자료가 증명하지 않는 것 (사용자가 명시적으로 요청했으나 이 URL 에 부재 — Self-Grep 확인, 0 매치, 절대 추정하지 않음):
- **`transactionLifetimeLimitSeconds` 의 정확한 기본 정수값(초)**. 원문은 "less than one minute" 이라고만 서술한다. "60초"라는 숫자는 이 URL 어디에도 없다 — 별도 파라미터 레퍼런스 페이지(`/docs/manual/reference/parameters/#mongodb-parameter-param.transactionLifetimeLimitSeconds`) 확인 필요
- **`TransientTransactionError` 라벨** — 이 URL 본문에 전혀 등장하지 않는다(grep 0 매치)
- **`UnknownTransactionCommitResult` 라벨** — 이 URL 본문에 전혀 등장하지 않는다(grep 0 매치)
- **"transaction 을 짧게 유지하라"(작은 문서 수/짧은 실행 시간) 는 명시적 권고 문장** — 이 URL 에 그런 문장은 없다(grep 0 매치, "keep...short"/"small number of documents" 류 문구 부재). 가장 근접한 내용은 WiredTiger Cache 섹션의 "에러 시 abort+retry" 권고(`MONGO-TXN-PROD-C5`)뿐이며, 이는 "짧게 유지하라"는 사전 설계 권고가 아니라 "에러 발생 후 사후 대응" 권고다
- 내 프로젝트에 적용하려면 추가 확인이 필요한 것:
- `transactionLifetimeLimitSeconds` 기본 정수값 — 파라미터 레퍼런스 페이지 별도 dispatch
- `TransientTransactionError`/`UnknownTransactionCommitResult` 라벨과 애플리케이션 재시도 계약 — 드라이버별 에러 처리 가이드(예: MongoDB Manual "Transactions and Sessions" 또는 언어별 driver 문서) 별도 dispatch 필요
- "transaction 을 짧게 유지하라"는 실무 권고 자체가 필요하면 별도 출처(공식 문서 다른 페이지 또는 기술 블로그) 확보 필요 — 이 URL 은 근거가 아님
## 메모
- 사용자가 요청한 5개 항목 중 (1) runtime limit 기본값 서술과 (2) oplog entry 16MB 한계는 이 URL 에서 verbatim 확보했다. 단 (1)의 정확한 초 단위 숫자는 원문에 없어 "less than one minute"로만 기록했다.
- (3) `TransientTransactionError`, (4) `UnknownTransactionCommitResult`, (5) "짧게 유지하라" 권고는 이 URL 본문에 **부재**함을 self-grep(0 매치)으로 확인했다. 추정하지 않고 Claims Extracted 에서 제외했으며 Usage Boundaries 에 gap 으로 명시했다.
- WebFetch 1차 결과가 표/목록을 산문으로 재구성하며 "TransactionTooLargeForCache" 등 일부 세부를 누락했고 TransientTransactionError 관련 문구를 임의로 언급하지 않았음(다행히 fabrication 없음)을 확인 후, curl 로 원본 HTML 을 직접 받아 self-grep 검증했다(WebFetch 결과는 참고용, 최종 인용은 curl 원문 기준) — 형제 raw 문서와 동일한 방법론.
- 추가로 봐야 할 동일 출처 페이지: `https://www.mongodb.com/docs/manual/reference/parameters/#mongodb-parameter-param.transactionLifetimeLimitSeconds` (정확한 기본 정수값), 드라이버별 transient transaction error 처리 가이드(예: `https://www.mongodb.com/docs/manual/core/transactions-in-applications/` 또는 언어별 driver 문서 — `TransientTransactionError`/`UnknownTransactionCommitResult` 라벨 확인용), `https://www.mongodb.com/docs/manual/core/transactions-production-consideration-sharded-clusters/` (sharded cluster 전용 추가 고려사항)
## 관련
- 같은 주제 다른 official-doc: [[raw/official-docs/transactions-mongodb-official]] (multi-document transaction 배포 요건·concern 기본값 — 이 문서의 gap `MONGO-TXN-C9`/`C10`을 이 자료가 부분적으로 닫음), [[raw/official-docs/write-concern-mongodb-official]], [[raw/official-docs/read-preference-mongodb-official]]
- 이 자료를 인용한 wiki 요약: `[[wiki/concepts/...]]` (생성 시)