Unless your mod is meant for a server with a large amount (say more than 500) of players, using capabilities is far superior than using a database.
At a scale of normal modded Minecraft (which is normally less than 100 players), storing data on disk and retrieving it is way less impactful than setting up an entire database.
Moreover, capabilities allows cross-mod integration, which is often times important if you want to use other mods.