I am currently working on a small data ‘reporting’ application. The idea behind it is to be able to import data from a specific location (be it a flat file or a remote database) and report on that data (e.g. Sales) following specific ‘dimensions’ (e.g. Sales by region, by product, by customer). At first when I built it, I created a ‘Sales’ model with these dimensions as FK’s to other models (a Region model, a Product model, a Customer model). The reporting aspect of the application is simply a bunch of requests on that table ending up in charts---this works fine.
Now let’s say I want to deploy/scale this application to multiple users; each user would have its own dataset, e.g. User A wants to report on Sales (by region, product and customer) while User B wants to report on Production volumes (by product, by plant and by month). What would be the best way to handle this? Is there a way to make the data model abstract from the underlying data sets?
I’ve had a quick look at various solutions such as:
Django dynamic models
This could be an interesting approach however looking at the code it seems like it's only possible to add/remove fields dynamically---what I would need is to add/remove models dynamically.
NoSQL or any unstructured database backend
This could be an option from what I have seen but I have no experience with those so it's difficult to assume.
Any EAV type of data model
Same as for (1) I am under the impression that this could work for fields, but rather not for entire tables.
Serialization using JSONField to store data
I’m struggling to see how I could take this forward using Django (at some point I feel like I’m (wrongly) trying to build a DBMS all over again).
Any help is appreciated !
Cheers, J–