NGW: Node Gateway Architecture for Serverless Frontend Services

NGW (Node Gateway) is a Node.js‑based frontend access layer that sits between a unified gateway and business services, providing dynamic request routing, Redis‑driven configuration, a Tapable plugin system, and containerized CI/CD to enable serverless BFF/SFF architectures with rapid builds, high reliability, and dramatically reduced deployment effort across multiple Tencent Cloud projects.

Tencent Cloud Developer
Tencent Cloud Developer
Tencent Cloud Developer
NGW: Node Gateway Architecture for Serverless Frontend Services

This article introduces NGW (Node Gateway), a Node.js-based frontend access layer developed by IVWEB team. NGW serves as an intermediate layer between the unified gateway and actual business services, enabling dynamic request distribution and supporting various backend architectures including static pages, BFF (Backend For Frontend), and SFF (Serverless For Frontend).

The article begins by explaining key concepts: NGW as a frontend business access layer, BFF as backend services for frontend, and SFF as the evolution of BFF architecture into serverless. It then describes how NOW Live team is transitioning from BFF to SFF architecture using NGW combined with Tencent Cloud's Serverless Cloud Function (SCF) product.

The benefits of SFF architecture are highlighted, particularly for frontend developers: no need to manage servers, zero maintenance, automatic scaling, and 80% reduction in deployment workload. The article uses a story about a developer named Aite to illustrate the challenges of traditional deployment processes and how NGW addresses these issues.

NGW's architecture consists of three main modules: the distribution layer for business routing, NGW-Service layer for configuration management and serverless service deployment, and NGW Platform for management and logging. The system uses containerization with Orange-CI and TKE for building and deploying services, achieving 20-second build times and 10MB image sizes.

Key features include dynamic configuration distribution through Redis, plugin system based on Tapable for extending functionality (like gray release and whitelisting), and integration with TSW for real-time log viewing. The article demonstrates how NGW enables serverless SSR (Server-Side Rendering) with 99.99% success rate and has been deployed in multiple projects including NOW Live, QQ Nearby, and Browser Live.

Future plans include deeper collaboration with Tencent Cloud SCF, React chunked streaming rendering, and integration with Aegis frontend monitoring system. The article concludes with current deployment statistics showing 3+ nines reliability and over 85% unit test coverage.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

ServerlessScalabilityDevOpsNode.jscontainerizationFrontend ArchitectureBFFNGWSFF
Tencent Cloud Developer
Written by

Tencent Cloud Developer

Official Tencent Cloud community account that brings together developers, shares practical tech insights, and fosters an influential tech exchange community.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.