Persistent memory, scaling, backups, and cron

Hey All,

Was extremely impressed by the work Jenn Schiffer has done getting Ghost working on glitch. After reviewing how it was implemented I had some questions about what’s going on under the hood

  1. How is persistent memory handled?

Changes to the local file system are available in between runs (including cold starts). What would be the best mental model to think about this persistent memory. Any insight into how this is accomplished? Is this related to docker snapshots?

  1. How are glitchs scaled?

This is closely tied to 1. Do glitchs scale at all? Is there only ever a single instance? If there is only ever a single instance that could help explain how persistence is accomplished. If not I’m very interested in how persistent memory is managed across horizontally scaled instances

  1. Backups

This builds upon the last 2 questions, but what are the best practices for backing up projects. I recognize that y’all keep things persistent between sessions, but are there best practices for backing up data through multiple runs? Could periodic archives of the file system be made? How would you advise backing up periodically?

  1. Cron

Building on the question of backups. is there a best practice for periodic work being done on the system (such as a backup)? It seems like it could be hacked into the npm start -> but it wouldn’t be super reliable.

Let me know if you want me to open separate threads.

Hi MylesBorins!

  1. Memory is not persistent - if you leave a Glitch project alone long enough it will go to sleep, and whatever is in memory will be lost. Yes, the file system is persistent.

  2. Yes, a Glitch project does not scale.

  3. A Glitch project has a Git repo associated with it, which is how Glitch Rewind works. If that is not sufficient backup security, you can also download the project, or upload it to another Git hosting site.

  4. You can use a service such as UptimeRobot to ping your Glitch project periodically, such as daily, if you wanted to do something periodically?

Hope this helps,