I’m working on an App that will rely on a friends Graph, which should have a recommendation feature that recommends other people based on your friends graph. Another key feature is searching by username, firstname & lastname.
I know that RedisGraph could support the search feature by using the STARTS WITH
operation on the labels of the user node. But I’m not sure if I should use RedisGraph to also store labels rather then just the relations of users, because increased memory and storage footprint = higer cost.
Does memory and storage increase a lot when adding 3 labels to a node, seen on a large number of nodes?
I currently have designed a system where the user data is stored in a seperate mySQL DB and RedisGraph would only reference the ids & relations of the user. The search would then be run over the data in mySQL. But with that design it would introduce more latency when incorporating friend relations into ranking search results. Because we would first have to get the id of all/some friends of a user and query the mySQL data to return only users who match one of the ids but also the query string.
Another solution would be to also store the searchable data in RedisGraph and keep it in sync with the mySQL DB, that way we can filter by relations & a search string with one query in RedisGraph. And directly use the returned ids to get all associated user information.
What system would you recommend? Either optimize for cost by keeping relations and the rest of user information completely separate or copy data in two places? Or am I judging RedisGraph wrong in it’s ability to store labels efficiently.