collections - MongoDB default items with user overwrite -
so problem seems simple every way approach solution seems poor implementation approach either duplicated content or messy data.
the problem
i want provide option “overwrites” per user on “default” items. have mongodb database collection containing items following information:
- id
- name
- icon
- description
there set of 20-30 items in collection, each user using app views.
most users happy see default if user wishes change icon item or name how handle “overwrite” on ”default” item single user.
possible solutions
my thoughts implement 1 of following options seem little wrong (i have provided thoughts on this):
- for each “overwriten” item add duplicated item collection changes , user_id field link user - seems little bit of duplicated content user might change icon , not name/description. if name changed int eh future on default item how handle , how understand item must replace 1 of “defaults” user. worry little bit of performance issue when looking items , replacing changed item
- having items duplicated per user in same collection - duplication of content might best performing option cause issues in future if new “default” items need added or default options need changing
- collection per user - same previous. options seems kinds of wrong maybe i’m new , best option.
- collection containing overwrites - seems idea equally bad 1 due looking , comparing. if changed why not have new items rather find replace.
reason wanting right
maybe i’m on thinking seems face issue lot , think need right remove future issues performance, data management , updates default items.
Comments
Post a Comment