Huge searchable struct data (~500M)

I’m trying to use NSS to manage 500M of image metadata, with lots of tags that can link to some ontology.

What is the best structure to store such amount of metadata?

To be searchable (filter via a combination of tag and keyword) on serverside, seems they have to be in a single ttl file, so I can perform serverside SPARQL without download things to the frontend?