MySql and Redis support

mikec

Master Of All That I Survey
Administrator
Jul 12, 2014
296
117
28
Los Angeles, California, USA
I can add MySql support. It's pretty easy. But what do you want to use it for? How much help do you want from Fougerite using it in your plugin? If I instance a MySqlClient object and hand it back to you, is that all you need?

MySQL C# tutorial
Connect C# to MySQL

It seems to me that this isn't easily handled in a generic way. I need to know a lot about how your database is setup in order to provide methods to access it.

I'd rather support Redis.

Redis, on the other hand, is a Key/Value store, also called NoSql database. It's basically a glorified DataStore, and you use it in basically the same way: Store(key, value) or value = Get(key). The keys and values can be any serializable basic types (int, float, string, bool, etc), and lists, hashes, sets, sorted sets and bitmaps of those types. All documents (values) are stored as JSON, and you can send raw JSON as well, to store a complex type.

Redis also supports Pub/Sub, where clients can subscribe to topics and be notified when updates to those topics occur. So your website could be notified when a Redis key is updated when a user logs onto the server. Or you could require new users to login with Steam on your website, and as soon as Redis gets the commit, it dispatches the SteamID to the server whitelist and the site launches the client and connects it to the server. That sort of thing. "Reactive Programming" as the cool kids say.

Redis
ServiceStack.Redis
 

mikec

Master Of All That I Survey
Administrator
Jul 12, 2014
296
117
28
Los Angeles, California, USA
No interest in this at all?

I'm adding Redis support, then. I will probably even add it as an option for DataStore to use Redis instead of a local Hashtable. Redis is accessed using a key, just like DataStore. The details can be hidden behind the same interface: DataStore.Add, DataStore.Get, etc.
 

mikec

Master Of All That I Survey
Administrator
Jul 12, 2014
296
117
28
Los Angeles, California, USA
"Easy" is why these networked KeyValue stores like Redis were invented. It's for situations where indexed networked storage is needed, but complex queries are not necessary. Any SQL database can function like a Hashtable, but that's a lot of overhead when just a Hashtable with a flat key namespace would do.