Rakesh Kumar
Rakesh Kumar

Reputation: 79

Cloud function vs Firebase security rules

I am developing a car rental Android native application. I have setup firebase as backend. A user can book the car by paying. I have saved the prices of cars in the firebase real-time database. The selected car price will be fetched from the database and will be used to generate the final payable amount. I want to make it secure so that no one can manipulate the payable price as the code will be present at the client side and anyone with reverse engineering can do so.

is cloud functions will be suitable for it or firebase security rules will be enough?

Upvotes: 1

Views: 227

Answers (1)

Doug Stevenson
Doug Stevenson

Reputation: 317778

If you want to protect logic from being manipulated on the client app, then you need a backend service with the controlled logic. This is a use case for Cloud Functions. It's difficult to say from what you've given here if security rules will be able to protect the logic. But it's certain that security rules have limitations that are unable to deal with more complex logic requirements.

Upvotes: 1

Related Questions