InstaVerse
SYSTEM ARCHITECTURE
Microservices Distributed Architecture
• Load balancing
• SaToken authentication
• Global filters for token parsing
• User ID propagation to downstream services
TECHNOLOGY STACK
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