How DigitalOcean and Google Cloud compare for a backend with an API, Postgres, file storage and background work in November 2026: App Platform and Droplets versus Cloud Run, managed databases, queues, IAM and price.

DigitalOcean has a short product list, from Droplets and App Platform to managed databases and Spaces, that a developer can learn in an afternoon. Google Cloud has far more, and a backend there means picking and wiring Cloud Run, Cloud SQL, Pub/Sub and IAM.
The gap widens once the backend needs a queue, a second service and access rules. This guide compares them for a typical backend.
App Platform builds a repository or pulls an image and runs it as fixed-size containers billed per month, with CPU-based autoscaling, workers and jobs as component types, and a spec file that describes all components together. Cloud Run runs containers that scale on concurrent requests, to zero by default, with request-based billing per vCPU-second and GiB-second while requests are active. A steady API with a few hundred requests a minute is cheaper and simpler on App Platform, and an API with quiet nights and busy mornings often costs less on Cloud Run, which includes a free monthly allowance.
DigitalOcean Managed PostgreSQL starts at a single node, adds standby nodes for failover and keeps daily backups with point-in-time recovery for seven days. Cloud SQL for PostgreSQL offers shared-core instances for development and dedicated-core instances with high availability, read replicas, IAM database authentication and private IP access from Cloud Run. Both handle patching and backups, and Cloud SQL's extra pieces, especially IAM authentication and private networking, matter more once several services share a database.
DigitalOcean has no serverless message service, so background work runs as an App Platform worker reading from managed Valkey with BullMQ, Celery or Asynq, or from managed Kafka for higher volumes, and each of those is a cluster with a size and a monthly price. Google Cloud Pub/Sub has no brokers to size, bills per volume of messages, and can push each message to a Cloud Run service with retries and a dead-letter topic. For a backend that publishes events to several consumers, that is the largest practical difference between the two.
DigitalOcean controls access through team roles and API tokens, and an app reads database credentials from environment variables that App Platform injects. Google Cloud gives each service its own service account, and IAM roles decide whether that account can publish to a topic, read a bucket or connect to a Cloud SQL instance. That is more setup, and it is what lets a security review answer which service can touch which data.
Encore brings infrastructure from code, so a backend's services, Postgres databases, buckets and Pub/Sub topics are declared in application code and provisioned on deploy. Per the GCP infrastructure docs, deploying to GCP runs the services on Cloud Run with Cloud SQL, Cloud Storage and Pub/Sub in your own project, and Encore provisions a service account for the service. If you would rather run on DigitalOcean, encore build docker produces an image for App Platform, as the DigitalOcean deployment guide shows, with your own scheduler calling any cron endpoints.

Run in your terminal to get started locally.
An uploads service with a database, a bucket and a topic that a thumbnail worker or a search indexer can subscribe to:
// uploads/uploads.go
package uploads
import (
"context"
"strconv"
"time"
"encore.dev/pubsub"
"encore.dev/storage/objects"
"encore.dev/storage/sqldb"
)
var db = sqldb.NewDatabase("uploads", sqldb.DatabaseConfig{
Migrations: "./migrations",
})
// Cloud Storage on GCP, a local directory under encore run.
var Files = objects.NewBucket("user-files", objects.BucketConfig{})
type FileUploaded struct {
FileID int64
Key string
}
// Pub/Sub on GCP. Other services subscribe without this one changing.
var Uploaded = pubsub.NewTopic[*FileUploaded]("file-uploaded", pubsub.TopicConfig{
DeliveryGuarantee: pubsub.AtLeastOnce,
})
type UploadURL struct {
FileID int64
URL string
}
type NewFile struct {
Name string
}
// CreateUpload returns a signed URL the browser uploads to directly.
//
//encore:api public method=POST path=/files
func CreateUpload(ctx context.Context, p *NewFile) (*UploadURL, error) {
var id int64
if err := db.QueryRow(ctx,
`INSERT INTO files (name) VALUES ($1) RETURNING id`, p.Name).Scan(&id); err != nil {
return nil, err
}
u, err := Files.SignedUploadURL(ctx, keyFor(id), objects.WithTTL(15*time.Minute))
if err != nil {
return nil, err
}
return &UploadURL{FileID: id, URL: u.URL}, nil
}
// Complete is called by the browser after the upload finishes.
//
//encore:api public method=POST path=/files/:id/complete
func Complete(ctx context.Context, id int64) error {
res, err := db.Exec(ctx,
`UPDATE files SET uploaded_at = now() WHERE id = $1 AND uploaded_at IS NULL`, id)
if err != nil {
return err
}
if res.RowsAffected() == 0 {
return nil // already completed
}
_, err = Uploaded.Publish(ctx, &FileUploaded{FileID: id, Key: keyFor(id)})
return err
}
func keyFor(id int64) string {
return "files/" + strconv.FormatInt(id, 10)
}
-- uploads/migrations/1_init.up.sql
CREATE TABLE files (
id BIGSERIAL PRIMARY KEY,
name TEXT NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
uploaded_at TIMESTAMPTZ
);
The uploaded_at IS NULL guard publishes the event once even if the browser calls Complete twice. The object storage docs cover signed upload URLs, and the Pub/Sub docs show how a second service subscribes to file-uploaded. With encore run, Postgres starts locally, the bucket is a local directory and the topic delivers to subscribers on your machine, the same shape that runs on GCP.
The database, bucket and topic sit in the service code, so a coding agent that adds a thumbnail subscriber or a new table works in one repository and sees it run locally, with the GCP side created on the next deploy rather than in the console.
Best fit: Backends that want Google Cloud's managed Postgres, Pub/Sub and IAM in their own project with the setup effort closer to DigitalOcean's.
Pick DigitalOcean for a small backend with steady traffic, one database and a team that values a short product list and a flat monthly bill. Pick Google Cloud when the backend needs serverless messaging, per-service access control, more regions or scale-to-zero billing, and you have the time to wire those services. Pick Encore if you want Google Cloud underneath with services, databases and topics declared in code.
Yes. For a small, steady backend, App Platform's per-container monthly bills and managed Postgres are typically more predictable. For spiky or low traffic, Cloud Run can cost less, since it bills only while requests are in flight and includes a free monthly allowance.
No. DigitalOcean has no direct equivalent, and offers managed Kafka and managed Valkey, which you can use as a queue with a library, while Google Cloud Pub/Sub is a serverless message service with push and pull subscriptions, retries and dead-letter topics and no brokers to size.
Yes. Both deploy containers from a repository or a registry and scale horizontally. App Platform bills per container size per month and autoscales on CPU, while Cloud Run bills per second of use, scales on concurrent requests and can scale to zero.
With Encore you declare services, Postgres databases, Pub/Sub topics and buckets in application code, and deploying to GCP provisions Cloud Run, Cloud SQL, Pub/Sub and Cloud Storage in your own project. Locally, encore run starts the same setup on your machine.
Deploy to your cloud on AWS and Google Cloud
without managing infrastructure
Encore lets developers and agents define application infrastructure directly in code, then automatically provisions it from local development to production in your AWS or GCP account.