Skip to main content
Push Protocol
· 6 min read

Benchmarking Push Chat Message Architecture: What Changed? 💬 ⚡

Cover Image of Push Chat message benchmark 💬 ⚡

Push Chat has revolutionized web3 messaging, providing a seamless experience for user-to-user, user-to-dApp, and group conversations. Essentially, Push Chat bridges the gap between messaging in web3 and web2, offering a hassle-free transition. One pivotal enhancement we've diligently pursued within Push Chat involves reconfiguring the architecture for storing and retrieving messages, resulting in significantly faster performance.

Whether you're engaging in public group chats, participating in private discussions, or accessing token-gated communities, Push Group Chat simplifies and secures connections. Now, Push is elevating its scalability and drastically improving message transmission speeds.

Understanding Push Chat Message Architecture​

V1 Architecture​

In the earlier iteration of Push Chat, messages were managed within a linked list structure. This architecture employed references where each message pointed to the previous one, creating a sequential chain of messages. However, this design encountered some significant hurdles.

One notable issue arose from the concurrent arrival of messages, as the linked list format struggled to handle the concurrent processing of incoming messages. This concurrency bottleneck often resulted in performance degradation and dropping of messages by Push nodes, undermining the real-time nature of Push Chat.

Moreover, the process of retrieving messages from this linked list structure posed its own set of challenges. Since Push nodes primarily stored references to the latest message, retrieving older messages required traversing the entire linked list sequentially. This approach led to slow query speeds, as resolving previous messages necessitated the resolution of the current message first.

V2 Architecture​

In the latest iteration, Push Chat has undergone a significant architectural transformation, one of the most notable changes in v2 is the abandonment of the linked list paradigm, where each message no longer references the previous one.

By eliminating the requirement for messages to reference the previous one, v2 architecture significantly simplifies message processing, enabling Push nodes to handle concurrent messages more efficiently. This architectural shift has alleviated the concurrency bottleneck that plagued the earlier version, enhancing the scalability and responsiveness of Push Chat.

Furthermore, in v2, Push nodes now cache every message instead of solely storing references to the latest message hash. This strategic enhancement plays a pivotal role in optimizing message retrieval speeds. By caching every message, Push nodes can swiftly access and deliver messages upon request, mitigating the latency issues associated with sequential message resolution.

It's worth noting that despite these architectural changes, the fundamental immutable layer of Push Chat remains rooted in IPFS. Every message, whether in v1 or v2, continues to be backed up by a client-signed and verifiable verification proof. This cryptographic mechanism ensures the integrity and authenticity of messages, safeguarding them against tampering or unauthorized alterations.

Push Chat Benchmarks: Letting The Numbers Speak For Unprecedented Scale And Security​

Note:: It's important to acknowledge that the benchmarking of v2 architecture was conducted on a development server, while the benchmarking of v1 architecture took place on a production server. It's worth highlighting that the production server possesses 16 times more CPU power than the development server, potentially providing an unfair advantage to v1 architecture. Additionally, it's crucial to recognize that the traffic volume on the production server is substantially higher compared to the development environment. These discrepancies in server specifications and traffic levels should be considered when interpreting the benchmark results.

List Paginated User Chats​

Fn Breakdown

  1. Fetch lists of chat of a account with latest threadhash ( Page Limit = 10 ) - A
  2. Fetch latest message for every chat - B
  3. Decrypt the latest message if its encrypted - Ignored for this benchmark
V1 Message Architecture

Call Type

Time Taken ( ms )

A825
B - 1712
B - 2718
B - 3728
B - 4734
B - 5693
B - 6694
B - 7673
B - 8716
B - 9768
B - 10713
V2 Message Architecture

Call Type

Time Taken ( ms )

A696
B - 1386
B - 2447
B - 3433
B - 4509
B - 5410
B - 6431
B - 7399
B - 8359
B - 9441
B - 10410

List Latest Chat Message​

Fn Breakdown

  1. Fetch latest message reference - A
  2. Fetch latest message for that reference - B
  3. Decrypt the latest message if its encrypted - Ignored for this benchmark
V1 Message Architecture
Chat with 10 Messages

Call Type

Time Taken ( ms )

A787
B1403
V2 Message Architecture
Chat with 10 Messages

Call Type

Time Taken ( ms )

A325
B673
V1 Message Architecture
Chat with 50 Messages

Call Type

Time Taken ( ms )

A744
B1381
V2 Message Architecture
Chat with 50 Messages

Call Type

Time Taken ( ms )

A399
B718
V1 Message Architecture
Chat with 100 Messages

Call Type

Time Taken ( ms )

A693
B1524
V2 Message Architecture
Chat with 100 Messages

Call Type

Time Taken ( ms )

A348
B716
V1 Message Architecture
Chat with 250 Messages

Call Type

Time Taken ( ms )

A679
B1462
V2 Message Architecture
Chat with 250 Messages

Call Type

Time Taken ( ms )

A312
B700

List Historical Chat Message​

Fn Breakdown

  1. Fetch messages frm a given message reference ( Page Limit = 10 ) - A
  2. Decrypt the latest message if its encrypted - Ignored for this benchmark
V1 Message Architecture
Chat with 10 Messages

Call Type

Time Taken ( ms )

A1616
V2 Message Architecture
Chat with 10 Messages

Call Type

Time Taken ( ms )

A991
V1 Message Architecture
Chat with 50 Messages

Call Type

Time Taken ( ms )

A2414
V2 Message Architecture
Chat with 50 Messages

Call Type

Time Taken ( ms )

A1060
V1 Message Architecture
Chat with 100 Messages

Call Type

Time Taken ( ms )

A2440
V2 Message Architecture
Chat with 100 Messages

Call Type

Time Taken ( ms )

A1020
V1 Message Architecture
Chat with 100 Messages

Call Type

Time Taken ( ms )

A2360
V2 Message Architecture
Chat with 250 Messages

Call Type

Time Taken ( ms )

A965

Send Message​

Fn Breakdown

  1. Fetch receiver’s details - Ignored for this benchmark
  2. Encrypt message - Ignored for this benchmark
  3. POST Call to Push Nodes - A
V1 Message Architecture

Call Type

Time Taken ( ms )

A - Avg of 10 Msg854
A - Avg of 50 Msg841
A - Avg of 100 Msg820
V2 Message Architecture

Call Type

Time Taken ( ms )

A - Avg of 10 Msg823
A - Avg of 50 Msg856
A - Avg of 100 Msg832

Be a part of the conversation by sharing this article

About Push Protocol
Push is the communication protocol of web3. Push protocol enables cross-chain notifications and messaging for dapps, wallets, and services tied to wallet addresses in an open, gasless, and platform-agnostic fashion. The open communication layer allows any crypto wallet / frontend to tap into the network and get the communication across.
Twitter
Discord
YouTube
Linkedin

We use cookies to personalize your experience. Learn more in our Privacy Policy.