Draft issue to collect ideas to consider for next major update
Motivation
Nexus was written years ago and has accumulated features and interfaces to support an evolving standard. Now that the WAMP specification is much more mature and stable, nexus could be given a more unified and modernized code base. This would involve changes to many APIs to improve usability and consistency, and updates to the core code to improve performance and scalability. Additional interfaces for metrics could be provided as well.
This new version would make nexus a current, full-featured, and valuable provider of WAMP protocol functionality.
Goals / Ideas
Simplified APIs
- Options parameters instead of large config structures
- Cleaner invocation of user-provided functionality. Relying on closures can be awkward, and a simplified channel model can simplify writing wamp client code.
Performance
- There are some bottlenecks caused by the current approach to synchronization in the router, where messages pass through a single goroutine that accesses router data structures. This could be replaced by a different approach to making these data structures concurrent-safe to allow many concurrent goroutines to execute router code.
- More message data can remain serialized as it transits the router to minimize [de]serialization work.
Durability
- Subscriptions, procedures, and undelivered messages can be persisted in a backing store to allow router restarts without re-registering all clients and be able to resume or at least report lost messages in flight.
- Message queues can overflow to backing storage to allow larger spikes of pubsub messages in the presence of slow subscribers, without discarding messages or blocking publishers.
- Configure limits
- queued message limits
- max clients, subscriptions, procedures, etc.
- configure rate limiting
Router Scalability
- Multiple router instances can route messages between each other, allowing each instance to handle a different set of clients. Additional routers can start and join to handle more clients.
Metrics interface
- Provides endpoints for metrics collection and query.
- Track per-client metrics.
Core reorganization
- Removal of deprecated and unused code.
- Cleaner router package organization.
- There is too much overlap in unit tests and integration tests, and much redundancy in unit test code. This can be simplified.
- Use of generics where applicable
- Structured logging?
Major Version Update or New Project
Such features will require breaking changes and code reorganization. This could be done as nexus v4.0.0, but may be better done as a new project/repo. Advantages of a new project:
- New repo does not need to abide by semver > 1 rules and avoids problems with
/v3 /v4 inconsistency.
- New repo can be private or be marked as under construction until ready for initial release.
- Clean separation of documentation.
- Project can be renamed to something more appealing to the WAMP-proto community.
A disadvantage of a new project/repo is possible confusion about what project is the most current nexus (or whatever it is called), but that can be addressed with clear documentation in the repo README.md. Another problem is the many pieces of code and documentation in the world that refer to the nexus repo that will need to be updated.
Draft issue to collect ideas to consider for next major update
Motivation
Nexus was written years ago and has accumulated features and interfaces to support an evolving standard. Now that the WAMP specification is much more mature and stable, nexus could be given a more unified and modernized code base. This would involve changes to many APIs to improve usability and consistency, and updates to the core code to improve performance and scalability. Additional interfaces for metrics could be provided as well.
This new version would make nexus a current, full-featured, and valuable provider of WAMP protocol functionality.
Goals / Ideas
Simplified APIs
Performance
Durability
Router Scalability
Metrics interface
Core reorganization
Major Version Update or New Project
Such features will require breaking changes and code reorganization. This could be done as nexus v4.0.0, but may be better done as a new project/repo. Advantages of a new project:
/v3/v4inconsistency.A disadvantage of a new project/repo is possible confusion about what project is the most current nexus (or whatever it is called), but that can be addressed with clear documentation in the repo
README.md. Another problem is the many pieces of code and documentation in the world that refer to thenexusrepo that will need to be updated.