Currently assessing FaunaDB for a new project we are embarking, one requirement is a pretty classic one where users will have to search a product catalogue given different sets of filters. So, some information on the data:
There are around 10.000 products
Each product has around 20-30 attribute that will be filterable
Products are generally uniform. So they will have most of the time the same sets of attributes.
Once populated, the product collection will be pretty much stable, (few writes, lots of reads)
The first straightforward/simple solution coming to mind is to create indexes for those properties and then when searching, using those indexes for matches. So a typical query could involve ~10 indexes.
I was wondering about the feasibility and performance implications of this solution? Any obvious downsides? Or would you advise an alternative approach?
I wrote out a complete guide on stackoverflow recently to address those kind of questions. I’ll have to copy it in here when I have some more time.
It discusses the different approaches and pros and cons. The performance of the solution we advise there should be good, especially given that the size of your data is relatively small. If you experience anything different, please reach out to us.
Maybe I’m missing something but filtering and sorting on catalog items sound like a job for Algolia or Elastic (or even Rockset from personal experience). You can use Fauna as your source of truth, and derive from it what you need and pump it to one of the services I mentioned. Wouldn’t it work for your use case?
Hi Yaron, thanks for your comments. I think you’re right in principle. But I was hoping, with the relatively low number of products I have, I could get away with Fauna without introducing extra complexity to the systems I have to manage. I try to aim for simplicity where it permits.
It seems Fauna will be sufficient for now and if the requirements change in the future, I’d most surely look into products you mentioned. I’ve already used Elastic extensively but wasn’t aware of Algolia. Thanks for bringing that up.