Bytefaas MQ Trigger Best Practice| 青训营笔记

279 阅读1分钟

这是我参与「第五届青训营 」伴学笔记创作活动的第 37 天 本节课将重点介绍 ByteFaaS 的 MQ 触发器,对 MQ 消费场景核心优化、常见的最佳实践以及故障排查方法等进行深入讲解,分享公司当前在应对不同场景时,如何真正做到让业务研发专心业务和消息处理,快速实现业务迭代。

MQ Basic Conceptions 101

  • A message queue is a form of asynchronous service-to-service communication used in serverless and microservices architectures.

BMQ/Kafka RocketMQ NSQ (Deprecated)

image-20230224174512925

BMQ: 兼容Kafka协议的MQ

  • A consumer group is a group of consumers that share the same group id. When a topic is consumed by consumers in the same group, every record will be delivered to only one consumer.

image-20230224174932003

  • What is partition?

A single topic can consist of multiple internal queues, named partitions, which hold the records published to MQ.

image-20230224175152686

  • what is rebalance -> partition assignment is rebalance

MQ Trigger Handbook

Create & Use

image-20230224175744049

image-20230224175903955

Other Triggers Based on MQ Triggers

TOS触发器

Abase Binlog触发器

image-20230224180116732

MQ Trigger Design And Core Optimizations

MQ Trigger Design

image-20230224180227377

解耦:扩缩容方便!!!

image-20230224180353355

Improve MQ Throughput for One Single Partition

Multi Threads Consuming Of One Partition

image-20230224181243818

image-20230224213331559

Distributed Limiting with Minor Performance Impact

Distributed QPS Limit(v1)

image-20230224213611374

消费不均匀可能会导致问题

Distributed QPS Limit(v2 ongoing)

image-20230224213729386

Avoid Stopping the World when MQ Rebalancing

BMQ/Kafka Rebalance - Static Membership

image-20230224213929234

滚动升级,数据堆积能够降低非常多昂!!!非常好的优化!!!

image-20230224215018213

One Click to Create a MQ Consumer

One Click to Request Permission & Resetting Offset

image-20230224215358998

Control the Concurrency Automatically

Concurrency Control & Backoff

image-20230224215633653

image-20230224215920951

Reduce Unnecessary Msg Handling?

Plugin Filter

image-20230224220535505

MQ Trigger Ops Practice

Auto Diagnosis

image-20230224220801889

MQ Trigger Coming Features

  • Limiter V2
  • RPC Handler
  • Orderly consuming in BMQ
  • Better & better performance (http performance improve & co-locate)
  • ......