Cloud Native 15 min read

Inside Tencent’s Open‑Source Microservice Engine: Polaris Mesh & Spring Cloud Tencent

This article explores Tencent’s evolution from monolithic LAMP/MVC stacks to a container‑based microservice architecture, detailing the open‑source Polaris Mesh service mesh, Spring Cloud Tencent framework, and their gateway, naming, and configuration components, while highlighting deployment benefits and practical usage examples.

Refining Core Development Skills
Refining Core Development Skills
Refining Core Development Skills
Inside Tencent’s Open‑Source Microservice Engine: Polaris Mesh & Spring Cloud Tencent

1. Why Adopt Microservices

In 2011 the author joined Tencent when the dominant stacks were LAMP (Linux + Apache + MySQL + PHP) and MVC (Spring + iBatis/Hibernate + Tomcat), both designed for monolithic applications deployed on physical or virtual servers by operations teams.

With the explosion of mobile Internet, the number of services grew, features became more complex, teams expanded, and release frequency increased. The monolithic approach began to show three major problems:

Low deployment efficiency : each service required manual installation and configuration of its runtime environment.

Poor resource utilization : servers were over‑provisioned, yet individual services rarely saturated CPU or memory, leading to idle resources.

High collaboration cost : multiple developers working on the same service caused code conflicts and required coordinated releases and extensive testing.

These issues motivated the shift to microservices, where a large application is split into independent services that can be deployed and released separately. The author cites the example of the Sogou mobile assistant, which was decomposed into services such as recommendation list, update checking, search, precise recommendation, cloud control, and location.

Since 2014 Docker containers have become mainstream, offering lightweight, portable images that encapsulate all dependencies. Containerization paved the way for modern microservice architectures, which saw rapid adoption after 2017, including at Tencent.

2. Tencent’s Microservice Engine

Various Tencent departments experimented with microservices early on. In 2020 Tencent consolidated multiple internal frameworks into a unified microservice platform centered on tPRC. Most services and APIs have now migrated to a container‑based microservice stack.

The overall architecture consists of infrastructure components on the left and a development framework in the middle. The most critical infrastructure pieces are the gateway, the Polaris naming service, and the configuration center, which together form the core of Tencent Cloud Service Engine (TSE) offered to external users.

Microservice architecture diagram
Microservice architecture diagram

2.1 Cloud Gateway

In the monolithic era, traffic was routed by assigning a domain name to a set of backend servers. With thousands of microservices, a single domain per service is no longer feasible, and requirements for routing, monitoring, and configuration become much stronger.

The cloud gateway acts as the unified entry point for all API traffic. It encapsulates backend services, provides unified security, routing, flow control, and monitoring, and dispatches requests to the appropriate service based on the service name.

Gateway routing diagram
Gateway routing diagram

2.2 Service Governance Center (Polaris Mesh)

Polaris Mesh is Tencent’s open‑source service‑registry and discovery solution. Services register their name and address at startup; callers query Polaris via an embedded proxy to obtain the target address.

Polaris supports two typical routing scenarios:

Grouping : services deployed in different data centers or environments (e.g., test, gray) can be routed based on group tags, reducing cross‑datacenter latency.

Load balancing : instances with varying CPU/memory capacities can be selected according to configured weighting rules.

Rate limiting (to prevent “avalanche” failures) is also provided. Two strategies are available: fast‑fail (reject excess requests) and queuing (process requests gradually). Both can be configured easily in Polaris.

Rate limiting illustration
Rate limiting illustration

Beyond routing and rate limiting, Polaris Mesh offers circuit‑breaking, access authentication, observability, and supports multiple SDKs (Java, Go, C++, Node.js, PHP) as well as integration with Spring Cloud, gRPC, service mesh, and Kubernetes.

Polaris Mesh feature overview
Polaris Mesh feature overview

Polaris Mesh’s source code and documentation are hosted at:

https://github.com/polarismesh

2.3 Configuration Center

In a microservice world, configuration files become scattered and hard to manage. A centralized configuration center stores all parameters, feature flags, and dynamic settings, providing a unified API for services to fetch and refresh configurations.

Tencent Cloud TSE supports mainstream solutions such as Zookeeper, Eureka, Nacos, Consul, and Apollo, and adds visual dashboards, logging, monitoring, alerting, and authentication.

Configuration center overview
Configuration center overview

Deployment is one‑click: a high‑availability cluster with multi‑active and persistent storage can be launched without a dedicated ops team.

One‑click deployment UI
One‑click deployment UI

2.4 Development Framework (Spring Cloud Tencent)

Java developers can use the Spring Cloud Tencent framework, which implements the standard Spring Cloud SPI and relies on Polaris for service governance. All components are published to Maven Central, requiring only a dependency declaration.

Repository:

https://github.com/Tencent/spring-cloud-tencent

Spring Cloud Tencent architecture
Spring Cloud Tencent architecture

3. Conclusion

Microservice architectures are now mainstream, but building the underlying infrastructure from scratch incurs high initial cost and operational complexity, especially for small companies or individual developers. Public cloud providers, including Tencent Cloud, offer ready‑made, one‑click solutions for gateways, service discovery, configuration, and observability, making the transition to microservices much smoother.

The author’s experience at Tencent’s Techo Day highlighted the convenience of these cloud‑native tools, noting that the out‑of‑the‑box experience often surpasses internal tooling in usability.

cloud nativemicroservicesservice meshTencent CloudPolaris Meshconfiguration centerSpring Cloud Tencent
Refining Core Development Skills
Written by

Refining Core Development Skills

Fei has over 10 years of development experience at Tencent and Sogou. Through this account, he shares his deep insights on performance.

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.