TE
テックエコー
ホーム24時間トップ最新ベスト質問ショー求人
GitHubTwitter
ホーム

テックエコー

Next.jsで構築されたテクノロジーニュースプラットフォームで、グローバルなテクノロジーニュースとディスカッションを提供します。

GitHubTwitter

ホーム

ホーム最新ベスト質問ショー求人

リソース

HackerNews APIオリジナルHackerNewsNext.js

© 2025 テックエコー. すべての権利を保有。

Ask HN: Any good tools to pgdump multi tenant database?

3 ポイント投稿者: polishdude201日前
Just joined a new company and they run a multi tenant database in postgres where each tenant is distinguished by their account ID. I&#x27;d like to be able to dump the data of a single account to my local instance to assist in debugging.<p>Problem is, many of the entities do not include an account ID. For example, a user can have an account ID but a user post will not but it will be tied to a user ID.<p>Also foreign keys aren&#x27;t really implemented fully.<p>Are there any tools or techniques that could help make this process easier to do?

2 comments

tudorg1日前
You can try with data subsetting tools, a few that I know are: greenmask, jailer, tonic condenser, and I think there are more. They are not exactly for your use case, but might help you a bit. The problem is most of these tools can walk foreign keys, but only in one directions.<p>Also, since you said FK are not fully implemented, then there just won&#x27;t be enough information for them to work with. So you can either work on fixing the foreign keys or have more complex scripts.
评论 #44008873 未加载
abhisek1日前
This is poor design. Multi-tenant data model design must have a tenant or segment ID for every tenant segmented tables. While it may not be a problem initially but as the business grows, you may need to move tenant data to separate DBs or even different regions based on compliance requirements. IMHO it is a good idea to run DB migrations and have a tenant ID populated in all tenant segmented tables
评论 #44008850 未加载