Content Platform Architecture Behind Bilibili Columns: Publishing, Real-Time Interaction, and Multi-Device Sync

    This article examines the system architecture behind a UGC content platform, using Bilibili Columns as a case study. It focuses on five areas: content publishing and moderation, content distribution and caching, real-time interaction, user identity and premium services, and multi-device synchronization. The discussion covers asynchronous publishing with message queues, Cache Aside and multi-level read paths, a push-pull model for bullet comments, distributed ID generation for comment floors, JWT-based authentication, asynchronous behavior event collection, version-based incremental sync, offline fault tolerance, and stability practices such as availability, consistency, and observability. Developers will gain a structured view of how front-end features map to distributed backend design.

    Introduction: From Content Entry Point to Technical Foundation

    In today’s internet product landscape, content platforms built around video, text-and-image content, and live streaming have become primary venues for information consumption. As an important part of Bilibili’s text-and-image content ecosystem, Bilibili Columns presents users with a content aggregation page that brings together entries such as membership commerce, events, trending shows, premium membership, and activity feeds. From a system architecture perspective, however, this page is backed by a highly complex engineering system: content production and moderation, recommendation and distribution, real-time interaction message delivery, user identity and permission verification, and multi-device synchronization and state consistency. Each link corresponds to clear technical choices and architectural decisions.

    This article moves beyond the visible functions of a specific product and extracts common technical problems in content platform construction. Following the thread of “content production—content distribution—real-time interaction—user system—multi-device sync,” it systematically explains technical architecture practices for modern UGC content platforms, helping developers build a complete understanding from functional interfaces to underlying system design.

    1. Architecture Design of the Content Publishing Pipeline

    1.1 Asynchronous Processing for Content Production and Moderation

    The first core pipeline of a content platform is publishing. When a creator finishes an article in the Column editor and clicks “Publish,” this action is far more than a simple database write. A complete publishing operation requires content format parsing, sensitive-information filtering, transcoding and compression of multimedia resources such as images and videos, copyright compliance checks, and manual or machine review. If all these operations were completed within a synchronous request, user waiting time would rise sharply, and under high-concurrency publishing scenarios, the database could easily be overwhelmed.

    Therefore, mainstream architectures generally adopt an asynchronous design. After the client submits article content to the access layer, the system immediately returns a status such as “published successfully, under review.” At the same time, it writes article metadata to a message queue, such as a general-purpose message middleware. Backend moderation consumer services pull tasks and execute text moderation, image moderation for explicit content, plagiarism comparison, and other operations in sequence. Moderation results are written back to the database through callbacks or status polling, and the front-end page finally shows “published” or “review failed.”

    1. // Simplified asynchronous publishing example
    2. @PostMapping("/api/article/publish")
    3. public ResponseEntity<?> publish(@RequestBody ArticleDraft draft) {
    4. // 1. Basic parameter validation
    5. validate(draft);
    6. // 2. Generate article ID and write pending-review status
    7. Long articleId = articleService.createPendingArticle(draft);
    8. // 3. Send asynchronous moderation message
    9. messageQueue.send(new AuditMessage(articleId, draft.getContent()));
    10. // 4. Return immediately without blocking
    11. return ResponseEntity.accepted().body(Map.of("articleId", articleId, "status", "PENDING"));
    12. }

    The core value of this design is that it removes time-consuming operations from the main pipeline, keeping the publishing API response time at the millisecond level. At the same time, the message queue’s peak-shaving capability smooths content publishing spikes during holidays or popular events.

    1.2 Multi-Level Caching and Read Acceleration for Hot Content

    On the content read side, information display on Column pages has a typical read-heavy, write-light pattern. Hot articles, event information, and discussion threads around trending series often generate tens of thousands or even hundreds of thousands of concurrent read requests within a short period. If all requests hit the database directly, even with a good index structure, connection bottlenecks and disk I/O limits would cause latency to spike.

    A common industry strategy is to build a four-level read path: client cache, edge CDN, distributed cache, and database. The static framework of an article detail page—title, author, and cover image—can be rendered as a static page and cached on CDN nodes. Dynamic data such as likes, comments, and views can be stored in distributed caches such as Redis, using counters or approximate counting algorithms to meet high-frequency read demand. Only when the cache misses does the request penetrate to the database layer.

    It is important to note that cache consistency is a part that is very prone to problems in practice. For Column content, the safest strategy is the Cache Aside pattern: read requests first query the cache, and on a miss, read from the database and backfill the cache; write requests first update the database and then delete the corresponding cache key. By setting reasonable expiration times—for example, 5 minutes for hot articles and 30 minutes for ordinary articles—it is possible to strike a good balance between data consistency and read performance.

    2. Technical Analysis of the Real-Time Interaction System

    Bullet comments and comments are the most recognizable interaction forms in the Bilibili ecosystem. For developers studying content platforms from a technical perspective, the design of real-time interaction systems is highly representative. It combines multiple technical challenges, including long-connection management, message delivery, ordering guarantees, and high-concurrency writes.

    2.1 A Push-Pull Hybrid Model for Bullet Comments and Comments

    In the bullet-comment scenario, a comment is generated on the sender side and must appear on the screens of all users watching the same video, with an end-to-end latency requirement usually below 500 milliseconds. A pure pull model, in which clients poll periodically, is difficult to meet this latency requirement, while a pure push model creates enormous connection and bandwidth pressure on servers in large live rooms with tens of thousands of viewers or on popular videos.

    A mature solution today is a hybrid push-pull model. When a user sends a bullet comment, the message enters a distributed message queue through the access layer. A real-time computing component, such as one based on a stream processing framework, performs window aggregation on messages and writes bullet comments into time-series windowed storage according to the current video playback progress. While playing the video, the client receives real-time incremental bullet comments through a WebSocket long connection and also periodically pulls, for example every 2 seconds, batch data of historical bullet comments near the current playback progress. This ensures real-time performance while avoiding the resource waste caused by full push.

    2.2 Comment Floor Numbers and Ordering Guarantees

    Unlike the transient nature of bullet comments, comments emphasize structure and persistence. The comment section of a hot article often shows thousands of threaded comment floors. In a distributed database environment, guaranteeing strictly increasing floor numbers is a typical distributed ID generation problem. Using database auto-increment IDs works in a single-database scenario but fails after sharding. A more reliable solution is to use an independent ID generator service, such as one based on the Snowflake algorithm or database segment mode. The ID generator uniformly allocates globally unique, trend-increasing comment IDs, which serve as the basis for floor ordering.

    In addition, to ensure real-time visibility of comments, the write path usually adopts a cache-first, asynchronous persistence strategy: new comments are first appended to a Redis List structure, and the front end can immediately see new comments through subscriptions or lightweight polling. A background thread then asynchronously writes comments to persistent storage in batches. In extreme cases, such as a process crash when Redis data has not been persisted, this approach may lose a small amount of data. With a compensation mechanism based on message queues, however, substantial loss of comment data can be avoided to the greatest extent possible.

    3. Underlying Support for the User System and Membership Services

    Entries such as “Login,” “Premium Membership,” “Activity Feed,” and “Favorites” on the page are essentially manifestations of User Center capabilities. The architecture design of such systems directly affects account security and the stability of business growth.

    3.1 Unified Identity Authentication and Single Sign-On

    Modern content platforms usually operate multiple entry points at the same time, including web, mobile app, and mini-program clients. To ensure that a user’s login takes effect across all clients, the backend needs to build a unified authentication center. A mainstream solution is a stateless authentication system based on JWT (JSON Web Token): after a user logs in successfully, the authentication center issues a JWT carrying the user ID, role, and expiration time. Business microservices verify the token signature to identify the user, without querying session state from the database on every request.

    For value-added services such as premium membership, permission control needs to be refined to the resource level. For example, for certain high-definition videos or exclusive content, the gateway layer needs to parse the membership level field in the JWT and perform pre-authorization. For non-members, the system can return a specific status code, and the front end uses it to display a subscription guidance page.

    3.2 Asynchronous Collection of User Behavior and Feature Computation

    The activity feed feature is essentially an aggregated display of user behavior sequences. When a user follows a creator or likes an article, the system needs to record these behaviors and compute the user’s information feed based on the social relationship graph. In large-scale scenarios, every like, follow, and favorite is an event write. A common practice is to build an independent behavior collection pipeline: events are sent to a message queue through SDK or server-side event tracking, and stream computing tasks such as Flink perform real-time cleaning and deduplication and update the user relationship graph storage, such as a graph database or wide table, and the feature store.

    The notable advantage of this architecture is the decoupling of behavior data from core business data. Even if the behavior collection pipeline experiences a brief delay, it does not affect core login and content reading functions. At the same time, cleaned behavior data can directly serve recommendation algorithms, such as “recommended for you,” and operational analytics reports.

    4. Multi-Device Sync and Data Consistency Guarantees

    Experiences such as “multi-device playback record sync” and “favorites cloud sync” depend on a reliable cross-device data synchronization mechanism. The core difficulty here is not just data storage, but how to ensure eventual consistency of user data under complex conditions such as weak networks, offline scenarios, and concurrent conflicts.

    4.1 Version-Based Incremental Synchronization

    For data dimensioned by “user-object,” such as playback progress and favorites lists, incremental synchronization is recommended over full synchronization. The client maintains a local data copy. For each operation, such as updating playback progress, it generates a local operation record with a timestamp and version number (Vector Clock). When the network recovers, the client uploads incremental operation records to the sync server. The server merges the operation records and resolves conflicts, usually using last-write-wins or business-rule-based merging, and then returns the latest merged version of the data.

    The advantages of this approach are twofold: first, it reduces the payload size of each synchronization and improves the success rate under weak network conditions; second, the version number mechanism avoids the computational overhead of full data comparison. In engineering implementation, synchronization APIs should be designed as idempotent operations to prevent duplicate data caused by retry requests after network timeouts.

    4.2 Fault-Tolerant Design for Offline Scenarios

    Considering that users may read Columns without a network connection, such as cached articles, the client needs local temporary storage capability for offline operations. In the design, the client database, such as SQLite, stores a queue of operations awaiting synchronization. All write operations are first stored locally and then uploaded in order after the network status recovers. For operations that fail to upload, an exponential backoff strategy should be used for a limited number of retries. If failures still occur, the user must be clearly notified to avoid silent data loss.

    5. Stability Guarantees and Outlook for Content Platforms

    From an engineering management perspective, the architecture of a content platform is not built overnight. It follows an evolution path from monolithic application to vertical splitting, microservices, and platformization. In the early stage, a Column feature may be just one module in an overall web application. As traffic grows and features increase, capabilities such as content moderation, user center, and message delivery gradually become independent microservices and are governed through a service mesh.

    For developers, building such systems requires particular attention to three core metrics: availability, ensured through multi-data-center deployment and circuit breaking and degradation to support a four-nines or higher SLA; consistency, achieved through reasonable trade-offs between distributed transactions and eventual consistency solutions to balance data safety and user experience; and observability, built through comprehensive logging, metrics, and distributed tracing systems to quickly locate cross-system anomalies.

    Conclusion

    Content platforms represented by Bilibili Columns concentrate the capabilities of internet backend engineering. From a simple article publish action to the millisecond-level display of a bullet comment, and then to cross-device progress synchronization, every seemingly lightweight user operation is backed by the coordinated work of multiple technologies, including distributed system design principles, caching systems, message queues, and real-time computing. The breakdown in this article is intended to provide developers who are planning or building content platforms with a clear technical path reference, helping them avoid common design pitfalls and build modern content systems with high concurrency, high availability, and a smooth user experience.