I'm building a simple REST-API which has one endpoint, which will be penetrated heavily. Let's call it POST /message
. I have to decide between using Node or PHP. The Database is MySQL.
What happens inside this route: - Credentials through HTTP-Auth will be checked by reading them from the database. - Request to another REST-API. - Another write-database action will be performed.
So there are 2 database connections and a http request to another REST-API. The route should all be about speed. I would go for PHP, because the current system is based on PHP, but the request inside the route scares me, cause it's not made asynchronously when using PHP. I don't care about the result of this request and in node I could just check the credentials and return success
, send the request asynchronously and do the database write performance after the request returns. I don't think I can do that in PHP, cause when I return the REST call with success
, everything has to be done before, right?
Go for PHP or node?