This prompt is for data architects and backend leads who need to assign clear, defensible ownership of data entities across a distributed system before writing migration scripts or API contracts. The core job-to-be-done is preventing the most expensive mistake in microservice decomposition: shared data ownership that creates a distributed monolith. Use this prompt when you have a concrete list of services, data entities, and integration points and need a structured ownership matrix that forces the model to justify every decision, flag shared kernel exceptions explicitly, and specify anti-corruption layer requirements where ownership conflicts cannot be resolved. It is a design-time analysis tool, not a runtime data catalog, and it works best when the team has already identified candidate service boundaries and needs to validate them against data coupling realities.
Prompt
Cross-Service Data Ownership Analysis Prompt

When to Use This Prompt
Understand the job-to-be-done, the ideal user, and the boundaries of the Cross-Service Data Ownership Analysis Prompt.
The ideal user brings a well-scoped input: a bounded set of services (typically 5-20), the data entities each service touches (tables, event types, read models), and known integration points between services. The prompt expects you to provide this context in a structured format, and it returns an ownership matrix with explicit justification columns, shared kernel exception flags, and anti-corruption layer specifications. Do not use this prompt when the service boundary map is still speculative or when the team has not yet agreed on domain terminology—garbage in, garbage out applies with full force here. The prompt cannot discover bounded contexts from raw business requirements; pair it with the Bounded Context Discovery Prompt if you are earlier in the design process. Also avoid this prompt when the goal is runtime data lineage or cataloging; it produces a static ownership assignment, not a dynamic metadata system.
Before running this prompt, assemble your inputs carefully: list each service with its current or proposed responsibilities, enumerate every data entity (include tables, event streams, and materialized views), and document the integration points where services read or write each other's data. The prompt's value comes from forcing explicit justification for every ownership row, so incomplete inputs produce an ownership matrix that hides rather than reveals coupling risks. After receiving the output, treat the shared kernel exceptions as a prioritized risk register—each one represents a place where two services will need coordinated schema changes, and each one should trigger a conversation about whether the boundary is correct or whether an anti-corruption layer is the cheaper path. The next step is to feed the ownership matrix into your API contract design and database-per-service migration planning workflows.
Use Case Fit
Where this prompt works, where it fails, and what you must have in place before relying on it for cross-service data ownership decisions.
Good Fit: Greenfield Decomposition
Use when: you are designing service boundaries for a new system and need to assign data ownership before implementation. The prompt excels at reasoning from domain models, business capabilities, and bounded contexts to produce a justified ownership matrix. Guardrail: always validate the output against actual business process flows and team topology constraints before locking in schema decisions.
Good Fit: Monolith Extraction Planning
Use when: you have an existing monolith with known tables, views, and read models, and need to map them to candidate microservices. The prompt can identify shared kernel exceptions and anti-corruption layer requirements where data cannot be cleanly separated. Guardrail: pair the output with a database-per-service migration plan and dual-write consistency window analysis.
Bad Fit: Runtime Data Access Enforcement
Avoid when: you need real-time enforcement of data ownership rules at the application or database layer. This prompt produces a design artifact, not executable policy. Guardrail: use the ownership matrix as input to API gateway policies, database permission models, or architecture fitness functions, but never treat the prompt output as a runtime enforcer.
Required Inputs
What you must provide: a list of data entities (tables, events, read models), a description of business capabilities or bounded contexts, and known integration points between services. Without these, the model will hallucinate plausible but incorrect ownership assignments. Guardrail: include explicit constraints about regulatory data residency, PII handling, and audit requirements in the prompt context.
Operational Risk: Stale Analysis
Risk: the ownership matrix becomes outdated as services evolve, teams reorganize, or new data entities are introduced. A correct analysis today may be wrong next quarter. Guardrail: version the ownership matrix alongside architecture decision records, set a review cadence tied to team topology changes, and treat the prompt output as a point-in-time artifact requiring revalidation after major refactors.
Operational Risk: Over-Decomposition
Risk: the prompt may propose splitting data ownership too finely, creating services that own only one or two tables and require excessive cross-service communication. This produces a distributed monolith worse than the original system. Guardrail: apply a service granularity evaluation rubric after generating the ownership matrix, and flag any service that owns fewer than three aggregate roots or requires synchronous calls for most operations.
Copy-Ready Prompt Template
A reusable prompt template for analyzing cross-service data ownership, producing a structured ownership matrix with justifications and conflict resolutions.
This prompt template is designed to be pasted directly into your AI tool of choice. It accepts a system design document, architecture description, or a list of services and data entities as input. The prompt instructs the model to act as a data architect and produce a rigorous ownership matrix. Before running it, ensure you have gathered the necessary context: a list of services, the data entities they interact with (tables, event types, read models), and any known integration points. This prompt is most effective when you are in the early stages of a microservice decomposition or are auditing an existing system for data ownership conflicts that could lead to a distributed monolith.
Below is the copy-ready template. Replace all square-bracket placeholders with your specific context. The [SERVICES_AND_ENTITIES] placeholder is the most critical; provide it as a structured list or a markdown table mapping service names to the data entities they currently read or write. The [CONSTRAINTS] section is where you enforce organizational rules, such as 'No service may directly access another service's database.' If you have a preferred [OUTPUT_SCHEMA], provide a JSON schema or a detailed markdown table structure. If left blank, the prompt will default to a standard matrix format.
markdownYou are a senior data architect reviewing a system design for cross-service data ownership. Your task is to analyze the provided services and data entities to produce a definitive ownership matrix. ## Input Context - Services and Data Entities: [SERVICES_AND_ENTITIES] - System Design Document (Optional): [SYSTEM_DESIGN_DOCUMENT] ## Constraints and Rules Apply the following rules strictly when determining ownership: [CONSTRAINTS] ## Output Schema Produce the final output in the following format. If no schema is provided, use the default matrix structure. [OUTPUT_SCHEMA] ## Default Output Structure (if no schema provided) 1. **Ownership Matrix:** A markdown table with columns: Data Entity, Owner Service, Justification, Access Pattern (Read/Write), and Conflict Status (Yes/No). 2. **Shared Kernel Exceptions:** A list of data entities that are intentionally shared, with a justification for why a shared kernel is acceptable and a list of the services that share it. 3. **Anti-Corruption Layer (ACL) Requirements:** For any entity where a non-owner service requires access, specify the owner service, the consuming service, and the required ACL contract (e.g., 'Consuming service must map OwnerService.UserCreated event to its internal LegacyUser object'). 4. **Conflict Resolution Notes:** A summary of any ownership conflicts found and a recommended resolution for each. ## Analysis Instructions 1. Identify a single owner for each data entity based on the principle of high cohesion and low coupling. The owner is the service responsible for the entity's lifecycle, schema, and consistency. 2. Flag any entity that is written by multiple services as a conflict. 3. For read-only access by non-owners, recommend an integration pattern (e.g., event subscription, API query, ACL) instead of direct database access. 4. Justify every ownership decision with a brief, concrete reason tied to business logic or transactional boundaries.
After pasting the prompt, the most critical adaptation step is to populate the [SERVICES_AND_ENTITIES] placeholder with high-fidelity data. A vague input like 'User service uses the orders database' will produce a vague analysis. Instead, provide a detailed mapping such as 'UserService writes to the users table and publishes UserCreated events. OrderService reads from users via an API and writes to the orders table.' The quality of the output matrix is a direct function of the granularity of this input. For high-risk systems, you should add a [CONSTRAINTS] rule requiring that the final matrix be reviewed by a human architect before implementation, and you can use the [OUTPUT_SCHEMA] to enforce a machine-readable JSON format that can be automatically validated against your service catalog.
Prompt Variables
Replace each placeholder with concrete data before executing the Cross-Service Data Ownership Analysis prompt. Validation notes describe how to check that the input is well-formed and safe.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[SERVICE_CATALOG] | List of services in the system with their current responsibilities and team ownership | payment-service (owns payment processing, team: checkout), order-service (owns order lifecycle, team: checkout) | Parse check: must be a valid JSON array of objects with 'name', 'responsibilities', and 'team' fields. Reject if empty or missing required fields. |
[DATA_ENTITY_LIST] | All data entities under analysis including tables, event types, and read models | orders, payments, refunds, customer_profiles, order_events, payment_events | Parse check: must be a non-empty array of strings. Each entity name must match a known schema or event type in the system. Reject if duplicates detected. |
[CURRENT_OWNERSHIP_MAP] | Existing ownership assignments where known, with null for unassigned entities | orders: order-service, payments: null, customer_profiles: user-service | Schema check: must be a JSON object mapping entity names to service names or null. All entities from [DATA_ENTITY_LIST] must appear as keys. Null allowed for unassigned entities. |
[ACCESS_PATTERNS] | Which services read or write each entity, including frequency and operation type | payment-service writes payments (high freq), order-service reads payments (medium freq) | Schema check: must be a JSON array of objects with 'service', 'entity', 'operation' (read/write/read-write), and 'frequency' (high/medium/low). Reject if operation is not one of the allowed values. |
[BUSINESS_PROCESSES] | End-to-end business processes that span multiple services and entities | checkout-flow: order-service -> payment-service -> order-service, refund-flow: payment-service -> order-service | Parse check: must be a JSON array of objects with 'name' and 'steps' (ordered array of service names). Reject if any step references a service not in [SERVICE_CATALOG]. |
[CONSISTENCY_REQUIREMENTS] | Transactional consistency boundaries and eventual consistency tolerances per business process | checkout-flow: atomic (order+payment must succeed or fail together), refund-flow: eventual (within 5 minutes) | Schema check: must be a JSON object mapping process names to objects with 'type' (atomic/eventual) and optional 'max_staleness_seconds'. Reject if type is not atomic or eventual. |
[REGULATORY_CONSTRAINTS] | Compliance requirements that affect data ownership, residency, or access control | PII data must reside in EU region, payment data requires PCI-DSS scope isolation | Parse check: must be an array of strings or null. If non-null, each constraint should reference a specific regulation or policy name. Null allowed if no regulatory constraints apply. |
[TEAM_TOPOLOGY] | Team structure and communication paths relevant to service ownership decisions | checkout-team owns payment-service and order-service, platform-team owns shared infrastructure | Schema check: must be a JSON array of objects with 'team_name' and 'owned_services' (array of service names). All service names must exist in [SERVICE_CATALOG]. Reject if a service is claimed by multiple teams without explicit shared ownership annotation. |
Implementation Harness Notes
How to wire the Cross-Service Data Ownership Analysis Prompt into an application or review workflow with validation, retries, and human approval gates.
This prompt is designed to run as a batch analysis job triggered by architecture review milestones, not as a real-time user-facing endpoint. The typical integration pattern is: a platform engineer or architect uploads a service inventory and data catalog (as structured JSON or YAML), the harness injects them into the [SERVICE_INVENTORY] and [DATA_CATALOG] placeholders, and the model returns a structured ownership matrix. Because the output directly informs service boundary decisions and database migration planning, the harness must enforce schema validation, log every run for auditability, and require human review before any implementation work begins.
Model choice and tool use. Use a model with strong structured output support (GPT-4o, Claude 3.5 Sonnet, or equivalent) and enable structured output mode with the OwnershipMatrix schema defined in the Output Contract section. Do not rely on unstructured text parsing. If the model supports tool calling, register a submit_ownership_matrix tool with the exact schema rather than hoping the model emits valid JSON in the chat stream. For large service inventories (50+ services, 200+ data entities), split the input into bounded context groups and run the prompt once per group to stay within context windows and reduce hallucination risk. Do not use RAG for this prompt—the entire service inventory and data catalog must be in-context for the model to reason about cross-service conflicts.
Validation and retry logic. After the model returns an ownership matrix, run a deterministic post-processing validator that checks: (1) every data entity from the input catalog appears in the output with exactly one owning_service, (2) no shared_kernel_entities reference a service not in the inventory, (3) every acl_required entry includes a non-empty translation_rules field, and (4) conflict_notes are present for any entity where ownership_confidence is below 0.7. If validation fails, retry once with the validation errors injected into a [PREVIOUS_ERRORS] placeholder appended to the prompt. If the second attempt also fails, escalate to a human reviewer with the partial output and error log. Never silently accept an invalid matrix.
Human review and approval gate. This prompt's output is a decision-support artifact, not an automated decision. After validation passes, the ownership matrix must be routed to the owning architecture team for review. The harness should render the matrix as a readable table (with color-coded confidence scores and conflict flags) and require explicit approval before the matrix is committed to the architecture decision record. Store the approved matrix, the raw model output, the validation results, and the reviewer's identity in a versioned artifact repository. This creates an audit trail for future service boundary changes and makes it possible to revisit ownership decisions when the system evolves.
Logging and observability. Log the full prompt (with placeholders resolved), the model response, validation results, retry count, and human review outcome to your prompt observability system. Key metrics to track: validation pass rate on first attempt, average ownership confidence scores, frequency of shared kernel exceptions, and time-to-review. If you see ownership confidence scores trending downward across runs, it may indicate that your service inventory or data catalog has grown too large for the model's context window—split the analysis into smaller groups. If conflict notes are consistently empty even for low-confidence assignments, your prompt's conflict-detection instructions may need strengthening.
Expected Output Contract
Fields, types, and validation rules for the JSON output produced by the Cross-Service Data Ownership Analysis Prompt. Use this contract to parse, validate, and integrate the model response into downstream systems.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
ownership_matrix | Array of objects | Must be a non-empty array. Each element must have entity, owner_service, and justification fields. | |
ownership_matrix[].entity | String | Must match a known entity from [ENTITY_CATALOG]. Regex: ^[a-zA-Z0-9_]+$. No duplicates across the array. | |
ownership_matrix[].owner_service | String | Must match a service name from [SERVICE_CATALOG]. Null not allowed. If ownership is contested, use the recommended primary owner. | |
ownership_matrix[].justification | String | Minimum 20 characters. Must reference at least one of: write path, lifecycle, business capability, or regulatory scope from [CONTEXT]. | |
ownership_matrix[].shared_kernel | Object or null | If present, must contain shared_entities (array of strings) and coordination_rule (string). Null if no shared kernel applies. | |
ownership_matrix[].anti_corruption_layer_required | Boolean | Must be true if entity is consumed by a service other than owner_service. False otherwise. No null values. | |
ownership_matrix[].read_models | Array of strings | Each string must match a service name from [SERVICE_CATALOG]. Empty array allowed. No duplicates. | |
unresolved_conflicts | Array of objects | Array may be empty. If non-empty, each object must have entity, contested_services (array of strings), and resolution_recommendation (string). |
Common Failure Modes
What breaks first when analyzing cross-service data ownership and how to guard against it.
Hallucinated Ownership Rules
What to watch: The model invents plausible-sounding ownership justifications that contradict the actual codebase, team topology, or existing data access patterns. Guardrail: Require the prompt to cite specific source files, database schemas, or API contracts as evidence for each ownership assignment. Add a validation step that diffs the output against a known ground-truth service registry.
Shared Kernel Over-Assignment
What to watch: The model marks too many entities as shared kernel exceptions to avoid making hard ownership decisions, creating a de facto shared database. Guardrail: Add a hard constraint in the prompt limiting shared kernel assignments to a maximum percentage of total entities. Require explicit justification for each shared entry with a cost-of-sharing analysis.
Missing Anti-Corruption Layer Requirements
What to watch: The output maps data ownership without identifying where conflicting domain models require translation layers, leading to leaky abstractions downstream. Guardrail: Include a dedicated pass in the prompt that cross-references entity definitions across bounded contexts and flags semantic mismatches. Require an ACL recommendation for any entity with divergent meanings across services.
Read Model Ownership Confusion
What to watch: The analysis assigns read models to the service that consumes them rather than the service that owns the source of truth, creating update anomalies. Guardrail: Add explicit rules distinguishing write-ownership from read-model projection ownership. Require the output to trace each read model back to its source events or tables with a lineage column.
Event Ownership Ambiguity
What to watch: Domain events are assigned to the consuming service instead of the emitting service, breaking event-driven contracts and schema evolution governance. Guardrail: Include a schema validation rule that every event must have exactly one owning service responsible for its schema, versioning, and backwards compatibility. Flag any event with zero or multiple owners.
Stale Context Drift
What to watch: The prompt relies on outdated architecture documentation, team assignments, or service registries that no longer reflect the current system state. Guardrail: Require timestamped source inputs and add a freshness check that warns when referenced documents are older than a configurable threshold. Include a confidence downgrade for entities sourced from stale documentation.
Evaluation Rubric
How to test output quality before shipping. Score each criterion on a pass/fail basis. A production-ready output should pass all criteria.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Ownership Matrix Completeness | Every entity from [INPUT_DATA_CATALOG] appears in the matrix with exactly one designated owner service | Entity missing from matrix; entity assigned to multiple owners without shared kernel justification | Parse output JSON, extract all entity IDs, compare against input entity list, assert set equality |
Justification Grounding | Every ownership assignment includes a justification field that references a specific architectural principle or business capability from [CONTEXT] | Justification field is empty, generic ('makes sense'), or contradicts the stated principle | LLM-as-judge check: for each row, verify justification contains a concrete reference to the provided context |
Shared Kernel Validation | Any entity marked as shared kernel includes a bounded list of participating services and a documented reason why single ownership is infeasible | Shared kernel entity has only one service listed; reason field is null or describes a temporary workaround | Schema check: shared_kernel_entities[].participating_services.length >= 2; reason field non-null and non-empty |
Anti-Corruption Layer Requirement Detection | Every ownership conflict identified in [INPUT_CONFLICT_LOG] has a corresponding ACL recommendation with translation complexity estimate | Conflict from input log has no ACL entry; ACL recommended where no conflict exists; complexity estimate is null | Cross-reference conflict log IDs with ACL recommendation IDs; assert one-to-one mapping |
Read Model Ownership Consistency | Read models are assigned to the service that owns the source of truth, not the consuming service | Read model assigned to consuming service without explicit justification; same read model assigned differently across contexts | Parse read model assignments, verify owner matches source-of-truth service from entity ownership mapping |
Event Ownership Alignment | Events are owned by the service that is the single writer of the event stream | Event owned by a downstream consumer; event ownership conflicts with entity ownership for the event's primary aggregate | For each event, extract owning service and compare to entity owner of the event's aggregate root |
Migration Risk Flagging | Output includes a risk_score field for each ownership change from [CURRENT_STATE], with scores >= 0.7 triggering a migration_notes entry | Risk score missing for a changed ownership; high-risk change has no migration notes; risk score exceeds 1.0 | Compare ownership assignments to current state; assert risk_score present for all diffs; assert migration_notes non-null where risk_score >= 0.7 |
Output Schema Conformance | Output matches [OUTPUT_SCHEMA] exactly: all required fields present, no extra top-level keys, enum values within allowed sets | Required field missing; unexpected field present; enum value outside defined set | Validate output against JSON Schema; assert validation passes with no errors |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Use the base prompt with a single service catalog document and lighter validation. Drop the anti-corruption layer and shared kernel sections if the team is still exploring boundaries. Accept a markdown table as output instead of strict JSON.
codeAnalyze data ownership for [SERVICE_NAME] using [INPUT_DOCUMENT]. Return a table mapping data entities to owning services with a one-line justification.
Watch for
- Ownership assignments that ignore read models and event streams
- Missing justification when two services both claim the same entity
- Overly broad ownership claims that hide future extraction pain

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us