Discourse slave instance with offline access

Background
We have cloud hosted discourse instance for the Australian Ruby community (I’ll refer to it as Master). Twice a year we host RailsCamp events. That’s when we spend a full weekend together at a remote location (50-150 people per event). Often there is little to no cell reception, which makes it challenging to coordinate.

I was thinking that discourse instance hosted on the local network at the event would be ideal (I’ll refer to it as Slave). We could use it to post announcements, schedule, share photos etc.

Since we already have growing community on Master, it would be great to leverage that. E.g. your profile is already setup when you get to the event, and you have a copy of all of the content.

Challenge
How to have the Slave discourse instance running along the Master when the Slave is offline for three days.

Proposed solution
I understand discourse is not designed for that. But I think there is a way to fit to our needs. I’m interested in your ideas on this

The plan

  • We setup a Slave discourse instance on the local network at the event
  • Right before the event we backup the Master and restore it on Slave
  • On Slave:
    • all categories will be marked as read-only
    • we create a new read/write category for the event
  • After the event we use a ruby script to transfer information from Slave to Master
    • Newly created users
    • All topics and posts from the created category for the event
  • Profit

Questions

  • Do you see any issues with the proposed solution?
  • Can you see a better approach?

Would be great to allow write access to all categories on Slave, but I feel the synchronisation process could be very complicated. Also that could be confusing as some people could still access Master if they have reception.

Hello from a fellow Australian Rubyist… :wave:

This all sounds fine to me. To sync stuff up after the event I would recommend writing a small script that zooms through your read write categories and then makes API requests using our JSON API to create the topics / posts on the master.

I definitely recommend strongly against having any kind of merge topic scenario, it will be full of dragons and not worth the effort.

@antulik

같은 문제를 해결하기 위해 어떤 시도를 해 보셨나요?
저도 비슷한 작업을 하고 있는데, sync를 통해 Discourse를 오프라인으로 전환해야 합니다.
마스터 서버가 하나 있고, 슬레이브 인스턴스가 100~200개 이상 있을 예정입니다. 슬레이브 인스턴스는 온라인/오프라인 상태가 될 수 있지만 사용자가 계속 이용할 것입니다. 다만 오프라인 상태였던 인스턴스가 다시 온라인으로 전환되면 충돌 없이 마스터 서버와 동기화되어 최신 데이터가 모두 업데이트되어야 합니다. Discourse는 자주 업데이트되므로 코드 관련 변경 사항은 만들고 싶지 않으며, 코드 변경으로 인해 인스턴스가 깨지는 것을 원하지 않습니다.

PostgreSQL을 어느 정도 조정하는 방안을 고려하고 있습니다. 기타 파일 관련 데이터는 syncthing을 사용하여 동기화할 수 있습니다. 하지만 PostgreSQL 데이터를 업데이트하는 부분은 걱정이 됩니다. 마스터 데이터를 직접 동기화하면 오프라인 상태에서 사용자가 수행한 작업이 동기화 후 지워질 수 있기 때문입니다. 같은 문제를 해결하기 위해 스크립트를 작성하면서 어떤 경험을 하셨는지 궁금합니다.

모든 행사 장소에서 인터넷 접속이 가능했기 때문에 아직 진행하지 않았습니다.