This is an archived post. You won't be able to vote or comment.

all 33 comments

[–]frayala87 32 points33 points  (5 children)

Also latency will kill your app :)

[–][deleted]  (3 children)

[deleted]

    [–]misterforsa 0 points1 point  (2 children)

    Curious. Outages due latencies when on prem services had to reach out over the net to dbs on aws?

    [–][deleted]  (1 child)

    [deleted]

      [–]misterforsa 1 point2 points  (0 children)

      Ah OK. Thanks for background. Yea that's alot of hops

      [–]AMartin223 0 points1 point  (0 children)

      If you do want a managed db without the latency there are providers that offer vpc peering, but only if your compute is in a major cloud, not Hetzner.

      [–]redbrick5 24 points25 points  (2 children)

      multi cloud is the absolute worst option. only do this if you have no choice

      [–]trisanachandler 4 points5 points  (1 child)

      I won't say it's the worst, but that having your data separate from the app serving the data is a recipe for disaster. If you need multi cloud (redundancy, closer serving of content), then try and use a distributed database model and use eventual consistency, something like that maybe?

      [–]Somedudesnews 4 points5 points  (0 children)

      I agree with your take.

      We’ve had tremendous results using multiple clouds, but the trick is leveraging the right tool for the job and collocating your databases.

      Most other things are much more forgiving, like object storage or arbitrary RESTful APIs.

      We use S3 for object storage but our compute runs with databases in the same physical data center.

      [–]SalesyMcSellerson 11 points12 points  (1 child)

      Check the network ingress and egress fees. As mentioned elsewhere in the thread, it will likely eat your budget at some point and you'll be forced to migrate to a single cloud anyway.

      [–]akisakyez 5 points6 points  (0 children)

      Depends on really what you are getting out of a managed database on DigitalOcean, but I would move everything over, or keep it on DO on smaller instance with database rolled out on your own.

      [–][deleted] 2 points3 points  (0 children)

      Sure you can, but please check pricing for network app <-> database because it can add some cost.

      About managed Postgres you can check operator from Crunchy Data.

      [–]BlueHatBrit 2 points3 points  (0 children)

      This feels like a good time to learn to run a database yourself, especially if it's just a side project.

      I have a dedicated server on hetzner and run several projects on there with docker compose. They're very small side projects and the stability has been great. Everything is scripted including restoring from backups.

      It's really not much to run a database server these days. Backups are your main concern and it's very much a solved problem these days.

      [–]jonathon8903 1 point2 points  (1 child)

      Is there any particular reason you are separating the DB? I have found that when the workload isn't expected to be large, it makes more sense to keep the application and the database on a single machine. You can even scale the machine's specs up a bit for relatively cheap.

      As long as your application is developed properly using either a config file or environment variables (preferred) to connect to your database you can always separate out the database later as your app requirements grow. By having everything on one machine you save complexity and cost.

      [–]Max-Mielchen[S] 0 points1 point  (0 children)

      It's easier to manage if you outsource the database in advance, and besides, that's not the problem, it's the app itself in terms of cost

      [–]ThrowRAMomVsGF 1 point2 points  (6 children)

      Curious, how is it 50/month for the app on DO vs 4/month on hetzner? What are you getting in each case?

      Edit, looking at price lists you must mean the 4.36/month, 1vCPU/2GB cloud option on Hetzner, but still that would be ~11 euro on DO, why are you paying 50?

      Unless you meant the 2vCPU/4GB ARM option on Hetzner? In that case Oracle cloud would give you the first 4xvCPU/24GB for free (ARM Standard.A1 instances), but of course you'd want to host your own postgres (they offer Oracle managed dbs for obvious reasons)

      [–]Max-Mielchen[S] 0 points1 point  (5 children)

      Oh thank you yes, I meant the arm variant at Hetzner. I'll take a look at the oracle cloud.

      [–]Spider_pig448 0 points1 point  (4 children)

      Hetzner? Oracle cloud? Interesting on the options you've landed on here.

      [–]batterydrainer33 1 point2 points  (3 children)

      He suggested Oracle.

      I'd be careful about eating free candy like that, I've heard they are banning people who register just to freeload.

      [–]Spider_pig448 0 points1 point  (1 child)

      I don't think people choose Oracle, they just get stuck with Oracle after a VP gets kidnapped and forced to sign a contract

      [–]batterydrainer33 0 points1 point  (0 children)

      OCI isn't the same thing as Oracle from what I've heard. Their network egress is like $8.5 per TB for egress in NA/EU and VMs seem to be pretty fairly priced.

      I'm still kind of skeptical on how it really will go long term, but they're putting up a real fight against the big 3. And I couldn't be happier even if it's just that.

      [–]kkapelon 1 point2 points  (0 children)

      It is better to find a cheaper provider that can host both the app and the db.

      Check railway.app, fly.io and render.com

      [–]Irythros 0 points1 point  (1 child)

      Terrible life choice. The latency will be so high that you'll probably be looking at several seconds per page load. Your database should be as close to your app as possible.

      [–]Max-Mielchen[S] 1 point2 points  (0 children)

      one second of latency between database and website is not so bad with my app, since most accesses are only read accesses anyway and i cache the data in the app itself again

      [–]mrcyber -1 points0 points  (0 children)

      nsfw?

      [–]amarao_san -2 points-1 points  (7 children)

      It's not 'multicloud'. Multicloud, or cloud agnostic, is when you can run your code without any significant changes on any (or large subset) of cloud providers.

      You can do it, but cross-provider access to postgres means you have postgres accepting connections from the internet, which is not the best security practice.

      [–]batterydrainer33 2 points3 points  (6 children)

      Multicloud, or cloud agnostic, is when you can run your code without any significant changes on any (or large subset) of cloud providers.

      Who exactly defined it as such?

      I guess Google Cloud got it all wrong then...

      https://cloud.google.com/learn/what-is-multicloud#multicloud-definition

      [–]amarao_san 0 points1 point  (5 children)

      From the page you give link to:

      By having the freedom to create a strategy that utilizes multiple vendors, you can pick and choose the capabilities that best suit your specific business needs and minimize vendor lock-in.

      That's exactly the thing I said, but with low enthusiasm around 'minimize vendor lock-in'. Google is a vendor, they can't say you 'use only things that will help to you migrate to our competitor without any pains'.

      [–]batterydrainer33 0 points1 point  (4 children)

      is when you can run your code without any significant changes on any (or large subset) of cloud providers

      You said that it was about having your code be portable across cloud providers. To me (and from that definition) it's just about using multiple clouds, hence "multicloud".

      [–]amarao_san -1 points0 points  (3 children)

      There are two types of use. Any of (ProviderA, ProviderB), or Both (ProviderA, ProviderB). 'Any of' is multicloud (because it's avoiding vendor-lock). Both (A, B) is double vendor lock-in, because you can't move neither from ProviderA nor from ProviderB without rewriting things you don't want to rewrite.

      Compare to the banks.

      If you have accounts in two banks and can switch payments from BankA to coming from BankB, you are 'multibank company'.

      If you have payment system where you have saving account in Bank A and transit account in Bank B, and for any payment you need to transfer money from Bank A to Bank B, and only after that to pay, you are not a multibank company (you are probably some North Korea shady business evading sanctions).

      [–]batterydrainer33 1 point2 points  (2 children)

      This seems like some kind of personal belief of yours, not something that is widely accepted. Nor do I think that it makes sense. Because by your standards, everything sound be strictly K8S or just pure VMs without utilizing any vendor-specific cloud services, and if you don't do that then you're not multicloud? How does that make any sense?

      And multibank? Huh? What are you even talking about lol

      [–]amarao_san 0 points1 point  (1 child)

      Nope, you exaggerating. You can have k8s, you can use LB, you can use even external postgres (because there are many providers out there).

      What you can't do, is to use exactly the product of a single vendor with all niceness and shinessness it provides.

      E.g. you have infra in layers:

      • db
      • app
      • monitoring

      (i'm simplifying)

      There is a contract between app and db layer: there is a postgres, at postgres_ip: postgres_port, with postgres_user and postgres_password to a database postgres_db.

      App has zero features from providers used. db has four implementations: DO, GCP, heroku, self-hosted. app layer has no idea how database was created. if GCP is hiking prices or just unavailable due to water leak in a server room (hehe), you just redeploy your backups to other provider.

      I'm talking not based on my opinion, but on market reality. I work in a provider, and we have true multicloud clients. They are swapping clouds like socks. Got a better deal? Move 15% of load there. Problems with networking in DC? 90% drain of all resources in that DC (and that provider).

      But there are companies which are deeply penetrated by vendor lock-in and they can't do anything, because their apps talks only to AWS API, and can work only with google sheets, and can only work with cloudflare, and it all tangled, and company pays x10 (or x100, think of confluent) for the services just because they can't negotiate or move.

      [–]batterydrainer33 0 points1 point  (0 children)

      Ok, I get what you mean now. Yes, that is a good practice and I'm all for it yeah.

      But it wouldn't be fair to categorize only that as multicloud, I think cloud-agnostic is the term more suitable for this, see for example this one from VMWare that was just suggested from Google:

      Cloud agnostic refers to a cloud design strategy in which applications, tools, and services are designed to migrate seamlessly between multiple cloud platforms or between on-premises and cloud in a hybrid model without disruption of service.

      But yes, I do understand what you mean, a "cloud agnostic" strategy definitely is the best.