TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: How do you document your Data Models?

6 点作者 pierre将近 3 年前
When documenting my last project I came to the realization that all projects I have worked on have a very poor documentation of their data model. I believe that this leads to longer onboarding time and a lot of newscommer mistakes in the project (such adding new properties for something that exists somewhere else). Generally the data model is documented in the database &#x2F; ORM, but it generally describe the physical representation of the data in the database (name is a Varchar(128)) but not how&#x2F;for what such data are to be use (which is sometime complicate to understand on old project where knowledge has been lost and when naming is not consistent&#x2F;explicit).<p>It seems that recent ORM that allow you to describe your DB schema as code (like Prisma) allow you to add ‘comments’ on your Data model, but I feel it’s not enough.<p>I have look at the data modeling tooling but haven’t found satisfying solutions.<p>I missing something? How do you document your app data model?

2 条评论

dmfay将近 3 年前
Postgres schema comments (COMMENT ON COLUMN mytable.mycolumn IS &#x27;spline reticulation coefficient&#x27;). Otherwise, I&#x27;ve given up on ever maintaining data model documentation and generate ad hoc graphs from different perspectives in the foreign key network: <a href="https:&#x2F;&#x2F;di.nmfay.com&#x2F;exploring-databases-visually" rel="nofollow">https:&#x2F;&#x2F;di.nmfay.com&#x2F;exploring-databases-visually</a>
fmakunbound将近 3 年前
Well, we take a distributed approach where I work currently. Some of it is in an Excel or a Google Calc spreadsheet, some in Confluence, the project README.md, random Git comments. Sometimes we annotate the classes in the code with documentation and sometimes even generate the documentation from that. It’s all a little confusing TBH. Some of our models are cross domain and have meaning depending on context.