Engineering

6

mins read

Building Deal Rooms with Real-Time Threads (Without Going Full Chat App)

Thijmen van Buuren

Jul 7, 2025

Summary

Hexa’s Deal Rooms let reps and managers collaborate in context — comments, mentions, notes, and updates — all tied to a specific opportunity. But we didn’t want to build a full Slack clone. This article breaks down how we built real-time threaded comments using simple primitives: Redis streams, Postgres triggers, and a thin socket layer that just works.

Summary

Hexa’s Deal Rooms let reps and managers collaborate in context — comments, mentions, notes, and updates — all tied to a specific opportunity. But we didn’t want to build a full Slack clone. This article breaks down how we built real-time threaded comments using simple primitives: Redis streams, Postgres triggers, and a thin socket layer that just works.

The challenge

We wanted reps to be able to:

  • Add notes in real-time during or after calls

  • Mention teammates (@carlos) with notification logic

  • View comment history alongside call summaries and pipeline data

  • Never refresh the page

But we didn’t want to:

  • Maintain presence states

  • Deal with long-lived WebSocket pain

  • Bloat the UI with a full “chat UX”

Core constraint: one thread per deal

Every Deal Room is tied to a single deal ID. That gave us a clean scoping mechanism:

// Client-side socket room join
socket.emit('join', { dealId: 'deal_87234' })

On the backend, we mapped this to a Redis pub/sub channel for lightness and speed:

// Server-side listener
redis.subscribe(`dealroom:${dealId}`)

Real-time without state: the trigger trick

Instead of syncing comment history through a big cache layer, we used PostgreSQL triggers to broadcast events:

CREATE OR REPLACE FUNCTION notify_dealroom_comment()
RETURNS trigger AS $$
BEGIN
  PERFORM pg_notify('dealroom_update', row_to_json(NEW)::text);
  RETURN NEW;
END;
$$ LANGUAGE plpgsql;

This let us avoid full polling — and meant that the DB was the source of truth, not some middle-layer buffer.

Mentions: just enough parsing

We didn’t need full NLP for @mentions. We used a simple regex + user map:

const mentionedUsers = body.match(/@(\w+)/g)

Then we validate them against the current deal’s team context. If valid, we trigger a notification event with:

  • Author ID

  • Deal ID

  • Mentioned usernames

  • Message text

The result

Deal Rooms feel fast and human — like lightweight sales-focused Slack threads. Reps collaborate without switching tools. Managers see conversation and activity in one place. And we didn’t over-engineer anything.

All of it runs on:

  • 1 Redis instance

  • 1 DB trigger

  • 1 socket server

  • < 500 lines of orchestration logic

Final Thought

Real-time doesn’t have to mean complex. By building for our exact use case — not a generic chat SDK — we created something lighter, clearer, and more durable.

Jump to

Share Article

Share Article

Share Article

Related Reads

More in

Engineering

If it’s not covered here, reach out — or just try Hexa free and see for yourself.

Frequently Asked Questions

If it's not covered here, please reach out to us.
…or start your free trial and see for yourself.

Is there a free trial?

Yes when you sign up, you'll get instant access to a 30-day free trial with full access to the CryoCloud web application. You'll receive 20 hours of compute time and 2 TB of storage. No setup or infrastructure needed. After the trial, you can upgrade to a paid subscription or contact us for custom plans no interruption to your data.

How can I start using CryoCloud?

Either go directly to out signup page or simply send us an email to hi@cryocloud.io so we can invite you to our application. You can find more information on how to get started here.

Do I need to install anything?

No - you really just need a (simple) computer, internet access and an internet browser. We took care of everything else. Read more on it here

How does your risk-free trial work?

If you are unsatisfied, you can cancel your plan within 30 days and we will refund you at 100%. You can deactivate the subscription from your account settings.

Frequently Asked Questions

If it's not covered here, please reach out to us.
…or start your free trial and see for yourself.

Is there a free trial?

Yes when you sign up, you'll get instant access to a 30-day free trial with full access to the CryoCloud web application. You'll receive 20 hours of compute time and 2 TB of storage. No setup or infrastructure needed. After the trial, you can upgrade to a paid subscription or contact us for custom plans no interruption to your data.

How can I start using CryoCloud?

Either go directly to out signup page or simply send us an email to hi@cryocloud.io so we can invite you to our application. You can find more information on how to get started here.

Do I need to install anything?

No - you really just need a (simple) computer, internet access and an internet browser. We took care of everything else. Read more on it here

How does your risk-free trial work?

If you are unsatisfied, you can cancel your plan within 30 days and we will refund you at 100%. You can deactivate the subscription from your account settings.

Frequently Asked Questions

If it's not covered here, please reach out to us.
…or start your free trial and see for yourself.

Is there a free trial?

Yes when you sign up, you'll get instant access to a 30-day free trial with full access to the CryoCloud web application. You'll receive 20 hours of compute time and 2 TB of storage. No setup or infrastructure needed. After the trial, you can upgrade to a paid subscription or contact us for custom plans no interruption to your data.

How can I start using CryoCloud?

Either go directly to out signup page or simply send us an email to hi@cryocloud.io so we can invite you to our application. You can find more information on how to get started here.

Do I need to install anything?

No - you really just need a (simple) computer, internet access and an internet browser. We took care of everything else. Read more on it here

How does your risk-free trial work?

If you are unsatisfied, you can cancel your plan within 30 days and we will refund you at 100%. You can deactivate the subscription from your account settings.

Ready to skip the queue?
Start analyzing your cryo-EM data today.

We would love hear about your cryo-EM goals and discuss how we can accelerate them.

  • No infrastructure needed

  • Streamlined onboarding & legal support

  • Highest security

Ready to skip the queue?
Start analyzing your cryo-EM data today.

We would love hear about your cryo-EM goals and discuss how we can accelerate them.

  • No infrastructure needed

  • Streamlined onboarding & legal support

  • Highest security

Ready to skip the queue?
Start analyzing your cryo-EM data today.

We would love hear about your cryo-EM goals and discuss how we can accelerate them.

  • No infrastructure needed

  • Streamlined onboarding & legal support

  • Highest security