Are Callable Cloud Functions better than HTTP functions?
Solution 1:
Callable functions are exactly the same as HTTP functions, except the provided SDKs are doing some extra work for you that you don't have to do. This includes, on the client:
- Handling CORS with the request (for web clients)
- Sending the authenticated user's token
- Sending the device instance id
- Serializing an input object that you pass on the client
- Deserializing the response object in the client
And on the backend in the function:
- Validating the user token and providing a user object from that
- Deserializing the input object in the function
- Serializing the response object in the function
This is all stated in the documentation. If you are OK with doing all this work yourself, then don't use callables. If you want this work done automatically, then callables are helpful.
If you need direct control over the details of the HTTP protocol (method, headers, content body), then don't use a callable, because it will hide all these details.
There are no security advantages to using callables. There are no speed improvements.