4

Is there a way to implement logic from Firebase side instead of the client side?

The question is because I want to implement an auto-increment counter when sending messages to Firebase Database, I know that I can use Transactions but sometimes the counter doesn't update properly. That´s why I want to know if there's a way to implement that logic inside Firebase so that it updates the counter as soon as the message arrives to Firebase Database.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Andrey Solera
  • 2,311
  • 2
  • 26
  • 51
  • I'm afraid not. It would be nice something like Parse's Cloud Code. But there isn't so far. – Héctor Sep 06 '16 at 06:06
  • 1
    Not possible. You will have to implement your own App Server, maybe using Google App Engine? – AL. Sep 06 '16 at 06:57

1 Answers1

2

After working with Firebase, I found there is only validation rule is made on the firebase server side, you can't edit your data on the firebase server

If you wish write some business logic on the client side, you need to use the 3 tier architecture

Firebase - A server (like AWS or Google cloud services or etc) - then your client.

sumit matta
  • 744
  • 7
  • 8