News for hackers. Stuff that matters.
Re:Ask HN: How hard is it to build a B2C chat? by solardev on Wednesday June 05, 2024 @10:42AM (#40585407)
Cloudflare has a simple example of building real time chat using their infra: https://developers.cloudflare.com/workers/tutorials/deploy-a... (and source code for the actual app: https://github.com/cloudflare/workers-chat-demo)

Doing this with serverless might be a lot easier than building the global network & edge infra on your own.

But a real version would need to add a lot more, like auth, rotations (who on the merchant side is supposed to answer), status tracking, image management, linking to tickets and emails, etc.

It's a lot of work. But it also sounds like it'll be core functionality for you guys, an integral part of a multi tenant B2C platform. Maybe you can start with a vendor solution for a few months, gauge reactions from both the merchants and their customers, and use that to inform whether to build your own (and what features to add, if so?)

Re:Ask HN: How hard is it to build a B2C chat? by edweis on Wednesday June 05, 2024 @10:58AM (#40585656)
We are using AWS ecosystem and found it was cumbersome to do a websocket MVP with lambdas and API Gateway. We'll check cloudflare's implementation.

Front end is not an issue, we need reliability and performance. Using Cloudflare D2 is also appealing.

Re:Ask HN: How hard is it to build a B2C chat? by solardev on Wednesday June 05, 2024 @11:14AM (#40585906)
In general I've found Cloudflare dramatically easier to work with than AWS (as an individual dev, maybe not as a billing admin or whatever). Their services and APIs are a lot better thought out and documented, IMO, and their serverless stack in particular seems stronger than AWS's.

Just anecdotal though. I have no data to back this up and this isn't my area of expertise. Good luck!

Re:Ask HN: How hard is it to build a B2C chat? by edweis on Wednesday June 05, 2024 @11:51AM (#40586446)
I am a Cloudflare fan. I wish there wrangler deployement was easier, I tried to get into it three times and every time I encounter an issue (typescript compilation or missing dependency).
Re:Ask HN: How hard is it to build a B2C chat? by toast0 on Thursday June 06, 2024 @01:52AM (#40593949)
> Doing this with serverless might be a lot easier than building the global network & edge infra on your own.

You don't need a global network and edge for a basic b2c chat. Yes it makes a difference in UX when everyone has to exchange messages through your servers in us-east instead of something closer, but the difference is so small it hardly matters unless you're being compared against a messenger that's highly focused on message latency, most are not.

Re:Ask HN: How hard is it to build a B2C chat? by solardev on Thursday June 06, 2024 @10:37AM (#40597943)
My opinion/bias is that small companies shouldn't continuously reinvent the wheel and sacrifice end user UX just to keep things in house. I've been at so many companies that insisted on building some shitty in house version of some commonly available thing, done with minimal QA and scaling and UX design. A couple years later it has to be completely rewritten anyway but the people involved in its initial implementation are all gone and a bunch of new mistakes are made. If it's not a core business function / major feature, why not outsource it, if not at the app level, at least the platform level?

It's just another facet of the on premise vs cloud discussion, really. But having a single VM handle global multi tenant chat seems like a good way to ensure headaches later on, when it's harder to change things already in prod with existing customers...

Re:Ask HN: How hard is it to build a B2C chat? by toast0 on Thursday June 06, 2024 @12:47PM (#40599571)
Running ejabberd isn't reinventing the wheel though. And it's a battle tested approach to building a chat service, weather it stays on ejabberd or morphs into something else. IMHO, better than getting locked into a single vendor system.