How should I store the data received from the API in contact?

Hi! Do a search on its database for the existence in it of users who have signed up under the contact.

Is a request to the API contact, return friends of user with the supplied id. It's all good. But then I need to query all friends of each other. Then it turns out metricheskie volume of data and cycles.

I thought when registering the user to enter a list of his friends in file and out file to extract. I have heard that doing such things with redis.

Prompt how better to implement it. In the end you need when looking for friends and friends of friends to check for their existence in the system.
July 9th 19 at 13:53
1 answer
July 9th 19 at 13:55
Better use a graph database for such cases just created. For Example, ArangoDB
A distributed free and open-source database with a flexible data model for documents, graphs, and key-values. Build high performance applications using a convenient SQL-like query language or JavaScript extensions.
and other.

Find more questions by tags MySQLPHPRedisVKontakte