Suggest removing ZooKeeper and streamlining the architecture
- Dominant language
- Java
- Stars
- 15.3k
- Forks
- 3.8k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 160
Description
### Search before reporting
- [x] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.
### Motivation
### Problem Statement
Apache Pulsar currently relies on external ZooKeeper for metadata storage and management, which introduces several significant drawbacks:
1. **Performance Bottlenecks**
- ZooKeeper becomes a performance bottleneck under high concurrency scenarios
- Network latency between Pulsar and ZooKeeper affects overall system performance
- Additional network hops for metadata operations
2. **Operational Complexity**
- Requires maintaining two separate distributed systems (ZooKeeper + Pulsar)
- Complex configuration management coordinating both systems
- Difficult troubleshooting as issues can occur in either system
3. **Scalability Challenges**
- ZooKeeper's scalability limitations impact Pulsar's growth
- Scaling requires coordination between two systems
### Proposed Solution
Implement a built-in metadata management system within Pulsar to replace external ZooKeeper dependency:
#### Key Benefits
1. **Simplified Architecture**
- Unified metadata management reduces external dependencies
- Single system to maintain and monitor
- Easier deployment and configuration
2. **Performance Improvements**
- Eliminate network hops for metadata operations
- Optimize storage engine specifically for messaging use cases
- Better integration between metadata and messaging layers
3. **Enhanced Controllability**
- Deep integration between metadata storage and messaging system
- More flexible scaling and optimization strategies
- Customizable metadata management policies
### Implementation Approach
1. **Native Metadata Storage Engine**
- Develop a dedicated metadata storage engine within Pulsar
- Support clustering and high availability configurations
- Implement efficient metadata caching mechanisms
2. **Gradual Migration Path**
- Provide compatibility mode for smooth migration
- Maintain optional ZooKeeper support during transition period
- Offer migration tools and documentation
3. **Performance Optimization**
- Optimize storage structures for messaging scenarios
- Implement advanced caching and indexing strategies
- Ensure consistency and reliability of metadata operations
### Expected Outcomes
- **Reduced Operational Overhead**: Single system management instead of coordinating multiple systems
- **Improved Performance**: Faster metadata operations and reduced latency
- **Better Scalability**: Independent scaling of metadata and messaging components
- **Enhanced Reliability**: Simplified failure modes and easier recovery procedures
This enhancement aligns with modern distributed system design principles and would significantly improve Pulsar's usability, performance, and operational efficiency.
### Solution
_No response_
### Alternatives
_No response_
### Anything else?
_No response_
### Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!
Contributor guide
Research direction
The issue names no files, tests, or entry points. Start by mapping Pulsar's current ZooKeeper metadata integration and its metadata-management components, then define the replacement architecture, migration path, compatibility behavior, and performance criteria before implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- distributed-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100