[Informational/RFC] The removal of MongoDB as a backend choice and the future of Config #3112
Labels
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Mrcoolgamer11/Red-DiscordBot#3112
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why remove support for MongoDB?
Recently, we realized a larger issue with Red's config existed. It was an awkward issue in which something we assumed to be true but did not strictly ensure, created several options nobody deciding was happy about.
The options available to us were:
The first option here was very quickly ruled out. We did not have anyone actively developing for Red who wanted to write a large amount of logic for this. Mongo had already been proven to be less suited to our use than originally thought when added. The various issues we've had to work around for it over time made people hesitant to put keep putting more work into it with the limited time available to the people working on Red.
The second option was considered, however, the number of users it could break was unquantifiable.
The large majority of our users use the JSON driver. There are also a large number of private or at least not publicized cogs in existence. Changing config here, especially so close to our next release could have broken any number of these cogs and users, without easy handling available as it would require cog creators changing (and migrating) their data structures.
The third option was also unpopular among people deciding on this, though ultimately is what we have gone with. (#3099) At least people who are using MongoDB have alternatives, and those alternatives will not require any knowledge to swap to beyond the ability to follow basic instructions.
(#3108)
So what does this mean for Config going forward?
Red's config module should largely be in a stable place from here forward. There are still things we would like to improve based on what we've learned from it and from how users have given feedback on how they find it to be useful and what they would like to see in it.
However, I don't think Config should be changed any further going forward.
So if Config won't be receiving further changes, how will the improvements reach users and developers?
Config2
What is Config2?
Just a separate module allowing us to keep Config as-is for people to keep using without any additional work for existing cogs. While Config2 is intended to be easy to switch to, we don't need to tear down Config to make that a reality.
The goals of Config2
__getattr__useNon-goals of config2
Below is an overview of the changes planned from config to config2 from a cog creator standpoint. Feedback is highly encouraged if something in here does not work for your use case, or if there is something you would want to see added to it.
Usability can be mostly identical. The places where it will differ.
You will not be able to set on partial identifiers as a sort of "fast route" for bulk settings values.
config.global_valuewon't work anymore. This will be moved toconfig.botwideto better support extendability.You will be able to subclass config to add methods. The internals will be documented well enough for this to be feasible.
Config2 will have 3 available ways to handle group access.
config.botwide["value_name"]Config2 should be faster for reading values
Config2 may be faster for setting values as well
Bulk read access may receive an optimized path as well
Overall the intent is that this should be as close to a drop-in replacement as possible and assuming your data is already compatible, you should be able to use an automatic method to move over and gain features and performance by doing so.
That said, we will also be adding support for a distinction in channel types while providing a generic channel type as well for storage. Upon converting, the converter will check that your data is compatible with the new changes (there aren't many new restrictions) and if provided with a channel type, your current channel data from config will be assumed to be a specific channel type in config2 for the purpose of migrating it. (If your cog stores data about multiple channel types, you won't specify this.)
* Note that in the case of drivers that hold values in memory already, the driver may prevent an LRU cache from being created should it not be a significant improvement. This is intended as a mostly transparent feature aimed at performance first.
As I'm no longer handling this, closing.