I have a PostgreSQL table of users and followers named relations with the size of 200 million rows and it's growing at the rate of 10 million new users and new relations between them a week. I have set an index on the columns and I need every pair of user and follower to be unique. The maximum number of follower for a user is 5000, and the user queries are for both directions like:
on users SELECT users, followers FROM relations WHERE users NOT IN (1,2,3);
on followers SELECT users, followers FROM relations WHERE followers NOT IN (1,2,3);
time:
A simple query like SELECT COUNT(*) FROM relations;
would take 10 seconds in my system and I need to wait for half an hour to execute previously mentioned queries.
What is the best database to store this graph (high write rate and high read rate)