omnicolor / commlink

Commlink RPG manager
MIT License
2 stars 0 forks source link

Chore: Drop Mongo as character data store #1600

Open omnicolor opened 1 week ago

omnicolor commented 1 week ago

When I initially started playing around with the idea for this project, storing the characters in MongoDB made sense:

  1. I wanted to learn Mongo.
  2. Every RPG has wildly different formats for their character sheets.
  3. MySQL support for JSON data was limited at best.

Since then:

  1. I've learned Mongo enough, but not enough to get a job in devrel with Mongo. Totally not bitter, but it seemed like a sweet gig.
  2. Well, nothing's changed. Even in different editions of the same game a character needs to be stored differently.
  3. MySQL support has improved greatly.

In addition, I know way more about the Laravel ecosystem then I used to. But doing any sort of relation between Commlink's MySQL and Mongo databases is painful at best. But loading a character's sheet (which is totally a document) while getting the benefit of the relations sounds pretty awesome. So I'd like to convert all characters' records from Mongo to MySQL.

This will allow better integration between a user and their characters, a campaign and its characters, etc. All of the HasMany() or BelongsTo() relationships will start working properly. And we can drop the (very recently introduced) Mongo container. It will hopefully speed up tests and simplify all of the test infrastructure (clearing out data from other tests in /varz for example).