App platform - run database as service

Posted August 12, 2021 210 views

Is a service type component suitable for running a database, or does it lack permanent storage? I need to run ArangoDB.

If yes, how do I make a connection from the component running my app? I’ve tried listing a port under internal_ports for the database component, but I’m not able to connect.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

👋 @tomfa0db012303b44908d6f5f5

Hosting a DB in an App Platform service is not recommended because components run in ephemeral containers. For example, if the underlying hardware breaks we will automatically move your service to another, though it’s a new container and does not persist any data.

In this case you may want to look into using a Droplet to host your database and have your App hosting in App Platform.

Hope this helps!

  • Thanks very much for the quick reply. I’m looking into installing the DB on a droplet. Is it possible to have the droplet and the app in the same private network? Failing that I guess I can at least have them in the same region.

    This is for a dev prototype at the moment so I might just put the whole thing in the droplet.

    • App Platform does not support VPC’s yet. We are definitely working towards that in the future (though I can’t give a time estimate). If private networking is a requirement then a droplet may be a better option.

      Hope this helps!

      • The reason I was asking was mainly about performance. It’s much better of course if the app and the database are on the same network. I guess if they are in the same region then that means the same datacenter, so it should be a pretty fast connection?

        • Yup! Colocating your DB and App in the same region should provide the best performance.

          I’m not sure if a private networking would offer even more performance, though I imagine it might, I doubt it’d be that much.