One of the most effective ways to reach users in our mobile applications is undoubtedly push notifications. These notifications are a critical tool for drawing users back to the app, announcing new content, or informing them about important updates. But which path should we take to send these notifications? Should we opt for ready-made solutions like Firebase Cloud Messaging (FCM), or build our own infrastructure? In this post, I will delve into these two approaches. Drawing from my own experiences, I will make concrete comparisons on topics such as cost, flexibility, performance, and manageability.
The Importance and Fundamental Principles of Push Notifications
Push notifications are an indispensable feature for every app developer who wants to maintain continuous communication with their users in today's mobile ecosystem. I've seen them significantly increase a user's engagement rate. For instance, a push notification announcing a special discount campaign in an e-commerce app can directly trigger sales by up to 15%. This kind of impact not only informs the user but also directly contributes to the app's economy.
Fundamentally, push notifications consist of two main components: an application server and a messaging service. The application server decides which message to send to which users and transmits this information to the messaging service. The messaging service then receives this request and forwards it to the relevant platform's (iOS or Android) push notification service (Apple Push Notification Service - APNS, Firebase Cloud Messaging - FCM). These services finally deliver the notification to the application on the device. Establishing the correct architecture on both the server side and the messaging service side is crucial for this process to run smoothly.
ℹ️ Key Components
- Application Server: Determines notification content and target audience.
- Messaging Service: Receives requests from the application server and forwards them to platform-specific services.
- Platform Push Service (APNS/FCM): Apple and Google services that deliver notifications to devices.
- Mobile Application: Receives notifications and displays them to the user.
Having understood these fundamental principles, we can now begin to examine a popular solution: Firebase Cloud Messaging.
Firebase Cloud Messaging (FCM): What Ready-Made Solutions Offer
Firebase Cloud Messaging is a powerful service offered by Google that allows sending notifications to mobile and web applications for free. FCM significantly speeds up the development process and works seamlessly on both Android and iOS platforms. I have used FCM countless times in my own projects and for companies I've consulted for, and its ease of use has always impressed me. Especially in the early stages of a project, when we don't want to dedicate time and resources to setting up infrastructure, FCM becomes an excellent option.
One of FCM's biggest advantages is its wide range of features. You can send individual notifications to specific devices, to users subscribed to particular topics, or broadcast to segments. Additionally, features like message scheduling and tracking delivery reports provide great convenience for developers. For example, using FCM's scheduling feature to automatically send notifications at the start time of a campaign eliminates manual intervention. This significantly reduces the operational load.
{
"message": {
"token": "DEVICE_REGISTRATION_TOKEN",
"notification": {
"title": "Özel Teklif!",
"body": "Sadece bu hafta sonuna özel %50 indirim!"
},
"data": {
"url": "https://example.com/campaign/special-offer",
"campaign_id": "SUMMER_SALE_2026"
}
}
}
The data payload offered by FCM allows you to send additional information along with the notification. This enables users to be directed directly to the relevant page or trigger a specific action within the application when they tap on the notification. This flexibility is invaluable for personalizing the user experience. However, this ready-made solution also has some limitations.
Building Your Own Push Notification Infrastructure: Control and Flexibility
While the speed and convenience of ready-made solutions are appealing, sometimes building our own infrastructure can be more sensible. Especially if you have very specific needs, want to optimize costs, or are sensitive about data privacy, developing your own solution offers you more control. In the early days when I was setting up my own system, I realized how much in-depth control I had, especially during the debugging process.
The biggest advantage of building your own infrastructure is that it's entirely under your control. You can define your own notification sending logic, data storage methods, and security policies. For example, you might want to dynamically change the content of notifications sent to a specific user segment based on real-time user behavior. FCM's segmentation features might not be this flexible. With your own system, you can analyze user profiles and send personalized notifications based on their current mood or interests.
One of the features we developed in a production ERP system was to address operators delaying their shift-end reports. To solve this, we set up a mechanism that sent SMS and push notifications 15 minutes before the end of the shift.
# A simple example for a custom notification service (with Node.js)
curl -X POST \
https://your-custom-notification-service.com/send \
-H 'Content-Type: application/json' \
-d '{
"userId": "user-12345",
"message": {
"title": "Vardiya Sonu Raporu",
"body": "Vardiya bitimine 15 dakika kaldı. Lütfen raporunuzu tamamlayın."
},
"platform": "android"
}'
Such a custom solution not only perfectly aligned with our business workflows but also increased operational efficiency. However, this control comes at a cost: development and maintenance expenses.
Cost Analysis: FCM vs. Your Own Solution?
Cost is one of the most critical factors when choosing a push notification infrastructure. Firebase Cloud Messaging is free for most use cases. However, this free tier is subject to certain limits. For example, for very high-volume notification sends or advanced analytics features, you might need to upgrade to paid plans. For large-scale applications sending millions of notifications annually, these costs can become significant over time.
When building your own infrastructure, the initial cost might be higher. Server infrastructure, database, development time, and maintenance items increase the overall cost. However, in the long run and for high volumes, your own solution might become more economical. For instance, if you build your own notification system with a simple Redis-based message queue and a few Go services, your monthly server cost might not exceed a few hundred dollars. This is often much more affordable than FCM's paid plans in a scenario involving millions of notifications.
⚠️ Cost Optimization Tips
- FCM Free Limits: Thoroughly review FCM's daily notification sending limits and features.
- Custom Infrastructure Costs: Calculate server, database, traffic, and development time costs together.
- Volume-Based Comparison: Compare costs based on your application's expected notification volume.
In summary, for small to medium-sized projects, FCM generally offers a more cost-effective starting point, while for large-scale projects with specific needs, building your own infrastructure might be more economical in the long run.
Performance and Scalability Comparison
The performance and scalability of push notification systems are vital for the ability to reach millions of users instantly. Firebase Cloud Messaging, running on Google's infrastructure, offers very high performance and scalability. It's designed to support billions of devices and typically delivers notifications with low latency. However, I have observed occasional delays due to network issues in certain regions or temporary high loads on FCM's own services.
When we build our own infrastructure, performance and scalability are entirely our responsibility. By choosing the right architecture (e.g., microservices, message queues, distributed databases), we can achieve high performance and scalability. In an ERP system we developed for a manufacturing company, we needed to deliver order confirmation notifications to operator screens in real-time. In this scenario, using a WebSocket-based communication layer and Redis Pub/Sub, we were able to deliver notifications within milliseconds.
# Simple example of sending a notification with Redis Pub/Sub
redis-cli PUBLISH notifications:user-12345 '{"title": "Yeni Sipariş", "body": "Yeni siparişiniz alındı."}'
This kind of approach provides more control but also requires continuous monitoring and optimization of the infrastructure. For example, paying attention to system administration details like correctly setting cgroup memory limits and optimizing Redis's maxmemory policy against OOM (Out Of Memory) situations is crucial. In our own solution, we managed to reduce the average delivery time of notifications to under 200ms. While this approaches the performance typically offered by FCM, it perfectly matched our specific needs.
Security and Data Privacy: Which Path is More Secure?
Security and data privacy are among the most critical considerations when choosing a push notification infrastructure, especially for applications dealing with sensitive data. Firebase Cloud Messaging adheres to Google's security standards and offers various mechanisms to protect your data. However, your notification content and user data flow through Google's servers. This can raise privacy concerns for some companies. Particularly in regulated industries (finance, healthcare, etc.), this can be a critical factor.
When you build your own infrastructure, you have full control over security and data privacy. You can store your data on your own servers, define your own encryption policies, and tighten access controls. For example, if you want to ensure full compliance with data protection laws like GDPR (General Data Protection Regulation), your own solution offers you greater flexibility. In a financial advisory firm project, when sending notifications related to client portfolios, we achieved full compliance by encrypting all data end-to-end and ensuring that only authorized servers could access this data.
💡 Things to Consider for Security
- Notification Content: NEVER send sensitive information (passwords, national ID numbers, etc.) in push notifications.
- Encryption: Use TLS/SSL to encrypt your data during communication.
- Access Control: Grant notification sending authority only to necessary services.
- In Your Own Solution: Clearly define where you store your data and how you protect it.
From a security perspective, both solutions have their own advantages and disadvantages. If standard security measures are sufficient for you and you trust Google's infrastructure, FCM can be a good option. However, if you have specific security requirements or need full control over your data, building your own infrastructure would be more suitable.
Conclusion: Which Push Notification Solution Is Right For You?
Choosing a push notification infrastructure for mobile applications depends on your project's scale, budget, your technical team's expertise, and your security requirements. Firebase Cloud Messaging is an excellent option for those who want to get started quickly, shorten development time, and generally have standard notification needs. Being free and offering a wide feature set, it can be the first choice for many projects.
However, if you require special integrations, if your notification sending logic is very complex, if you want to manage costs more aggressively, or if you need the highest level of control over data privacy, building your own push notification infrastructure might be a more sensible investment. Although this path means higher development and maintenance costs, it provides you with unique flexibility and control.
In my own projects, I have used both approaches depending on the application's size and specific needs. While FCM was sufficient for a small side product of mine, I had to develop our own notification service for an enterprise ERP system. Ultimately, to make the right decision, it is important to carefully evaluate your project's current status and future goals.








