Istanza slave di Discourse con accesso offline

Contesto
Abbiamo un’istanza di Discourse ospitata nel cloud per la comunità Ruby australiana (la chiamerò Master). Due volte all’anno organizziamo eventi RailsCamp. In queste occasioni trascorriamo un intero weekend insieme in una località remota (50-150 persone per evento). Spesso c’è poca o nessuna copertura cellulare, il che rende difficile la coordinazione.

Stavo pensando che un’istanza di Discourse ospitata sulla rete locale durante l’evento sarebbe ideale (la chiamerò Slave). Potremmo utilizzarla per pubblicare annunci, programmi, condividere foto, ecc.

Dato che abbiamo già una comunità in crescita su Master, sarebbe ottimo sfruttarla. Ad esempio, il tuo profilo sarebbe già configurato quando arrivi all’evento e avresti una copia di tutto il contenuto.

Sfida
Come far funzionare l’istanza Slave di Discourse insieme a Master quando Slave è offline per tre giorni.

Soluzione proposta
So che Discourse non è progettato per questo scenario, ma penso che ci sia un modo per adattarlo alle nostre esigenze. Sono interessato alle vostre idee su questo.

Il piano:

  • Impostiamo un’istanza Slave di Discourse sulla rete locale durante l’evento.
  • Poco prima dell’evento, facciamo un backup di Master e lo ripristiniamo su Slave.
  • Su Slave:
    • tutte le categorie saranno contrassegnate come sola lettura;
    • creiamo una nuova categoria in scrittura/lettura per l’evento.
  • Dopo l’evento, utilizziamo uno script Ruby per trasferire le informazioni da Slave a Master:
    • nuovi utenti creati;
    • tutti i topic e i post della categoria creata per l’evento.
  • Risultato finale.

Domande

  • Vedete qualche problema con la soluzione proposta?
  • Potete immaginare un approccio migliore?

Sarebbe ottimo consentire l’accesso in scrittura a tutte le categorie su Slave, ma temo che il processo di sincronizzazione potrebbe diventare molto complicato. Inoltre, ciò potrebbe creare confusione, poiché alcune persone potrebbero ancora accedere a Master se hanno copertura.

4 Mi Piace

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.

8 Mi Piace

@antulik

Did you try anything for the same ?
I am into a similar thing where I need to take discourse offline with sync.
I have a master server and I will be having more than 100-200 slave instance. Slave instance can be online/offline but will be used by users. But whenever an offline instance comes online it should be able to sync with master server without creating conflicts and all update all the latest data. I do not want to create any code related changes as discourse keeps updating itself quite often and don’t want to break instance due to code changes.

I am thinking of tweaking postgresql to some extent. Other files related data can be synced using syncthing. But updating postgresql data is something which worries me because if i directly sync master data then the work done by offline user will get erased after the sync. How was your experience writing scripts for the same ?

1 Mi Piace

We didn’t do it yet as we had internet access at all event locations.