Server-side logic implementation with Firebase as Parse.com alternative

I used to work with parse.com but now I need to switch to a different platform. I’m wondering what’s the best approach to implement server-side business logic using Firebase.

My main goal is to handle data validation on the server and execute certain triggers when specific events happen. I don’t want any business logic running on the client side for security reasons.

Here’s my current plan:

  1. Set up a Node.js application with Express framework
  2. Build custom middleware functions for business logic processing
  3. Make HTTP requests from my mobile app to trigger these middleware functions
  4. Use Firebase Admin SDK within Node.js to modify database records based on request parameters
  5. Configure Firebase listeners in the client app to react to database changes

Is there a more straightforward method to achieve this? With Parse I could use their cloud functions feature which made everything much easier. I really need the processing to happen server-side rather than in the client application.

Your Express + custom middleware approach will work, but you’re basically rebuilding what Firebase Cloud Functions already does. I migrated from Parse to Firebase two years ago and started down the same path you’re on. Maintaining a separate Node.js server quickly became a pain. Cloud Functions handle server-side execution automatically and work seamlessly with Firestore triggers. You can write functions that fire on document writes, updates, or deletions without dealing with infrastructure. Security’s solid since functions run in Google’s environment with proper auth. For data validation, I’d combine Firestore security rules for basic checks with Cloud Functions for complex business logic. Your mobile app won’t need additional HTTP requests since functions trigger automatically when database operations happen.

firebase cloud functions are a gr8 alternative! they do stuff similar to parse’s cloud functions and work on google’s platform. you can set them up to react when your db changes and manage validation all on the server, no need for express or extra hosting.

Interesting setup! Firebase Functions might be overkill for simple triggers tho. What events are you tryin to catch? Also, are you sticking with Firebase auth or handling that in your Node app?