Congratulations!

[Valid RSS] This is a valid RSS feed.

Recommendations

This feed is valid, but interoperability with the widest range of feed readers could be improved by implementing the following recommendations.

Source: https://www.mongodb.com/community/forums/t/advice-for-modeling-a-database-for-multiple-games/112594.rss

  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  3.  <channel>
  4.    <title>Advice for modeling a database for multiple games</title>
  5.    <link>https://www.mongodb.com/community/forums/t/advice-for-modeling-a-database-for-multiple-games/112594</link>
  6.    <description>I have multiple games I want to store data for. The data for each player is stored in a single document with a UUID to identify it. The two options I have thought of so far is:
  7. 1. Have one collection per game.
  8. 2. Have one collection for all games.
  9.  
  10. The problem with option 1 is that I do not know how I would get all stats for all games per player while having good performance. Sending a query to each collection simultaneously to get all their stats seems wrong, although I think this is the best option so far.
  11.  
  12. For option 2, I would not be able to create indexes on the fields that needs to be indexed because the number of games and fields per game could be expanded at any time. It would also be very many read and write operations on a single collection which seems very wrong.
  13.  
  14. Does anyone have any advice on this?</description>
  15.    <language>en</language>
  16.    <lastBuildDate>Thu, 11 Apr 2024 18:58:22 +0000</lastBuildDate>
  17.    <category>Working with Data</category>
  18.    <atom:link href="https://www.mongodb.com/community/forums/t/advice-for-modeling-a-database-for-multiple-games/112594.rss" rel="self" type="application/rss+xml" />
  19.      <item>
  20.        <title>Advice for modeling a database for multiple games</title>
  21.        <dc:creator><![CDATA[steevej]]></dc:creator>
  22.        <description><![CDATA[
  23.            <p>This looks a lot like a ChatGPT created post.  A lot of words, nothing really specific.  May be you can elaborate.</p>
  24. <p>I do not really the hybrid part of point 1.  Player info into a player collection and game info in a game collection.</p>
  25. <p>Could you provide examples of game-specific fields?</p>
  26. <p>As for .3, how could we use MongoDB’s aggregation framework to retrieve relevant data across multiple collections?</p>
  27. <p>By the way I flagged your other posts as spam and I started to follow you to catch your next attempt faster.</p>
  28.          <p><a href="https://www.mongodb.com/community/forums/t/advice-for-modeling-a-database-for-multiple-games/112594/7">Read full topic</a></p>
  29.        ]]></description>
  30.        <link>https://www.mongodb.com/community/forums/t/advice-for-modeling-a-database-for-multiple-games/112594/7</link>
  31.        <pubDate>Sun, 28 Jan 2024 15:16:39 +0000</pubDate>
  32.        <guid isPermaLink="false">www.mongodb.com-post-112594-7</guid>
  33.        <source url="https://www.mongodb.com/community/forums/t/advice-for-modeling-a-database-for-multiple-games/112594.rss">Advice for modeling a database for multiple games</source>
  34.      </item>
  35.      <item>
  36.        <title>Advice for modeling a database for multiple games</title>
  37.        <dc:creator><![CDATA[Jennifer_Lisa]]></dc:creator>
  38.        <description><![CDATA[
  39.            <ol>
  40. <li><strong>Consider Hybrid Approach:</strong> Create a separate collection for player data and a collection for each game. Store player-related data in the player collection and game-specific data in respective game collections. This allows for efficient retrieval of player stats while maintaining game-specific details.</li>
  41. <li><strong>Use Indexing Wisely:</strong> For the player collection, focus on indexing fields crucial for player-related queries. For game collections, consider indexing game-specific fields. This balances performance without excessive indexing on a single collection.</li>
  42. <li><strong>Optimize Query Patterns:</strong> Design your queries to minimize the number of database hits. Utilize MongoDB’s aggregation framework to efficiently retrieve relevant data across multiple collections, reducing the need for simultaneous queries.</li>
  43. <li><strong>Keep Collections Lean:</strong> Avoid unnecessary duplication of data across collections. Store shared player information in the player collection and only game-specific details in game collections. This helps in managing data consistency and reduces storage overhead.</li>
  44. <li><strong>Monitor and Scale:</strong> Regularly monitor database performance and adjust your approach based on evolving needs. If performance issues arise, consider sharding, caching, or other scaling strategies to ensure efficient handling of growing data volumes.</li>
  45. </ol>
  46.          <p><a href="https://www.mongodb.com/community/forums/t/advice-for-modeling-a-database-for-multiple-games/112594/6">Read full topic</a></p>
  47.        ]]></description>
  48.        <link>https://www.mongodb.com/community/forums/t/advice-for-modeling-a-database-for-multiple-games/112594/6</link>
  49.        <pubDate>Thu, 25 Jan 2024 20:47:25 +0000</pubDate>
  50.        <guid isPermaLink="false">www.mongodb.com-post-112594-6</guid>
  51.        <source url="https://www.mongodb.com/community/forums/t/advice-for-modeling-a-database-for-multiple-games/112594.rss">Advice for modeling a database for multiple games</source>
  52.      </item>
  53.      <item>
  54.        <title>Advice for modeling a database for multiple games</title>
  55.        <dc:creator><![CDATA[steevej]]></dc:creator>
  56.        <description><![CDATA[
  57.            <p>I flagged the first post as spam rather than the last one.</p>
  58. <p>I do not see the option to undo my mistake.</p>
  59.          <p><a href="https://www.mongodb.com/community/forums/t/advice-for-modeling-a-database-for-multiple-games/112594/5">Read full topic</a></p>
  60.        ]]></description>
  61.        <link>https://www.mongodb.com/community/forums/t/advice-for-modeling-a-database-for-multiple-games/112594/5</link>
  62.        <pubDate>Tue, 25 Apr 2023 18:39:52 +0000</pubDate>
  63.        <guid isPermaLink="false">www.mongodb.com-post-112594-5</guid>
  64.        <source url="https://www.mongodb.com/community/forums/t/advice-for-modeling-a-database-for-multiple-games/112594.rss">Advice for modeling a database for multiple games</source>
  65.      </item>
  66.      <item>
  67.        <title>Advice for modeling a database for multiple games</title>
  68.        <dc:creator><![CDATA[Jussi_R1]]></dc:creator>
  69.        <description><![CDATA[
  70.            <p>HI <a class="mention" href="https://www.mongodb.com/community/forums/community/forums/u/pavel_duchovny">@Pavel_Duchovny</a>,</p>
  71. <p>Thanks for the good reference to Henriks problem. I have bit similar, and did some research about patterns.</p>
  72. <p>I have a followup question and thought perhaps it would be ok to continue in this thread, feel free to move or ask me to create a new topic.</p>
  73. <p>I’m tracking users progress like following. User has few paths to complete. Paths have few stages to complete that are basically different games.</p>
  74. <p>The data is used to give feedback to the user and also for analytical purposes and exported to olap(bq).I was also thinking about having different games data<br>
  75. in their own collections, but Pavel didn’t suggest that approach. Different games amount would be less than fifty.</p>
  76. <p>I was thinking something like following, but started thinking that maybe all the stage data should be as key-value pairs? Also if want at some point more detailed data about gameplay for analytical purposes,<br>
  77. maybe that data should be in its own collection to prevent not to fill 15 mb limit and because it is not accessed by the app?</p>
  78. <pre><code class="lang-auto">
  79. "Paths":
  80. {
  81.  "PathOrder": [Path1, Path3, Path4, Path2]    
  82.  "Path1":
  83.  {
  84.     "Stage1":
  85.     {
  86.        "GameName": "SpeedDrill",
  87. "PlayTime":92,
  88. "FirstPlayTime": 168123123,
  89. "LastPlayTime": 168124567,
  90. "SpecData":
  91. {[
  92. {"key": "Crashes", "value": 2},
  93. {"key": "AvgSpeed", "value": 65},
  94. {"key": "Laps", "value": 7}
  95. ]}
  96.        "completed": false,
  97.        "attempts": 1
  98.     },
  99.     "Stage2":
  100.     {
  101. "GameName": "AccuracyDrill",
  102. ...
  103.     }
  104.  
  105.  }
  106.  "Path2":
  107.  ...
  108. </code></pre>
  109.          <p><a href="https://www.mongodb.com/community/forums/t/advice-for-modeling-a-database-for-multiple-games/112594/3">Read full topic</a></p>
  110.        ]]></description>
  111.        <link>https://www.mongodb.com/community/forums/t/advice-for-modeling-a-database-for-multiple-games/112594/3</link>
  112.        <pubDate>Tue, 25 Apr 2023 08:33:24 +0000</pubDate>
  113.        <guid isPermaLink="false">www.mongodb.com-post-112594-3</guid>
  114.        <source url="https://www.mongodb.com/community/forums/t/advice-for-modeling-a-database-for-multiple-games/112594.rss">Advice for modeling a database for multiple games</source>
  115.      </item>
  116.      <item>
  117.        <title>Advice for modeling a database for multiple games</title>
  118.        <dc:creator><![CDATA[Pavel_Duchovny]]></dc:creator>
  119.        <description><![CDATA[
  120.            <p>Hi <a class="mention" href="https://www.mongodb.com/community/forums/community/forums/u/henrik">@Henrik</a> ,</p>
  121. <p>Having a collection per game doesn’t sound right. We have a known antipatterns of having to many collections and indexes and we should avoid it as much as possible.</p>
  122. <p>The MongoDB locking is per document so writing similar objects to the same collection should not interfere with concurrency as long as you hit different documents.</p>
  123. <p>Additionally, as your database grow and you wish going to sharding the deployment having single collection to be sharded makes more sense than lots of small ones which doesn’t.</p>
  124. <p>You might consider having a hybrid solutions if the single collection doesn’t work like collection per month or per 6 months for all games.</p>
  125. <p>Now if you have a large number of attributes that you need to index for search you may consider the attribute pattern for each game</p>
  126. <aside class="onebox allowlistedgeneric" data-onebox-src="https://www.mongodb.com/blog/post/building-with-patterns-the-attribute-pattern">
  127.  <header class="source">
  128.      <img src="https://www.mongodb.com/community/forums/uploads/default/original/3X/e/0/e05510e24bc504d73dd7cea40fd3386920393e4b.png" class="site-icon" width="16" height="16">
  129.  
  130.      <a href="https://www.mongodb.com/blog/post/building-with-patterns-the-attribute-pattern" target="_blank" rel="noopener">MongoDB</a>
  131.  </header>
  132.  
  133.  <article class="onebox-body">
  134.    <div class="aspect-image" style="--aspect-ratio:690/258;"><img src="https://www.mongodb.com/community/forums/uploads/default/optimized/1X/e62fd5c92363774b8ecdd39ed568870e5047ec69_2_690x258.jpeg" class="thumbnail" width="690" height="258" srcset="https://www.mongodb.com/community/forums/uploads/default/optimized/1X/e62fd5c92363774b8ecdd39ed568870e5047ec69_2_690x258.jpeg, https://www.mongodb.com/community/forums/uploads/default/optimized/1X/e62fd5c92363774b8ecdd39ed568870e5047ec69_2_1035x387.jpeg 1.5x, https://www.mongodb.com/community/forums/uploads/default/optimized/1X/e62fd5c92363774b8ecdd39ed568870e5047ec69_2_1380x516.jpeg 2x" data-dominant-color="99A8AB"></div>
  135.  
  136. <h3><a href="https://www.mongodb.com/blog/post/building-with-patterns-the-attribute-pattern" target="_blank" rel="noopener">Building with Patterns: The Attribute Pattern | MongoDB Blog</a></h3>
  137.  
  138.  <p>Learn about the Attribute Schema Design pattern in MongoDB. This pattern is used to target similar fields in a document and reducing the number of indexes.</p>
  139.  
  140.  
  141.  </article>
  142.  
  143.  <div class="onebox-metadata">
  144.    
  145.    
  146.  </div>
  147.  
  148.  <div style="clear: both"></div>
  149. </aside>
  150.  
  151. <p>I suggest reading the following articles</p>
  152. <p><a href="https://www.mongodb.com/article/schema-design-anti-pattern-summary/" class="onebox" target="_blank" rel="noopener">https://www.mongodb.com/article/schema-design-anti-pattern-summary/</a></p>
  153. <p><a href="https://www.mongodb.com/article/mongodb-schema-design-best-practices/" class="onebox" target="_blank" rel="noopener">https://www.mongodb.com/article/mongodb-schema-design-best-practices/</a></p>
  154. <p>Best<br>
  155. Pavel</p>
  156.          <p><a href="https://www.mongodb.com/community/forums/t/advice-for-modeling-a-database-for-multiple-games/112594/2">Read full topic</a></p>
  157.        ]]></description>
  158.        <link>https://www.mongodb.com/community/forums/t/advice-for-modeling-a-database-for-multiple-games/112594/2</link>
  159.        <pubDate>Fri, 25 Jun 2021 05:19:26 +0000</pubDate>
  160.        <guid isPermaLink="false">www.mongodb.com-post-112594-2</guid>
  161.        <source url="https://www.mongodb.com/community/forums/t/advice-for-modeling-a-database-for-multiple-games/112594.rss">Advice for modeling a database for multiple games</source>
  162.      </item>
  163.      <item>
  164.        <title>Advice for modeling a database for multiple games</title>
  165.        <dc:creator><![CDATA[Henrik]]></dc:creator>
  166.        <description><![CDATA[
  167.            <p>I have multiple games I want to store data for. The data for each player is stored in a single document with a UUID to identify it. The two options I have thought of so far is:</p>
  168. <ol>
  169. <li>Have one collection per game.</li>
  170. <li>Have one collection for all games.</li>
  171. </ol>
  172. <p>The problem with option 1 is that I do not know how I would get all stats for all games per player while having good performance. Sending a query to each collection simultaneously to get all their stats seems wrong, although I think this is the best option so far.</p>
  173. <p>For option 2, I would not be able to create indexes on the fields that needs to be indexed because the number of games and fields per game could be expanded at any time. It would also be very many read and write operations on a single collection which seems very wrong.</p>
  174. <p>Does anyone have any advice on this?</p>
  175.          <p><a href="https://www.mongodb.com/community/forums/t/advice-for-modeling-a-database-for-multiple-games/112594/1">Read full topic</a></p>
  176.        ]]></description>
  177.        <link>https://www.mongodb.com/community/forums/t/advice-for-modeling-a-database-for-multiple-games/112594/1</link>
  178.        <pubDate>Thu, 24 Jun 2021 13:14:29 +0000</pubDate>
  179.        <guid isPermaLink="false">www.mongodb.com-post-112594-1</guid>
  180.        <source url="https://www.mongodb.com/community/forums/t/advice-for-modeling-a-database-for-multiple-games/112594.rss">Advice for modeling a database for multiple games</source>
  181.      </item>
  182.  </channel>
  183. </rss>
  184.  

If you would like to create a banner that links to this page (i.e. this validation result), do the following:

  1. Download the "valid RSS" banner.

  2. Upload the image to your own server. (This step is important. Please do not link directly to the image on this server.)

  3. Add this HTML to your page (change the image src attribute if necessary):

If you would like to create a text link instead, here is the URL you can use:

http://www.feedvalidator.org/check.cgi?url=https%3A//www.mongodb.com/community/forums/t/advice-for-modeling-a-database-for-multiple-games/112594.rss

Copyright © 2002-9 Sam Ruby, Mark Pilgrim, Joseph Walton, and Phil Ringnalda