Callable Cloud Function use case

Put everything proprietary you don't want stolen in a cloud function. Put only your front-end interface in the client app.

IMO - apps that are not designed to be used offline, shouldn't have any complex or proprietary functionality on the client-side besides user interface control. Everything else should be handled via API to a cloud function.

There is very little complexity and latency with this separation - in fact it makes development much easier when functionality is separate from UX. And your app can't get cloned. This also keeps your front-end very light weight.

I have very complex cloud functions (perform an elasticsearch lookup, then perform complex compliance algorithms on data sets retrieved from ES) that complete and return only necessary data to the client user interface, via api, in less than 50ms.

This separation also allows you to roll out different front-end interfaces with the same single functional backend codebase - (clients for web (reactjs), mobile app (flutter, native, react native), kiosks, watches, smart device, voice assistants, etc.)

This is why "decoupled" and "headless" content management systems are getting so popular too.

/r/Firebase Thread