Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Live database backup

    Discuss
    backups
    3
    3
    62
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • njts
      njts last edited by girish

      Hi,
      Something bothers me about the backup. Cloudron can be used to launch a variety of services, and many applications require a database.
      Some of these applications rely heavily on databases. Is it safe to backup these applications while they are running and the database is writing data?
      For example, I installed Rocket Chat. Someone is always texting, and the database is always busy. What are the chances of the database getting corrupted during the backup in this case?

      fbartels 1 Reply Last reply Reply Quote 0
      • fbartels
        fbartels App Dev @njts last edited by

        Hi @njts,

        database backup tools usually have mechanics to be "transaction safe" (MySQL for example has the "single transaction" parameter) meaning the backup is consistent to the moment the backup started.

        1 Reply Last reply Reply Quote 1
        • girish
          girish Staff last edited by

          The db dumps are atomic (it's a feature of the databases).

          What's not atomic is if an app does not make database changes in a transaction. Or if it tracks state outside of the database. For example, if it writes some media file to filesystem and tracks something else in database. Outside of disk snapshots, there is no way to snapshot a database and filesystem at the moment in time. Disk snapshot of a database is not very portable and in most cases on cloud servers disk snapshots of specific paths are not an option.

          I used to worry about this a lot back in the day 🙂 But hundreds of thousand of installation later, I can tell you that I have never hit this problem (the atomicity aspect).

          1 Reply Last reply Reply Quote 2
          • First post
            Last post
          Powered by NodeBB