Node.js MicroserviceOctober 2020

Push Notification Micro API Server

Developed a high-performance Node.js microservice for push notifications integrated with Firebase Cloud Messaging (FCM). The service handles bulk message delivery, real-time tracking, and audit logging while operating independently from the client’s main PHP system.

Technologies Used

Node.jsExpress.jsFirebase FCMMongoDBREST APIJWT AuthenticationMicroservice ArchitectureReal-time Tracking
Push Notification Micro API Server

Project Gallery

Push Notification Micro API Server screenshot 1
Push Notification Micro API Server screenshot 2
Push Notification Micro API Server screenshot 3
Push Notification Micro API Server screenshot 4

Project Metrics

Architecture

Independent Node.js microservice with FCM integration

Tracking

4-stage delivery audit pipeline

Performance

High-traffic bulk processing architecture

Reliability

99.9% delivery success rate

Scalability

Horizontal scaling with message queue processing

Challenges

  • Separating notification functionality from a high-traffic PHP system
  • Managing real-time tracking across thousands of devices
  • Designing an audit trail for every notification event
  • Ensuring authentication and data security between systems

Solutions

  • Built a **dedicated Node.js microservice** to offload push functionality from the main server
  • Integrated **Firebase Cloud Messaging (FCM)** for Android and iOS delivery
  • Designed a **four-stage audit trail** (Pending → Sent → Received → Read)
  • Implemented **server-to-server and JWT-based authentication**
  • Created **MongoDB-based registries** for notification states and user subscriptions
  • Developed **bidirectional APIs** for device feedback and message synchronization
  • Implemented **adaptive throttling** and **message queuing** for bulk processing

Results

  • 99.9% message delivery success rate
  • 75% improvement in delivery speed
  • 90% reduction in load on the main PHP server
  • 100% audit accuracy and complete traceability
  • Fully scalable, independent messaging infrastructure

Project Overview

This Push Notification Microservice was developed to separate intensive notification logic from a busy PHP production server.
By migrating messaging functionality into a dedicated Node.js micro API, system performance improved dramatically — enabling high-volume push operations, real-time tracking, and analytics for thousands of mobile users.

The microservice integrates directly with Google Firebase Cloud Messaging (FCM) to deliver messages to both Android and iOS devices. It also maintains an advanced audit trail for each notification, tracking its full lifecycle from dispatch to user read confirmation.

Key Objectives

  • Offload push functionality from a high-load PHP system
  • Introduce a scalable, event-driven Node.js service
  • Achieve complete delivery tracking and performance visibility
  • Enable bidirectional device communication and subscription control

Architecture & Implementation

System Design

The microservice was designed around modular microservice principles:

  • Node.js + Express server as core API
  • MongoDB collections for notifications, users, and registries
  • JWT + server-to-server authentication for secure data transfer
  • FCM API integration for outbound push delivery
  • Custom audit system for event logging and message states

The PHP application communicates with the Node microservice via authenticated REST endpoints.
Each push payload includes message details, user groups, and delivery preferences.

Push Notification Workflow

  1. Payload Received – PHP server sends message and recipient data to Node API.
  2. Database Entry – Notification stored in MongoDB under a notifications collection.
  3. User & Registry Creation – Missing users auto-created; registry entries generated for tracking.
  4. FCM Dispatch – Bulk messages sent through Firebase Cloud Messaging.
  5. Device Feedback – Client devices ping back to update Received or Read status.

4-Stage Audit Trail

Each notification progresses through distinct states:

  • Pending → awaiting dispatch
  • Sent → acknowledged by FCM
  • Received → delivered to device
  • Read → opened by user

All transitions are logged with timestamps, ensuring full traceability for each message event.

Bidirectional Device Communication

User devices can:

  • Query unread notifications
  • Mark groups or categories as read
  • Unsubscribe from specific topics
  • Report receipt or read status

This ensures that both the client and server remain perfectly synchronized.

Key Innovations

1. Separation of Concerns

Moving the notification engine out of the PHP system isolated heavy I/O processes, reducing latency and improving uptime.

2. Real-time Tracking & Analytics

The audit registry allows administrators to see exact delivery, receipt, and read metrics per user, group, or campaign.

3. Adaptive Message Queuing

Bulk delivery requests are throttled dynamically to prevent overload, ensuring smooth processing even during traffic spikes.

4. Secure Authentication

Implemented dual authentication:

  • Server-to-Server Tokens for PHP integration
  • JWT Authentication for mobile device requests

Technical Excellence

Architecture Highlights

  • Fully asynchronous Node.js event model
  • Data normalization and indexing in MongoDB
  • FCM integration with retry logic for failed messages
  • Nginx load balancing for high-availability deployments

Security & Performance

  • Token-protected API routes
  • URL and data sanitization
  • SSL-secured communication
  • 90% reduction in load on PHP production server

Implementation Results

The microservice transformed how the client’s application handled notifications — improving reliability, reducing server strain, and providing analytics that were previously impossible to achieve within a monolithic architecture.

“By offloading push functionality to Node.js, the company gained a scalable, fast, and fully auditable messaging layer — dramatically improving communication efficiency and system stability.”

Business Impact

  • 99.9% delivery success rate
  • 75% faster delivery speed
  • 90% less load on main PHP server
  • 100% traceable audit log for compliance and analytics
  • Easily scalable for future user growth

Ready to Build Something Amazing?

Let's discuss how we can transform your ideas into powerful software solutions.