is wordpress stores Role Id in WP database?

The “ID” of the role is the array key in wp_user_roles.

The value of wp_user_roles looks like this:

Array
(
    [administrator] => Array
        (
            [name] => Administrator
            [capabilities] => Array

        )

     => Array
        (
            [name] => Author
            [capabilities] => Array
        )
)

In that example, administrator and author are the closest thing there is to a “role ID”.