regarding about game servers performance and security

I have two options to implement

  • should my game server access the database directly
  • should game server access database via api

would it be necessary to abstract the calls via api even though its located in same location