Centrifugo v2.0.0 Release Notes

Release Date: 2018-09-18 // over 5 years ago
  • ๐Ÿ“š This is a new major version of Centrifugo. New version has some important changes and useful features โ€“ read new documentation.

    Centrifugo v2 serves the same purpose as Centrifugo v1. Centrifugo v2 is not backwards compatible with v1 โ€“ migration to it will require adapting both backend and frontend sides of your application (of course if you decide to migrate).

    Centrifugo is now based on new library centrifuge for Go language. That library can be used standalone to get even more than Centrifugo server provides โ€“ like custom authentication, your own permission management, asynchronous message passing, RPC calls etc.

    Highlights of v2:

    • 0๏ธโƒฃ Cleaner and more structured client-server protocol defined in protobuf schema. Protocol is more compact because some fields with default values that were sent previously now omitted
    • ๐Ÿ‘ Binary Websocket support (Protobuf). Protobuf allows to transfer data in much more compact and performant way than before. Of course JSON is still the main serialization format
    • JWT for authentication and private channel authorization instead of hand-crafted HMAC sign. This means that there is no need in extra libraries to generate connection and subscription tokens. There are plenty of JWT libraries for all languages
    • Prometheus integration and automatic export of stats to Graphite. Now Centrifugo easily integrates in modern monitoring stack โ€“ no need to manually export stats
    • ๐Ÿ”จ Refactored Javascript (ES6), Go and gomobile client libraries
    • Simplified HTTP API authentication (no request body signing anymore)
    • GRPC for server API
    • ๐Ÿ†• New presence_stats API command to get compact presence information - how many clients and unique users in channel
    • ๐ŸŒฒ Structured logging with colored output during development
    • ๐Ÿ”€ Mechanism to automatically merge several Websocket messages into one to reduce syscall amount thus be more performant under heavy load
    • ๐Ÿ‘ Better recovery algorithm to fix several recovered flag false positives
    • ๐Ÿš€ Goreleaser for automatic releases to Github

    ๐Ÿš€ Some things were removed from Centrifugo in v2 release:

    • Publishing over Redis queue
    • Admin websocket endpoint
    • Client limited channels
    • โฌ‡๏ธ Channel option history_drop_inactive now gone
    • ๐Ÿ‘ Websocket prepared message support (though this one can be pushed back at some point).

    ๐Ÿ“š Documentation contains actual information and tips about migration from v1.

    ๐Ÿ’Ž As mentioned above new version uses JWT tokens for authentication and private channel authorization. And there is no API request body signing anymore. This all means that using API clients (like cent, phpcent, jscent, rubycent, gocent before) is not necessary anymore โ€“ you can use any JWT library for your language and just send commands from your code โ€“ this is just simple JSON objects. Though API libraries still make sense to simplify integration a bit.

    Currently the following clients work with v2:

    • ๐Ÿ’ป centrifuge-js โ€“ for browser, NodeJS and React Native.
    • centrifuge-go - for Go language.
    • centrifuge-mobile - for iOS and Android using centrifuge-go and gomobile project.
    • ๐Ÿšง centrifuge-dart โ€“ for Dart and Flutter. This lib is WIP and does not support all features yet.

    โšก๏ธ At moment there are no native mobile clients. I.e. centrifuge-ios and centrifuge-android have not been updated to Centrifugo v2 yet.

    ๐Ÿณ Docker images

    • ๐Ÿณ docker pull centrifugo/centrifugo:v2.0.0
    • ๐Ÿณ docker pull centrifugo/centrifugo:v2
    • ๐Ÿณ docker pull centrifugo/centrifugo:v2.0
    • ๐Ÿณ docker pull centrifugo/centrifugo:latest