A Content Platform Article & Column System: Architecture Design and Practical Guide
Behind a familiar "column" page on a content platform lies a full-scale C-end content community system. This guide abstracts and reconstructs its core capabilities—content delivery, identity and entitlements, interaction, and cross-device sync—and lays out an actionable architecture covering login and secure sessions, multi-device progress sync, comments and danmaku, membership-gated content, multi-level caching, observability, and security compliance, along with a phased rollout roadmap and a pre-launch checklist.
1. Introduction: Reading the Full Picture from a Single Column Page
On mainstream video content platforms, alongside playback-centered video there is usually a “column” channel focused on long-form articles, image-and-text posts, and serialized series. To an ordinary user, a column page is just navigation, a login prompt, a membership entry, messages, activity feeds, and favorites. To a developer, it sits on top of a classic C-end content community system. Its capability requirements fall into four areas:
- Content consumption: column articles, image-and-text posts, videos, and series need stable storage, delivery, and search.
- Identity and entitlements: registration and login, paid membership, resolution tiers, and notifications form the foundation of the user system.
- Interaction and accumulation: comments, danmaku (bullet comments), likes, favorites, and the activity feed built from follow relationships are what drive community engagement.
- Cross-device experience: web, mobile, and desktop clients must sync playback position, reading progress, and personalized data.
The login prompt on these pages also reveals a key design principle: core content is open to anonymous users to preserve discoverability and shareability, while personalized capabilities require login—cross-device progress sync, posting comments and danmaku, favoriting, and following. Content visibility is thus decoupled from user identity.
This article takes the “content platform article & column system” as its subject, abstracts and rebuilds the capabilities above, and presents an architecture and engineering practices you can put straight into production.
2. Mapping Typical Features to Technical Problems and the Overall Architecture
2.1 From UI elements to technical problems
Each feature entry on the page maps to a concrete technical problem:
| UI element | User need | Core technical problem |
|---|---|---|
| Column and trending content | Browse and discover | Content model, recommendation recall, first-screen rendering |
| Login, registration | Establish identity | Account security, session management, risk control |
| Messages, activity feed | Reach and social | Event notification, follow graph, feed generation |
| Favorites | Accumulate and revisit | Relationship storage, counter consistency |
| Comments, danmaku | Express and resonate | Paginated queries, real-time push, content safety |
| Multi-device sync | Resume across devices | Progress reporting, conflict merging, idempotency |
| Membership, resolution | Differentiated entitlements | Permission checks, multi-bitrate media handling |
2.2 Layered architecture
The system is split into services by responsibility to avoid the tight coupling and scaling bottlenecks of a single monolith:
Clients (Web / Mobile / Desktop)│ HTTPS┌───────▼────────────────────────────────────┐│ Edge layer: CDN + API gateway ││ (static acceleration, TLS termination, ││ auth, rate limiting) │├────────────────────────────────────────────┤│ Business services ││ User Column Interaction Notification││ Entitlement Search Recommendation │├────────────────────────────────────────────┤│ Middleware: cache message queue search ││ index long-connection gateway │├────────────────────────────────────────────┤│ Storage: relational DB object storage ││ analytical storage │├────────────────────────────────────────────┤│ Ops support: logging monitoring & alerting││ config center │└────────────────────────────────────────────┘
Responsibilities by layer:
- Edge layer: the CDN handles nearby distribution of static assets and origin acceleration; the API gateway performs TLS termination, identity verification, rate limiting, and routing as a single entry point—the first line of defense.
- Business services: split by domain. The column service manages the content lifecycle, the interaction service handles comments, danmaku, and favorites, the user service owns accounts and sessions, and the entitlement service decides membership status and content access. Services communicate over internal APIs or a message queue.
- Middleware: the cache handles read-heavy hotspots, counters, and progress; the message queue smooths traffic spikes and decouples work asynchronously; the search index powers keyword retrieval; the long-connection gateway supports real-time push for danmaku, messages, and similar features.
- Storage: the relational database holds transactional core data such as accounts, columns, and interaction relationships; object storage holds covers, illustrations, and video files; analytical storage supports behavior analysis and recommendation training.
Business services are deployed as containers on a container platform, with monitoring/alerting and logging to enable elastic scaling and end-to-end observability.
3. Identity System: From “Click to Log In” to Secure Sessions
Login and registration are the entry point to the whole community—and the most concentrated area of security risk. Once an account is compromised, an attacker can mass-post spam comments and danmaku and pollute the community.
3.1 Accounts and credential security
- Phone registration: the phone number serves both as the account identifier and as a means of password recovery. Store it encrypted or as a salted hash, and mask it on display (e.g., 138**0000). Verification codes need a validity window, an attempt limit, and rate limiting, and SMS sending frequency must be capped to prevent SMS bombing.
- Password storage: use a salted, multi-round, brute-force-resistant hashing algorithm; never store plaintext or use reversible encryption. After a system upgrade, you can transparently upgrade a user to a stronger algorithm when they next log in successfully.
- Third-party quick login: bind accounts using a composite key of “platform-unique ID + login channel” so that same-name accounts from different channels are not wrongly merged.
- Login risk control: after consecutive failures for the same account cross a threshold, trigger a CAPTCHA or temporary lockout; logins from unfamiliar locations or new devices can require a second factor.
# Pseudocode: login flow and risk-control points (illustrative, not any specific product API)def login(phone: str, password: str, device: dict):# 1) Verify code: single-use, invalidated immediately after checkingif not verify_sms_code(phone, device.request_code):raise AuthError("Incorrect verification code")# 2) Rate limiting: throttle the same phone number and same IP within a time windowkey = f"login:limit:{phone}"if cache.incr(key, ttl=60) > MAX_ATTEMPTS_PER_MINUTE:raise TooManyRequests()# 3) Credential comparison: brute-force-resistant hash + constant-time comparisonuser = account_db.find_by_phone(phone)if user is None or not verify_password(password, user.password_hash):record_login_failure(phone, device) # accumulate failures, trigger risk controlraise AuthError("Incorrect account or password")# 4) After location/new-device checks pass, issue an access token and refresh token# The refresh token stores only a digest and is bound to the device IDreturn issue_tokens(user.id, device.id, scope=["read", "comment", "danmaku"])
3.2 Sessions: short-lived access token + rotating refresh token
The recommended approach is a dual-token scheme of “short-lived access token + long-lived refresh token”:
- On successful login, issue an access token (validity usually on the order of minutes) and a refresh token (validity ranging from days to weeks depending on product policy), storing only the refresh token’s digest.
- Business requests validate the access token’s signature, expiry, and issuer at the API gateway.
- Once the access token expires, the client exchanges the refresh token for a new token pair. The old refresh token is immediately invalidated (rotation), which guards against token replay.
- If an invalidated old refresh token is used again, it is treated as a token leak: revoke that device’s session and force re-login.
For the web client, carry the tokens in a cookie with the HttpOnly and Secure attributes and an appropriate SameSite policy so front-end scripts cannot read them; combine this with CSRF protection, such as validating a custom request header or using a double-submit token.
3.3 Anonymous vs. logged-in: tiered visibility and progressive enhancement
- Column article bodies and video playback URLs are open to anonymous users, preserving SEO indexing and the reach of social sharing.
- Posting comments, sending danmaku, favoriting, and cross-device sync require login. The page still renders fine while logged out and only prompts for login when the user actively triggers an interaction—this is “progressive enhancement.”
- Decouple permission checks from content delivery: the column service returns content and resource identifiers, while the entitlement service dynamically signs the actual playback URL based on the user’s tier (free vs. paid member), content type, and resolution, with a short URL validity to prevent hotlinking.
- The gateway performs unified token validation and injects user identity, so downstream services read the user ID from a trusted context instead of each reimplementing authentication.
4. Multi-Device Sync: “Pick Up Where You Left Off on Another Device”
Syncing playback records across devices sounds simple but involves three real challenges: device identification, idempotent reporting, and cross-device conflict merging.
4.1 Data model and merge strategy
On first use, each device generates a stable device ID and persists it locally as one reporting dimension. Progress is stored at the granularity of “user + content + device”:
| Field | Type | Description |
|---|---|---|
| user_id | bigint | User identifier |
| content_id | bigint | Content identifier |
| device_id | varchar | Device identifier |
| progress | decimal | Progress ratio (0–1), derivable from position and total duration |
| position | bigint | Position offset: milliseconds for video; scroll percentage or anchor for long-form |
| duration | bigint | Total content duration or word count, used for normalization |
| version | bigint | Locally monotonic version number, used for conflict merging |
| updated_at | timestamp | Server receive time |
The reporting endpoint should follow three principles:
- Merge-style writes: use upsert semantics so each “user + content + device” keeps a single row, avoiding duplicate inserts.
- Conditional updates: use the version number for optimistic concurrency control, updating only when the incoming version is not lower than the stored one, so out-of-order old versions don’t overwrite newer progress.
- Client throttling: report every few seconds during playback/reading and on key events (pause, switch episode, exit, page hidden), keeping progress fresh while controlling request volume.
-- Illustration: merge a progress record with a version-based conditional updateMERGE INTO user_progress AS tUSING (VALUES (:user_id, :content_id, :device_id, :position, :version)) AS s(user_id, content_id, device_id, position, version)ON t.user_id = s.user_idAND t.content_id = s.content_idAND t.device_id = s.device_idWHEN MATCHED AND s.version >= t.version THENUPDATE SET position = s.position, version = s.version, updated_at = CURRENT_TIMESTAMPWHEN NOT MATCHED THENINSERT (user_id, content_id, device_id, position, version, updated_at)VALUES (s.user_id, s.content_id, s.device_id, s.position, s.version, CURRENT_TIMESTAMP);
4.2 Cross-device merging and resume playback
A user who watched halfway on their phone should land at the last position when they open the web client. This requires the “continue watching” list to:
- Aggregate across devices: when multiple device records exist for the same content, pick the one with the highest version that was most recently updated as the resume position; product policy may also prefer the current device’s record.
- Handle fallbacks: when a user clears local data or reinstalls, the device ID changes, but aggregating at the user level still restores progress.
- Degrade gracefully: if content is finished, the source is delisted, or a content update shifts the timeline, run progress-normalization checks and fall back to the start or the nearest chapter on anomalies.
- Respect privacy: the sync toggle follows the platform privacy policy by default and can be turned off by the user.
4.3 Storage and read optimization
- Progress is a classic case of small fields with high update frequency. Put hot data in the cache and batch-persist asynchronously to reduce write pressure on the relational database.
- The “continue watching” entry needs cross-device aggregation sorted by update time, so use analytical storage or a search engine to build a user-level aggregated view.
- A logged-in user can recover progress from the cloud even after clearing local records; anonymous users keep only local progress and can migrate it with one click after login, reducing the experience gap before registration.
5. Interaction: Comments, Danmaku, and Favorites
Interaction is the soul of a community—and the place most likely to be overwhelmed by a traffic surge. When hot content goes live, comments, danmaku, and likes flood in. The core approach: multi-level caching on the read path and asynchronous peak-shaving on the write path.
5.1 Comments: tree structure and cursor pagination
Comments use a two-level “top-level + nested reply” structure. Going too deep sharply increases query and rendering cost and hurts readability. A suggested data model:
| Table | Key fields | Description |
|---|---|---|
| comment | id, content_id, parent_id, root_id, user_id, body, status, created_at | parent_id is the direct parent; root_id points to the owning top-level comment |
| comment_hot | content_id, comment_id, rank_score | Hot comment ranking, updated asynchronously |
Query strategy:
- Compute a hotness score asynchronously on posting/interaction (factoring in likes, replies, recency, and author weight), write it to a dedicated ranking table, and refresh it periodically with a scheduled job.
- Use cursor pagination rather than offset pagination for the latest comments. Offset pagination produces duplicates or gaps while data keeps being inserted, and the larger the offset, the more rows the database scans.
- Include a summary of first-screen replies in the same fetch to cut the round trip of “open a nested thread and request again.”
-- Illustration: cursor pagination of latest comments by (created_at, id)SELECT c.id, c.parent_id, c.root_id, c.user_id, c.body, c.created_atFROM comment cWHERE c.content_id = :content_idAND c.status = 'PUBLISHED' -- return only approved commentsAND (c.created_at, c.id) < (:last_created_at, :last_id)ORDER BY c.created_at DESC, c.id DESCLIMIT :page_size;
Comment posting runs an asynchronous pipeline of “ingest → moderate → persist → notify”: after the edge layer validates the token and enforces rate limits, it writes the message to a queue and immediately returns “submitted,” while the moderation and storage services consume it asynchronously. The user sees a “pending” placeholder after submitting—instant feedback, with the ability to block non-compliant content in time.
5.2 Danmaku: time-point binding and real-time distribution
The key difference between danmaku and comments is that danmaku are bound to a playback/reading time point, are highly real-time, and consist of massive short texts. Design points:
- Retrieve by time window: viewers usually care only about danmaku near the current moment (a few seconds before to a few seconds after). Partition storage by “content + time segment” so queries read only a small slice.
- Sampling and anti-spam: danmaku that are too dense at a single point obscure the screen, so dedupe by sender, merge similar texts, and sample for display; cap each user’s send frequency and repeated content.
- Real-time distribution: for live or hot content, use the long-connection gateway to push danmaku, with the server aggregating and downsampling per content to avoid a spike saturating bandwidth.
- Lifecycle management: as historical danmaku lose traffic over time, archive them to cheaper storage and load cold data on demand.
- Context awareness: use surrounding danmaku to signal “where you are,” e.g., “high energy ahead” or “this is the iconic moment,” enhancing immersion.
5.3 Favorites and interaction counters
Counts for likes, coins, favorites, and shares are essentially a “mass of users × single object” high-concurrency accumulation scenario, so avoid hitting the database on every action:
- Run idempotency checks at the user and content dimensions first to prevent duplicate submissions inflating the numbers.
- Increment/decrement counters atomically in the cache and batch write them back to the database asynchronously via a message queue, achieving eventual consistency.
- Display approximate values externally (e.g., “12k”), matching user expectations and easing exact-counting pressure.
- A scheduled reconciliation job compares cache and database, correcting drift from lost messages or duplicate consumption.
User-content relationships (follows, favorites) follow the same idea: relationship tables use a soft-delete flag instead of hard deletes for easier statistics and recovery; a user’s favorites list is stored in reverse chronological order to power a “recently favorited” shortcut.
5.4 Follow activity feeds and notifications
The activity feed is the collection of updates from followed accounts, generated in two main ways:
- Pull model: aggregate a followed account’s recent content on request—simple, but expensive when the user follows many accounts.
- Push model: write content into followers’ inboxes on publish—fast to read, but high-profile accounts cause “write amplification.”
In practice, use a “push-pull hybrid”: ordinary creators use push; when a large account has too many followers, fall back to pull and merge on read.
Notifications cover comment replies, likes, system announcements, and more. Driven by business events, they are decoupled through a message queue and handled centrally by the notification service, with unified management of delivery channels such as in-app messages and push.
6. Column Content: Publishing, Rendering, and Membership Entitlements
6.1 Content model and lifecycle
Column content typically includes title, summary, cover, body, tags, author, visibility scope (free / members-only), and publish time. The body is authored in rich text or lightweight markup, stored in a structured form, and rendered to HTML at request time for easy theme changes and multi-device adaptation.
The content lifecycle can be abstracted as the following state machine:
Draft ──submit──> Pending review ──approve──> Published ──unpublish──> Delisted│ ▲└──reject──> Draft │edit & revise ─────────────┘
- Autosave: the editor periodically writes the draft to object storage with a version, preventing data loss from an accidental page close.
- Scheduled publish: articles past their publish time but not yet published are picked up by a scheduled job that triggers the publish flow, avoiding reliance on an in-process timer inside an app instance.
- Edit history: retain historical versions with rollback, and require re-review for major revisions.
- Deletion policy: delisting is not deletion; deletes use a soft-delete flag to satisfy audit and appeals.
6.2 Rich-text sanitization
User-submitted rich text must be sanitized against a whitelist, or an attacker can inject scripts for stored XSS that harms every reader of the article:
# Pseudocode: rich-text whitelist sanitizationALLOWED_TAGS = {"p", "h2", "h3", "strong", "em", "ul", "ol", "li","blockquote", "pre", "code", "img", "a", "br"}ALLOWED_ATTRS = {"a": {"href", "title", "rel"},"img": {"src", "alt", "width", "height"}}def sanitize_html(raw: str) -> str:tree = parse_html(raw)for node in walk(tree):if node.tag not in ALLOWED_TAGS:node.unwrap() # strip any unsupported tagfor attr in list(node.attrs):if attr not in ALLOWED_ATTRS.get(node.tag, set()):del node.attrs[attr] # drop any non-whitelisted attributeif node.tag == "a":# Allow only http/https and isolate dangerous attributes like window.openernode.attrs["href"] = normalize_url(node.attrs["href"])node.attrs["rel"] = "noopener noreferrer"return serialize(tree)
After images are uploaded to object storage, validate type and size to prevent their use for hosting violating content; also serve user-uploaded assets on the CDN under a separate domain with a Content-Disposition response header to reduce abuse risk.
6.3 Membership entitlements and content tiering
Members-only content bodies can be handled as “partial visibility + structured metadata”:
- Anonymous and free users get the article summary, section headings, and table of contents—useful for SEO indexing and for deciding whether it’s worth subscribing.
- Paid members receive the full body and high-definition media after passing a permission check, with short-lived playback/reading URLs.
When a membership expires, is refunded, or an account is banned, the entitlement service must sync status promptly to prevent unauthorized “still readable after expiry” access.
7. First-Screen Performance, Capacity, and Stability
7.1 Core performance metrics
A column page is a classic “read-heavy, write-light, SEO-sensitive” page, and the primary optimization goal is first-screen experience. Reference the widely used Core Web Vitals:
- LCP (Largest Contentful Paint): how quickly the main content (title, first screen of the body) appears.
- INP (Interaction to Next Paint): responsiveness to clicks and input; it replaced FID as the core responsiveness metric in 2024.
- CLS (Cumulative Layout Shift): how much page elements jump; unset ad slots and cover images without reserved dimensions are common causes.
Optimization techniques:
- Prefer server-side rendering for the first-screen HTML so the body is present in the first byte, balancing fast paint with search engine indexing.
- Add structured data markup to column pages (e.g., article type, author, publish time) to help search engines understand the content.
- Use modern image compression formats and declare width/height, load responsively by viewport, and use native lazy loading for below-the-fold content.
- Inline critical CSS and defer non-critical scripts; load body sections after the first screen on demand.
7.2 Multi-level caching strategy
Column content access has clear hot-spot characteristics: a few high-quality articles take most of the traffic alongside a large long tail. Build a multi-level cache:
| Tier | Location | Cache object | Invalidation |
|---|---|---|---|
| Edge cache | CDN | Column page HTML, covers, images | Short TTL + active refresh on publish |
| Local cache | App instance memory | Metadata, hot rankings | Second-level TTL, tolerates brief staleness |
| Distributed cache | Cache service | Column detail, comment first page, progress | Invalidate on write + fallback TTL |
| Database | Relational / search | Full data | Source of truth |
The page cache key should include the user identity dimension (anonymous users and different membership tiers see different content) to avoid cache-based privilege leaks.
# Pseudocode: cache-aside read with cache-breakdown protectiondef get_column(column_id: int, user_level: str):key = f"column:detail:{column_id}:{user_level}"data = cache.get(key)if data is not None:return data# Lock on origin fetch: only one request per key hits the DB; others wait briefly and re-read the cachewith distributed_lock(key, wait_ms=50, ttl_ms=3000):data = cache.get(key)if data is None:data = column_db.load(column_id, user_level)cache.set(key, data, ttl=300) # fallback TTL so dirty data never persists foreverreturn data
7.3 Stability and capacity planning
- Degradation plans: when the column service fails, serve a static fallback page from the CDN; when the recommendation service times out, fall back to the hot ranking; when the comment service is down, hide the interaction module without blocking body reading.
- Rate limiting and isolation: the gateway rate-limits by user, IP, and endpoint; isolate interaction-service resources from the column service so comment spam can’t drag down the body page.
- Capacity estimate (method demonstration only, not real data): assume 100 million daily column page views, 70% of which occur in about 10 active hours, with 1.5× peak headroom. Peak QPS ≈ 100,000,000 × 70% ÷ (10 × 3600) × 1.5 ≈ 2,917. From this, size the cache cluster, DB connection pool, and instance replica count, and validate with load testing.
- Elastic scaling and cost: auto-scale on CPU, memory, and request latency to absorb hot-content spikes; manage object storage with hot/cold tiering to control long-term storage cost.
On the cloud, the above capabilities map to general product categories: object storage, CDN, cache, message queue, container platform, logging, and monitoring/alerting. For selection, you can compare the public documentation of cloud providers such as Baidu AI Cloud; actual capabilities and pricing are subject to the official documentation.
8. Observability and Security Compliance
8.1 Observability
- Logging: collect service logs centrally in a logging service with sensitive-field masking rules—tokens, phone numbers, and passwords must never be written to disk in plaintext.
- Tracing: generate a trace ID spanning the full request path to locate cross-service latency bottlenecks.
- Metrics and alerts: build monitoring around the four “golden signals”—latency, traffic, errors, and saturation—with emphasis on login success rate, interaction success rate, cache hit rate, and message backlog.
- Release strategy: use canary releases and fast rollback—validate a new version on a small traffic slice before gradually ramping up.
8.2 Security and compliance
- Content safety: comments, danmaku, and column bodies go through both machine moderation and human review. High-risk content is reviewed before publishing; low-risk content is published first and reviewed after.
- Minor protection: enforce content tiering, usage-time limits, and spending limits in teen mode.
- Personal data protection: collect data on a minimum-necessary basis and provide account deletion and data-removal entry points.
- Transport and API security: enable HTTPS site-wide, validate signatures and anti-replay parameters uniformly on APIs, restrict file type and size on upload endpoints, and network-isolate the admin console from business APIs.
9. Phased Rollout Roadmap and Pre-Launch Checklist
| Phase | Goal | Key build areas |
|---|---|---|
| Phase 1: Usable | Get the “content–login–interaction” main path working | Account system, column publish and render, basic comments, object storage + CDN |
| Phase 2: Usable at scale | Support growth and retention | Multi-device sync, favorites and activity feed, recommendation recall, multi-level caching, content moderation |
| Phase 3: Large-scale | Handle high concurrency and fine-grained operations | Real-time danmaku pipeline, membership entitlement system, A/B testing, elastic scaling, full-stack observability |
Pre-launch checklist:
- Login, refresh, and logout all pass, and a leaked token correctly revokes the session.
- Progress reporting is correct under weak networks, duplicate requests, and out-of-order requests.
- Rich text is whitelist-sanitized, and stored XSS and unauthorized access are both tested.
- The core reading path can degrade gracefully when any of the cache, database, or message queue fails.
- Monitoring and alerts cover the critical paths, and logs contain no sensitive information.
- Load tests simulating peak traffic have passed, and a rollback drill has been run.
10. Conclusion
A content platform’s column page may look like just a collection of navigation and login prompts, yet behind it runs a complete technical chain of identity, content delivery, interaction, and cross-device experience. The essence of engineering here is balancing three things: smooth experience, content safety, and controlled cost.
- Use the identity system to hold the security boundary.
- Use caching and asynchrony to absorb interaction spikes.
- Use layered storage and canary releases to sustain evolution.
Hold to these general principles, and whether you’re a startup team building a community product or a mature platform reworking its column module, you can build an image-and-text content ecosystem that is both secure and fluid.
