InstaVerse

Distributed Social Blog Platform
A high-performance, microservices-based social platform inspired by XiaoHongShu, designed for massive concurrent users with enterprise-level scalability
22,000+
TPS Performance
4ms
Avg Response Time
1.9B+
Daily ID Generation
99.9%
System Availability
Role: Java Backend Developer

SYSTEM ARCHITECTURE

Microservices Distributed Architecture

Maven Multi-Module: Modular project structure with independent service modules
Spring Boot Starter: Custom starter components for rapid development
Frontend-Backend Separation: Decoupled architecture for scalability
USER INTERFACE LAYER
Web Client
React/Vue Frontend
Mobile App
iOS/Android Client
Admin Panel
Management Console
API GATEWAY LAYER
MICROSERVICES LAYER
DATA STORAGE LAYER
INFRASTRUCTURE LAYER

TECHNOLOGY STACK

Microservices Framework
Spring Cloud Alibaba
Enterprise-grade microservices framework providing comprehensive solutions for distributed systems. Integrated with Alibaba's proven production-ready components including service discovery, configuration management, and distributed messaging capabilities.
Service Mesh Load Balancing Circuit Breaker
Nacos
Dynamic service discovery and configuration management platform supporting both service registry and distributed configuration management. Provides real-time service health monitoring and automatic failover capabilities with millisecond-level configuration updates.
Service Registry Config Center Health Check
Spring Cloud Gateway
High-performance API gateway built on Spring WebFlux providing unified entry point for all microservices. Features advanced routing, filtering, rate limiting, and security integration with support for reactive programming and non-blocking I/O operations.
Reactive Rate Limiting Authentication
OpenFeign
Declarative HTTP client framework simplifying inter-service communication in microservices architecture. Provides intelligent load balancing, circuit breaker integration, and automatic service discovery with minimal configuration overhead.
Declarative Load Balancer Hystrix
Data Storage
MySQL 8.0
Enterprise-grade relational database with advanced features including JSON support, window functions, and common table expressions. Configured with master-slave replication and horizontal sharding to handle millions of concurrent users and massive data volumes.
Master-Slave Sharding ACID
Redis Cluster
High-performance in-memory data structure store used for caching, session management, and real-time analytics. Implements advanced caching strategies including L2 cache, distributed locks, and message queuing with sub-millisecond response times.
L2 Cache Pub/Sub Lua Scripts
Apache Cassandra
Massively scalable NoSQL database optimized for write-heavy workloads and large data volumes. Used for storing short text content with RocksDB storage engine providing exceptional performance for billions of records with linear scalability.
NoSQL RocksDB Distributed
MyBatis Plus
Enhanced persistence framework built on MyBatis providing powerful CRUD operations, automatic code generation, and advanced query capabilities. Features pagination, optimistic locking, and SQL injection protection with minimal configuration.
Code Gen Pagination ORM
Messaging & Queue
Apache RocketMQ
High-throughput distributed messaging platform supporting millions of messages per second. Provides reliable message delivery, ordered messaging, and broadcast capabilities with advanced features like message filtering, delay scheduling, and transaction support.
High Throughput Ordered Messaging Transactions
Apache Zookeeper
Centralized coordination service for distributed applications providing configuration management, distributed synchronization, and group services. Ensures data consistency across distributed systems with leader election and distributed locking mechanisms.
Coordination Leader Election Distributed Lock
Security & Storage
SaToken
Lightweight authorization framework for Java applications providing comprehensive authentication and authorization solutions. Features JWT token management, RBAC permission control, single sign-on (SSO), and OAuth2 integration with excellent performance.
JWT RBAC SSO
MinIO
High-performance distributed object storage system compatible with Amazon S3 API. Provides scalable file storage with built-in data protection, versioning, and lifecycle management. Used alongside Alibaba Cloud OSS for multi-cloud storage strategy.
S3 Compatible Distributed Multi-Cloud

CORE RESPONSIBILITIES

Platform Design & Architecture

Led the end-to-end platform design from requirements gathering to deployment, ensuring enterprise-level scalability and performance.

  • Requirements Analysis: Comprehensive business requirement gathering and technical feasibility assessment
  • Technology Selection: Strategic technology stack selection based on performance and scalability requirements
  • Architecture Design: Microservices architecture design ensuring high scalability, availability, and performance
  • Project Setup: Complete project scaffolding and deployment pipeline configuration
  • API & Database Design: RESTful API design and optimized database schema for massive user loads

Component & Utilities Development

Developed reusable components and utilities to improve code maintainability and development efficiency.

  • User Context Component: Centralized user session and context management
  • Logging Component: AOP-based interface logging with performance monitoring
  • Jackson Configuration: Automated JSON serialization/deserialization configuration
  • Global Exception Handler: Centralized exception handling with custom error responses
  • Custom Validation: Parameter validation annotations for business logic
  • Response Utilities: Standardized API response wrapper and utilities

Service Decomposition & Architecture

Designed and implemented microservices architecture based on domain-driven design principles.

  • Gateway Service: API routing, load balancing, and centralized authentication
  • Authentication Service: User authentication, authorization, and session management
  • User Service: User profile management with high-concurrency caching
  • Blog Service: Content publishing, editing, and management with async processing
  • Relation Service: Social relationship management (follow/unfollow)
  • Counter Service: High-performance counting for likes, views, followers
  • OSS Service: Multi-cloud object storage with strategy pattern
  • ID Generator Service: Distributed ID generation using Leaf framework
  • KV Storage Service: Short text key-value storage using Cassandra

Gateway Service Development

Built and optimized the API Gateway as the single entry point for all client requests.

  • Unified Routing: Centralized routing management for all microservices
  • Load Balancing: Intelligent traffic distribution across service instances
  • SaToken Integration: Unified authentication and authorization
  • Global Filters: Token parsing and user ID propagation to downstream services
  • Rate Limiting: API rate limiting and traffic control

Authentication Service Development

Implemented comprehensive authentication system based on RBAC model with multiple login methods.

  • RBAC Model: Role-based access control for fine-grained permissions
  • JWT Authentication: Stateless authentication with token-based security
  • Multi-Login Support: Username/password and SMS verification login
  • User Registration: Self-registration with email/SMS verification
  • SMS Integration: Alibaba Cloud SMS service with async processing
  • Anti-Spam Protection: SMS interface rate limiting and abuse prevention

Distributed ID Generation Service

Integrated Meituan's Leaf framework to build high-performance distributed ID generation service.

  • Dual Mode Support: Segment-based and Snowflake algorithm ID generation
  • Feign Interface: RESTful API for seamless service integration
  • High Performance: 22,000+ TPS with 4ms average response time
  • Massive Scale: 1.9+ billion daily ID generation capacity
  • Performance Testing: JMeter load testing for single-node optimization

Object Storage Service (OSS)

Designed flexible object storage service supporting multiple cloud providers.

  • Multi-Cloud Support: Alibaba Cloud OSS and MinIO integration
  • Strategy Pattern: Factory + Strategy pattern for extensible storage backends
  • Dynamic Configuration: Nacos-based dynamic storage strategy registration
  • File Management: Upload, download, and metadata management
  • Performance Optimization: Async processing and CDN integration

KV Short Text Storage Service

Built high-performance key-value storage service for short text content using Cassandra.

  • Cassandra Integration: Apache Cassandra with RocksDB storage engine
  • Short Text Storage: Optimized for blog content and comments
  • High Throughput: Massive read/write operations support
  • Data Modeling: Efficient data modeling for query patterns

User Service Development

Implemented comprehensive user management service with advanced caching strategies.

  • User Management: Complete CRUD operations for user profiles
  • Security: BCrypt password encryption with random salt
  • L2 Caching: Redis + Caffeine local cache for high-concurrency reads
  • Cache Protection: Prevention of cache avalanche, penetration, and breakdown
  • Performance: Optimized for millions of concurrent user queries

Blog Service Development

Built comprehensive blog management system with advanced performance optimizations.

  • Content Management: Publishing, editing, querying, pinning, and permission control
  • Async Processing: CompletableFuture for concurrent downstream service calls
  • L2 Caching: High-concurrency read support with cache invalidation
  • Data Consistency: RocketMQ broadcast for distributed cache invalidation
  • Like System: Redis Bloom filter (later Roaring Bitmap) for high-performance like operations
  • Traffic Shaping: RateLimiter token bucket for database protection

User Relation Service

Designed social relationship management system for follow/unfollow operations at scale.

  • Follow/Unfollow: High-concurrency social operations with ordered messaging
  • Redis Optimization: Lua scripts for atomic operations and performance
  • Idempotency: Unique indexes for relationship record deduplication
  • List Queries: Redis ZSET for follower/following list pagination
  • Hot Data Caching: Different strategies for followers vs following lists

High-Concurrency Counter Service

Built specialized counting service for likes, follows, and view statistics at massive scale.

  • BufferTrigger: Traffic aggregation (1000 records/batch, 1s intervals)
  • Redis First: Write to Redis cache before async database persistence
  • Data Alignment: XXL-Job scheduled tasks for eventual consistency
  • Shard Broadcasting: Parallel processing for large data volumes
  • Real-time Updates: Immediate counter updates with background persistence

Search Service Development

Implemented real-time search service with full-text capabilities and data synchronization.

  • Index Design: Elasticsearch indexes for blogs and users
  • Bulk Indexing: Logstash for full data indexing
  • Real-time Sync: Canal CDC for MySQL binlog processing
  • Search Features: Chinese tokenization, highlighting, filtering, custom scoring
  • Data Consistency: Guaranteed consistency between MySQL and Elasticsearch

Comment Service Development

Built comprehensive comment system with advanced reliability and performance features.

  • Data Design: Redundant fields for query optimization (earliest reply ID, sub-comment count)
  • MQ Reliability: Spring Retry + fallback storage + async retry for guaranteed delivery
  • Async Publishing: High-throughput comment publishing with async operations
  • Batch Processing: Bulk MQ consumption and database writes
  • Pagination: Efficient L1/L2 comment pagination with L2 caching
  • Like System: Memory operation merging for high-performance like processing