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
- Fetch lists of chat of a account with latest threadhash ( Page Limit = 10 ) -
A
- Fetch latest message for every chat -
B
- Decrypt the latest message if its encrypted - Ignored for this benchmark
V1 Message Architecture | |
---|---|
Call Type | Time Taken ( ms ) |
A | 825 |
B - 1 | 712 |
B - 2 | 718 |
B - 3 | 728 |
B - 4 | 734 |
B - 5 | 693 |
B - 6 | 694 |
B - 7 | 673 |
B - 8 | 716 |
B - 9 | 768 |
B - 10 | 713 |
V2 Message Architecture | |
---|---|
Call Type | Time Taken ( ms ) |
A | 696 |
B - 1 | 386 |
B - 2 | 447 |
B - 3 | 433 |
B - 4 | 509 |
B - 5 | 410 |
B - 6 | 431 |
B - 7 | 399 |
B - 8 | 359 |
B - 9 | 441 |
B - 10 | 410 |
List Latest Chat Message​
Fn Breakdown
- Fetch latest message reference -
A
- Fetch latest message for that reference -
B
- Decrypt the latest message if its encrypted - Ignored for this benchmark
V1 Message Architecture | |
---|---|
Chat with 10 Messages | |
Call Type | Time Taken ( ms ) |
A | 787 |
B | 1403 |
V2 Message Architecture | |
---|---|
Chat with 10 Messages | |
Call Type | Time Taken ( ms ) |
A | 325 |
B | 673 |
V1 Message Architecture | |
---|---|
Chat with 50 Messages | |
Call Type | Time Taken ( ms ) |
A | 744 |
B | 1381 |
V2 Message Architecture | |
---|---|
Chat with 50 Messages | |
Call Type | Time Taken ( ms ) |
A | 399 |
B | 718 |
V1 Message Architecture | |
---|---|
Chat with 100 Messages | |
Call Type | Time Taken ( ms ) |
A | 693 |
B | 1524 |
V2 Message Architecture | |
---|---|
Chat with 100 Messages | |
Call Type | Time Taken ( ms ) |
A | 348 |
B | 716 |
V1 Message Architecture | |
---|---|
Chat with 250 Messages | |
Call Type | Time Taken ( ms ) |
A | 679 |
B | 1462 |
V2 Message Architecture | |
---|---|
Chat with 250 Messages | |
Call Type | Time Taken ( ms ) |
A | 312 |
B | 700 |
List Historical Chat Message​
Fn Breakdown
- Fetch messages frm a given message reference ( Page Limit = 10 ) -
A
- Decrypt the latest message if its encrypted - Ignored for this benchmark
V1 Message Architecture | |
---|---|
Chat with 10 Messages | |
Call Type | Time Taken ( ms ) |
A | 1616 |
V2 Message Architecture | |
---|---|
Chat with 10 Messages | |
Call Type | Time Taken ( ms ) |
A | 991 |
V1 Message Architecture | |
---|---|
Chat with 50 Messages | |
Call Type | Time Taken ( ms ) |
A | 2414 |
V2 Message Architecture | |
---|---|
Chat with 50 Messages | |
Call Type | Time Taken ( ms ) |
A | 1060 |
V1 Message Architecture | |
---|---|
Chat with 100 Messages | |
Call Type | Time Taken ( ms ) |
A | 2440 |
V2 Message Architecture | |
---|---|
Chat with 100 Messages | |
Call Type | Time Taken ( ms ) |
A | 1020 |
V1 Message Architecture | |
---|---|
Chat with 100 Messages | |
Call Type | Time Taken ( ms ) |
A | 2360 |
V2 Message Architecture | |
---|---|
Chat with 250 Messages | |
Call Type | Time Taken ( ms ) |
A | 965 |
Send Message​
Fn Breakdown
- Fetch receiver’s details - Ignored for this benchmark
- Encrypt message - Ignored for this benchmark
- POST Call to Push Nodes -
A
V1 Message Architecture | |
---|---|
Call Type | Time Taken ( ms ) |
A - Avg of 10 Msg | 854 |
A - Avg of 50 Msg | 841 |
A - Avg of 100 Msg | 820 |
V2 Message Architecture | |
---|---|
Call Type | Time Taken ( ms ) |
A - Avg of 10 Msg | 823 |
A - Avg of 50 Msg | 856 |
A - Avg of 100 Msg | 832 |