AllenNeuralDynamics / aind-metadata-viz

Website for public metadata visualization
MIT License
0 stars 0 forks source link

Switch backend to use querying before filtering #5

Closed Sun-flow closed 1 month ago

Sun-flow commented 2 months ago

Right now we are querying the whole database, then manually filtering assets.

Consider changing the initial filter to utilize the settings of the user, and then filter as necessary from there manually. This would reduce request size, and allow us to export the query in the future for the user to do their own filtering using MongoDB or some such method.

Another future application would be directly applying a custom/user-defined query filter, then getting presence outputs on the results.

dbirman commented 2 months ago

Generating the queries is definitely a small add, but currently the server is caching the entire database so performance would take a hit if I changed it to actually use the queries to retrieve records. The caching is probably worth it, if you make a large query it can take 20-30 seconds to request everything.

Adding the models for search parameters I'll add in a separate ticket.

And allowing for custom query filters that get pasted would also be easy to add.

dbirman commented 1 month ago

After discussion w/ David I'm going to implement this

dbirman commented 1 month ago

Some notes for myself:

dbirman commented 1 month ago

With the validation code running on the Panel server I think this is too hard to implement, need to revisit in the future. We can re-open this as a discussion in the future if we want