比较 NATS
这份比较主要关注 NATS, Apache Kafka, RabbitMQ, Apache Pulsar, and gRPC.
此功能比较是对当今几种流行消息传递技术中的一些主要组件的总结。 这绝不是一份详尽的清单,应彻底调查每种技术,以确定哪种技术最适合您的实施。
Language and Platform Coverage
NATS
核心 NATS:48 种已知客户端类型,11 种由维护者支持,18 种由社区贡献。 NATS Streaming:维护者支持的 7 种客户端类型,社区贡献的 4 种。 NATS 服务器可以在 Golang 支持的架构上编译。 NATS 提供二进制分发。
gRPC
13个客户端语言.
Kafka
社区和 Confluent 支持 18 种客户端类型。 Kafka 服务器可以运行在支持 java 的平台上; 非常广泛的支持。
Pulsar
7种客户端语言,5个第三方平台,在苹果和linux系统上测试过。
Rabbit
至少 10 个受维护者支持的客户端平台,以及超过 50 种社区支持的客户端类型。 以下平台支持服务器:Linux Windows、NT。
Built-in Patterns
NATS
通过内置的发布/订阅、请求-回复和负载平衡队列订阅模式实现流和服务。 支持动态请求许可和请求主题混淆。
gRPC
每个通道一个服务,可能具有流式语义。 服务的负载平衡可以在客户端或通过使用代理来完成。
Kafka
通过发布/订阅流式传输。 负载均衡可以通过消费者组来实现。 应用程序代码必须将请求与对服务(请求-回复)模式的多个主题的回复相关联。
Pulsar
通过发布/订阅流式传输。 多个竞争消费者模式支持负载平衡。 应用程序代码必须将请求与对服务(请求-回复)模式的多个主题的回复相关联。
Rabbit
通过发布/订阅流式传输,以及具有直接回复功能的服务。 负载平衡可以通过工作队列来实现。 应用程序必须将请求与对服务(请求-回复)模式的多个主题的回复相关联。
Delivery Guarantees
NATS
Jetstream中支持 最多一次,最少一次和恰好一次
gRPC
最多一次.
Kafka
最少一次 恰好一次.
Pulsar
最多一次,最少一次和恰好一次.
Rabbit
最多一次,最少一次和
多租户和分享
NATS
NATS 通过帐户和定义共享流和服务来支持真正的多租户和去中心化的安全性。
gRPC
N/A
Kafka
不支持多租户.
Pulsar
Multi-tenancy is implemented through tenants; built-in data sharing across tenants is not supported. Each tenant can have its own authentication and authorization scheme.
Rabbit
Multi-tenancy is supported with vhosts; data sharing is not supported.
AuthN
NATS
NATS supports TLS, NATS credentials, NKEYS (NATS ED25519 keys), username and password, or simple token.
gRPC
TLS, ALT, Token, channel and call credentials, and a plug-in mechanism.
Kafka
Supports Kerberos and TLS. Supports JAAS and an out-of-box authorizer implementation that uses ZooKeeper to store connection and subject.
Pulsar
TLS Authentication, Athenz, Kerberos, JSON Web Token Authentication.
Rabbit
TLS, SASL, username and password, and pluggable authorization.
AuthZ
NATS
Account limits including number of connections, message size, number of imports and exports. User-level publish and subscribe permissions, connection restrictions, CIDR address restrictions, and time of day restrictions.
gRPC
Users can configure call credentials to authorize fine-grained individual calls on a service.
Kafka
Supports JAAS, ACLs for a rich set of Kafka resources including topics, clusters, groups, and others.
Pulsar
Permissions may be granted to specific roles for lists of operations such as produce and consume.
Rabbit
ACLs dictate permissions for configure, write, and read operations on resources like exchanges, queues, transactions, and others. Authentication is pluggable.
Message Retention and Persistence
NATS
Supports memory, file, and database persistence. Messages can be replayed by time, count, or sequence number, and durable subscriptions are supported. With NATS streaming, scripts can archive old log segments to cold storage.
gRPC
N/A
Kafka
Supports file-based persistence. Messages can be replayed by specifying an offset, and durable subscriptions are supported. Log compaction is supported as well as KSQL.
Pulsar
Supports tiered storage including file, Amazon S3 or Google Cloud Storage (GCS). Pulsar can replay messages from a specific position and supports durable subscriptions. Pulsar SQL and topic compaction is supported, as well as Pulsar functions.
Rabbit
Supports file-based persistence. Rabbit supported queue-based semantics (vs log), so no message replay is available.
High Availability and Fault Tolerance
NATS
Core NATS supports full mesh clustering with self-healing features to provide high availability to clients. NATS streaming has warm failover backup servers with two modes (FT and full clustering). JetStream supports horizontal scalability with built-in mirroring.
gRPC
N/A. gRPC relies on external resources for HA/FT.
Kafka
Fully replicated cluster members are coordinated via Zookeeper.
Pulsar
Pulsar supports clustered brokers with geo-replication.
Rabbit
Clustering Support with full data replication via federation plugins. Clusters require low-latency networks where network partitions are rare.
Deployment
NATS
The NATS network element (server) is a small static binary that can be deployed anywhere from large instances in the cloud to resource constrained devices like a Raspberry PI. NATS supports the Adaptive Edge architecture which allows for large, flexible deployments. Single servers, leaf nodes, clusters, and superclusters (cluster of clusters) can be combined in any fashion for an extremely flexible deployment amenable to cloud, on-premise, edge and IoT. Clients are unaware of topology and can connect to any NATS server in a deployment.
gRPC
gRPC is point to point and does not have a server or broker to deploy or manage, but always requires additional pieces for production deployments.
Kafka
Kafka supports clustering with mirroring to loosely coupled remote clusters. Clients are tied to partitions defined within clusters. Kafka servers require a JVM, eight cores, 64 GB to128 GB of RAM, two or more 8-TB SAS/SSD disks, and a 10-Gig NIC. (1)__
Pulsar
Pulsar supports clustering and built-in geo-replication between clusters. Clients may connect to any cluster with an appropriately configured tenant and namespace. Pulsar requires a JVM and requires at least 6 Linux machines or VMs. 3 running ZooKeeper. 3 running a Pulsar broker and a BookKeeper bookie. (2)__
Rabbit
Rabbit supports clusters and cross-cluster message propagation through a federation plugin. Clients are unaware of topology and may connect to any cluster. The server requires the Erlang VM and dependencies.
Monitoring
NATS
NATS supports exporting monitoring data to Prometheus and has Grafana dashboards to monitor and configure alerts. There are also development monitoring tools such as nats-top. Robust side car deployment or a simple connect-and-view model with NATS surveyor is supported.
gRPC
External components such as a service mesh are required to monitor gRPC.
Kafka
Kafka has a number of management tools and consoles including Confluent Control Center, Kafka, Kafka Web Console, Kafka Offset Monitor.
Pulsar
CLI tools, per-topic dashboards, and third-party tools.
Rabbit
CLI tools, a plugin-based management system with dashboards and third-party tools.
Management
NATS
NATS separates operations from security. User and Account management in a deployment may be decentralized and managed through a CLI. Server (network element) configuration is separated from security with a command line and configuration file which can be reloaded with changes at runtime.
gRPC
External components such as a service mesh are required to manage gRPC.
Kafka
Kafka has a number of management tools and consoles including Confluent Control Center, Kafka, Kafka Web Console, Kafka Offset Monitor.
Pulsar
CLI tools, per-topic dashboards, and third-party tools.
Rabbit
CLI tools, a plugin-based management system with dashboards and third-party tools.
Integrations
NATS
NATS supports WebSockets, a Kafka bridge, an IBM MQ Bridge, a Redis Connector, Apache Spark, Apache Flink, CoreOS, Elastic, Elasticsearch, Prometheus, Telegraf, Logrus, Fluent Bit, Fluentd, OpenFAAS, HTTP, and MQTT, and more.
gRPC
There are a number of third party integrations including HTTP, JSON, Prometheus, Grift and others. (3)__
Kafka
Kafka has a large number of integrations in its ecosystem, including stream processing (Storm, Samza, Flink), Hadoop, database (JDBC, Oracle Golden Gate), Search and Query (ElasticSearch, Hive), and a variety of logging and other integrations.
Pulsar
Pulsar has many integrations, including ActiveMQ, Cassandra, Debezium, Flume, Elasticsearch, Kafka, Redis, and others.
Rabbit
RabbitMQ has many plugins, including protocols (MQTT, STOMP), WebSockets, and various authorization and authentication plugins.
References
最后更新于