Live data from Hacker News

Making Direct Messages Reliable and Fast

instagram-engineering.com

1–10 of 26 posts

Re: Making Direct Messages Reliable and Fast

#3
Great write up! I have a few questions if anyone familiar with the development can share: 1. How do you handle trust-buster issue: users see a message go through only to check back an hour later that it’s not. 2. For this to work, all components must adhere to this same pattern. How did you handle the migration plan? 3. Seems like something that can work across platform. Any thoughts on c++ layer between android and iOS? Or Facebook tends to go at it platform-focused.

Thank you!

Re: Making Direct Messages Reliable and Fast

#4
This seems a lot like an eventually-consistent database. I think you could accomplish something similar with something like CouchDB or Firebase that provide conflict resolution between local and server state automatically. I'm wondering what the advantage is here?

Re: Making Direct Messages Reliable and Fast

#5
If anybody else needs this kind of system, most GraphQL clients (at least in the JavaScript ecosystem) handle all of this out of the box or can be extended to work this way with minimal effort.

They have a client-side cache for the whole app that you can optimistically update, all network requests run through that, it handles rolling the updates back when responses come in, etc.

Examples in the JS ecosystem that I am familiar with include Apollo and Relay, and urql is working on this.

Re: Making Direct Messages Reliable and Fast

#7
post #3

Great write up! I have a few questions if anyone familiar with the development can share: 1. How do you handle trust-buster issue: users see a message go through only to check back an hour later that it’s not. 2. For this to work, all components must adhere to this same pattern. How did you handle the migration plan? 3. Seems like something that can work across platform. Any thoughts on c++ layer between android and…

I guess it is handled by a state like ‘sending’. So when you send a message, initial update before sending the request in UI is showing a ‘sending icon’

Re: Making Direct Messages Reliable and Fast

#10
post #5

If anybody else needs this kind of system, most GraphQL clients (at least in the JavaScript ecosystem) handle all of this out of the box or can be extended to work this way with minimal effort. They have a client-side cache for the whole app that you can optimistically update, all network requests run through that, it handles rolling the updates back when responses come in, etc. Examples in the JS ecosystem that I am…

> If anybody else needs this kind of system, most GraphQL clients

Well, the client is probably the easiest and the most boring piece of the puzzle. What you do in the backend matters.

Post reply on HN