Article
· Feb 27, 2018 2m read

Dataset Lightweight M:N

 

This data set demonstrates a basic M:N relationship between 2 tables
The dataset is targeted to show a slim implementation of M:N
It's no question that other implementations exist. But at significantly more storage consumption.

The first is a list of members in Developer Community counting badges gained in Global Masters
The second is the reference to assigned badges from Global Masters with their titles
So we have M members that refer to the multiple badges they gained + their count
And we have a set of N Bagdes that are assigned to several members + the count of members
related to that badge and the Ids to these members.

All data result from the analysis of the member web pages in Developer Community
A utility for updates of ídentified members and the addition of new members is provided
The actual status reflects 10286 account pages downloaded and analyzed relating to 179 badges.

Relations are implemented as Lists of pure id's (not oref to save space)

/// pure ID of awarded GM badges
Property Badges As List Of %Integer;

/// pure ID of assigned members
Property Members As List Of %Integer;

A few explanations on operation structures for further extension:

  • GM badges never change or get deleted - so they just can grow
  • DC members can get GM badges granted, but they will never lose it It is up to you to take care of the correct maintenance of the M:N relations for DELETE or UPDATE of DC members. This is intentionally left open.

3 utility methods are provided:

  • Load(): this loads and analyzes the information presented on the member's page
  • Upd() : runs over every defined member using Load() for actual values
  • New()  : runs past the highest known MemberId and tries to find new ones MemberId's are not given in closed sequence. So they can't be predicted but only tried

GitHub

Discussion (0)1
Log in or sign up to continue