<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/why-database-generated-ids-can-complicate-your-system-design-mys3qivue" -->

---
title: Why Database Generated IDs Can Complicate Your System Design
description: Letting the database generate IDs can complicate design once you add asynchronous processing or multiple service boundaries, Derek Comartin argues. He suggests...
canonical: https://daily.dev/posts/why-database-generated-ids-can-complicate-your-system-design-mys3qivue
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Why Database Generated IDs Can Complicate Your System Design | daily.dev
og:description: Letting the database generate IDs can complicate design once you add asynchronous processing or multiple service boundaries, Derek Comartin argues. He suggests...
og:url: https://daily.dev/posts/why-database-generated-ids-can-complicate-your-system-design-mys3qivue
og:image: https://api.daily.dev/og/posts/mys3qIvUE.png
og:image:alt: Why Database Generated IDs Can Complicate Your System Design
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Why Database Generated IDs Can Complicate Your System Design

**[CodeOpinion](https://daily.dev/sources/codeopinion)** · [@codeopinion](https://daily.dev/codeopinion) · 9 min read · 12 upvotes · 0 comments

## Summary

Letting the database generate IDs can complicate design once you add asynchronous processing or multiple service boundaries, Derek Comartin argues. He suggests the client generate the ID, such as a UUID or GUID or any identifier the client already knows, before the request is even sent, so it can be included in the API call and the async message from the start. Using a logistics shipment example, he shows how this shared identity lets separate boundaries, like dispatch, tracking, billing, and carrier management, each hold their own slice of data and still be correlated without broadcasting entire schemas in events like OrderDispatched. A UI can then compose a unified view from each boundary using just that shared ID.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://codeopinion.com/database-generated-ids>

## Questions this post answers

### Should I let the database generate IDs or generate them on the client before the request?

Generating the ID on the client, using a UUID or GUID, before sending the request simplifies asynchronous processing because the client already knows the identifier and can check status before the record is fully persisted. With database-generated IDs, you end up creating workaround records or separate operation IDs just to give the client something to reference immediately.

_Weighing client-generated versus database IDs for your async workflow? daily.dev surfaces system design discussions like this one._

### How do I avoid publishing an entire entity's data in domain events across microservice boundaries?

Instead of publishing large events like OrderDispatched containing the full shipment schema, publish only the shared identity (the shipment ID). Consumers such as tracking, billing, carrier management, and CRM already hold their own relevant data tied to that ID from earlier in the workflow, so a UI can compose a unified view by querying each boundary rather than requiring one service to own all the data.

_Designing event payloads across service boundaries? daily.dev collects practical architecture patterns like this for engineers building decoupled systems._

## Similar posts on daily.dev

- [Beyond UUIDv4: The Case for Cosmologically Unique IDs in Distributed Systems](https://daily.dev/posts/beyond-uuidv4-the-case-for-cosmologically-unique-ids-in-distributed-systems-oorpnxmiz) · SitePoint · 0 upvotes · 0 comments
- [Joined Up](https://daily.dev/posts/joined-up-tdmkn7vac) · The Daily WTF · 0 upvotes · 0 comments
- [How We Scaled Board Item ID Generation at monday.com](https://daily.dev/posts/how-we-scaled-board-item-id-generation-at-monday-com-dos4jt8yp) · monday Engineering · 2 upvotes · 0 comments

---

Tags: [#career](https://daily.dev/tags/career), [#architecture](https://daily.dev/tags/architecture), [#database](https://daily.dev/tags/database), [#microservices](https://daily.dev/tags/microservices), [#distributed-systems](https://daily.dev/tags/distributed-systems)

[View this post on daily.dev](https://daily.dev/posts/why-database-generated-ids-can-complicate-your-system-design-mys3qivue)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Why Database Generated IDs Can Complicate Your System Design","url":"https://daily.dev/posts/why-database-generated-ids-can-complicate-your-system-design-mys3qivue","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/why-database-generated-ids-can-complicate-your-system-design-mys3qivue"},"datePublished":"2026-10-27T21:48:05.748Z","dateModified":"2026-10-28T18:00:17.152Z","description":"Letting the database generate IDs can complicate design once you add asynchronous processing or multiple service boundaries, Derek Comartin argues. He suggests...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/e0ee1497c5b644374f356e33595ac835?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/e0ee1497c5b644374f356e33595ac835?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"CodeOpinion","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Person","name":"Derek Comartin","url":"https://daily.dev/codeopinion","image":"https://lh3.googleusercontent.com/a-/AOh14GgoQapb7NmLN1TZ6L-UCxkRpDZ4H7LKwud1DUZCTSI=s100","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":1210}},"commentCount":0,"discussionUrl":"https://daily.dev/posts/why-database-generated-ids-can-complicate-your-system-design-mys3qivue","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":12},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"career,architecture,database,microservices,distributed-systems","timeRequired":"PT9M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"CodeOpinion","item":"https://daily.dev/sources/codeopinion"},{"@type":"ListItem","position":3,"name":"Why Database Generated IDs Can Complicate Your System Design"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/why-database-generated-ids-can-complicate-your-system-design-mys3qivue#faq","mainEntity":[{"@type":"Question","name":"Should I let the database generate IDs or generate them on the client before the request?","acceptedAnswer":{"@type":"Answer","text":"Generating the ID on the client, using a UUID or GUID, before sending the request simplifies asynchronous processing because the client already knows the identifier and can check status before the record is fully persisted. With database-generated IDs, you end up creating workaround records or separate operation IDs just to give the client something to reference immediately. Weighing client-generated versus database IDs for your async workflow? daily.dev surfaces system design discussions like this one."}},{"@type":"Question","name":"How do I avoid publishing an entire entity's data in domain events across microservice boundaries?","acceptedAnswer":{"@type":"Answer","text":"Instead of publishing large events like OrderDispatched containing the full shipment schema, publish only the shared identity (the shipment ID). Consumers such as tracking, billing, carrier management, and CRM already hold their own relevant data tied to that ID from earlier in the workflow, so a UI can compose a unified view by querying each boundary rather than requiring one service to own all the data. Designing event payloads across service boundaries? daily.dev collects practical architecture patterns like this for engineers building decoupled systems."}}]}
```

