How we got chat working between two backend systems
At PDP Mobile, we built two-way chat synchronization between our system and an external CRM: polling every 10 seconds, locks, a DB fallback, and automatic UI updates via WebSocket.

At PDP Mobile, we had the classic integration setup: chat exists in both our system and the external CRM, and the user needs one continuous conversation, without any “please refresh the page” magic. So we built two-way synchronization between PDP and the CRM.
Here’s how it works: every 10 seconds, we run Redis-based polling and check the CRM for new messages. To avoid duplicates and chaos on the level of “two backends arguing over who is in charge,” we added locks: only one worker can run the poll at a time.
There are two message sources: — the external CRM API as the primary path; — direct reads from the client CRM database as a fallback, if the API suddenly decides to take a vacation.
The frontend is just as smooth: on a WebSocket event, we automatically update the RTK Query cache, so new messages appear in the UI almost seamlessly.
In an era where everyone is chasing real-time UX, resilience is no longer a “nice to have” — it’s the baseline. We learned that firsthand