Hey guys i'm from php background and i'm trying to learn nodeJs currently but i'm bit confused about fetching data from database .
Problem 1 : How does NodeJs communicate with Database under the hood ?
Problem 2: Why do we need to make REST API in order to do backend stuff (Fetch data ,delete , add data) ? can't we do it like the way we do it in php -> connect to the database and do our backend stuff (Fetch data ,delete , add data).
Yes i know what API is and how it works .
I have read this answers : answer but this does not have what i'm looking for .
sorry if that question looks dumb :)
Any help would be helpful Thanks