

"Give me the 100 most recent messages" / syncing channel posts in buddycloud - imaginator
http://buddycloud.com/cms/content/%E2%80%9Cgive-me-100-most-recent-messages%E2%80%9D-or-why-message-synchronisation-so-difficult-open-social-n

======
jfoutz
step 7 would be a lot nicer with message estamates.

Even a poor estimate will reduce the amount of data you have to shuffle around
a lot. Just a simple moving average of the last 5 posts would give great
results.

something like

    
    
      for(Channel c : channels)
      {
        messages = c.requestLastNMessages(estimateForChannel(c))
        c.messagesPerHour = requestsPerHour(messages)
        totalMessagesPerHour += c.messagesPerHour
      }
    
      for(Channel c : channels)
      {
        updateEstimate(c, Math.max(5,c.messagesPerHour/totalMessagesPerHour))
      }
    

I think you want to keep the moving average in case something bad happens. a
buddy might update once a week, but after an accident or something, might
update very quickly. you'll want to track that.

~~~
imaginator
I think the solution is to build caching into the "home server" - it keeps a
copy / can quickly retrieve messages from a remote server.

