Custom data stores for Events and Users

Former Member
Former Member

It seems I might need to create custom data stores for events and users, as I am filtering & sorting on custom fields. My question is: would I store all the data in the custom tables, or just the EventIDs/UserIDs and the fields that I need to sort or filter on?

Also, how would I add/retrieve data from the custom tables? would I need to create Widget Extensions for this?



Edited
[edited by: IbrahimK at 4:40 PM (GMT 0) on Mon, Aug 17 2020]
  • What, where and how custom data is stored/accessed is completely up to you and your .NET code. From a Community perspective, all that matters is that it's ultimately exposed via an API that you define. If it needs to be consumed by a widget, yes, that would mean you'd want to wrap your custom API in a widget/script extension. I'd recommend reviewing the documentation on widget extensions.

  • Typically when I have created custom tables, you would just use the UserId/EventId (or sometimes ContentId/ContentTypeId) and then any additional data you need to store about those entities.

    Typically you'll need a Data Layer (connect to and execute your SQL stored procedures)

    Abstraction Layer - classes that can be called by other classes or your widget layer which execute your data methods - these methods are data-store agnostic

    Widget/UI/API layer - expose your abstraction methods to the front-end

    The reason you need all three is this:  Let's say I'm beng lazy or don't have tons of time and I make a plugin that simply stores XML in a plugin config.  I have intentions of moving to a DB at a later date.

    When I'm ready to move, all I have to do is update my DAta Layer to read from Database instead of XML.  Everything else should work so long as I keep the same method signatures.