Security rules and Cloud Functions are both ways to protect data in Cloud Firestore . It’s usually better to lean more heavily on security rules, as much as they can do what you require. But they still combine very well with Cloud Functions to establish robust and complex security for you app.