Note that there are some explanatory texts on larger screens.

plurals
  1. PODatabase Architecture for "Badge" System & Arbitrary Criteria (MySQL/PHP)
    primarykey
    data
    text
    <h3>Quickie-Question:</h3> <p>To summarize, I'm a little confused as to how I would design such a database that allows indefinite badge-rule creation without requiring structural changes to the previously existing user-tables in the database.</p> <p>Storing Badge Title, Criteria, etc. What would that Table look like?</p> <ul> <li>badge_id (1)</li> <li>badge_title (10K Badge)</li> <li>badge_image (10k.jpg)</li> <li>badge_criteria ([posts] >= 10000)<br/> <code>...</code></li> </ul> <h3>Winded-Question:</h3> <p>I would like to implement a badge-system on my own personal projects, but am seeking a bit of advice as to how one would best do such a thing. I've been reading some of the questions here about badge-systems, but don't see the database-architecture getting much attention.</p> <p>Badges that are based on user-points (Hypothetical "10k Badge") would seem pretty straight forward. Any event that affects the users reputation (upvotes, downvotes, answer-accepted, etc) would invoke a method to review the users new reputation, and potentially award a badge.</p> <p>That system sounds pretty straight forward, but what does that look like as a database for the administrator who wants to create innumerable amounts of badges with little-effort down the road - some of which may be based on different criteria, and not simply the user reputation.</p> <p>User-reputation is likely a value within the user-record itself. But ideally, wouldn't you want to avoid having to add new fields to the user table when you create new badges? For instance the "Edited 100 Entries" badge - you wouldn't create a new column "entries_edited" within the Users Table, would you? And then increment that after each entry-edited...</p> <p>Any hints?</p> <p>Stackoverflow Archive:</p> <ul> <li><a href="https://stackoverflow.com/questions/522943/best-way-to-store-badge-criteria">Best way to Store Badge Criteria</a> <strong>(Not a duplicate)</strong></li> <li><a href="https://stackoverflow.com/questions/314412/designing-a-badge-system-where-to-fire-business-logic-in-code-or-stored-procedu">Designing a Badge System: Where to fire business-logic?</a></li> </ul> <hr> <p><em>Note: I'm NOT asking how to associate badges with users. I'm NOT asking how to award badges (that will be done programmatically)</em> </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload