Getting information from the database

I am creating a plugin which requires the number of reads from a user’s posts. Is there a better way to do it than querying the database directly from the plugin?