Roles are associated with applications and users, whereas grants are associated with users and entities.
To find all users with role X or grant Y, you'd need to make two different search calls like this:
By Entity
GET/api/entity/grant/search?entityId={uuid}
By User
GET/api/entity/grant/search?userId={uuid}
You don't need to maintain a separate database.
Here's an example of a grant search for a user: https://fusionauth.io/docs/apis/entities/grants#search-for-grants
If you search for the string Example JSON
in the page you will also see the link to Entity APIs