Skip to main content

Full-Text Search with Managed OpenSearch: From Zero to Production

· 7 min read
FoundryDB Team
Engineering @ FoundryDB

Every application eventually outgrows LIKE '%query%'. Once your product catalog, help center, or log pipeline crosses a few million documents, you need an inverted index, not a sequential scan. OpenSearch provides exactly that: full-text search with relevance scoring, custom analyzers, aggregations, and a visualization layer built in.

The hard part is running it. JVM heap tuning, cluster formation, TLS certificate management, shard rebalancing, and snapshot configuration turn a "quick search feature" into a permanent ops project. FoundryDB removes all of that. You get a managed OpenSearch 2.19 cluster with TLS, authentication, automated snapshots, and monitoring out of the box.

This guide walks through deploying OpenSearch on FoundryDB and building production-quality search: from provisioning to index design, full-text queries, custom analyzers, and aggregations.

OpenSearch cluster, query fan-out & gather
Cluster green · search fans out to one copy per shard, then gathers
Coordinatorfan-out / gatherquery →Data nodesP0 P1 P2 · R0 R1 R2⇠ hitsCluster-managershard allocation
Cluster-managerCoordinatorData nodePrimary shardReplica shardcluster state / gather (dashed)

Scaling Reads with PostgreSQL Read Replicas on FoundryDB

· 6 min read
FoundryDB Team
Engineering @ FoundryDB

Most PostgreSQL workloads are read-heavy. Dashboards, reporting queries, search, and API endpoints that serve cached-but-still-queried data all put pressure on a single primary. Vertical scaling helps, but at some point you are paying for CPU that only writes use while reads compete for the same connections.

Read replicas solve this by giving you additional PostgreSQL nodes that serve read queries from a continuously updated copy of your data. On FoundryDB, adding a replica takes one API call and a few minutes of provisioning time.

Streaming replication & automatic failover
Streaming replication · writes to primary, reads to replicas
DNS endpointstable namewrites →Primaryread-write⇢ WALReplicasread-only⇢ archivepgBackRestPITR
Writes (primary)Reads (replicas)WAL streamingWAL archive (PITR)Promoted primary

Predictive Autoscaling: Scale Your Database Before Demand Spikes

· 7 min read
FoundryDB Team
Engineering @ FoundryDB

Reactive autoscaling has a fundamental problem: it waits for something to go wrong. Your database hits 95% CPU, the autoscaler wakes up, requests a resize, and for the next few minutes your application eats latency while the new resources come online. If your traffic is predictable (and most production traffic is), this delay is avoidable.

FoundryDB's predictive autoscaling engine learns your workload's seasonal patterns and scales your database before demand spikes arrive. It combines real-time metric thresholds with historical baselines, anomaly detection, and configurable cost limits so you stay fast without overspending.

Vertical scaling: hot vs cold resize · online storage grow
GROW tier-4 · disk grown 200 GB · online
Servicetier-4 · 4 vCPU / 8 GBhot resize →New plan4 vCPU / 8 GBgrow only →Data disk200 GB · online
Service (resizing)New compute planReachable · online growReboot blip (cold)Data diskmounted volume (dashed)

Databases as Code: Managing FoundryDB with Terraform

· 7 min read
FoundryDB Team
Engineering @ FoundryDB

Most teams manage their application infrastructure as code but still create databases by clicking through a dashboard. The database becomes the one piece of production infrastructure that has no audit trail, no PR review, and no reproducible setup. When someone asks "why is the production database on tier-4 instead of tier-6?" the answer is usually "someone changed it last year."

The FoundryDB Terraform provider closes that gap. You declare your database services, users, and firewall rules in HCL, version them in git, and apply changes through the same CI/CD pipelines you use for everything else.

POST /projects/deploy, dependency-ordered reconciliation
RUNNING all resources provisioned · env wired
DescriptorPOST /deployfan-out →postgresRunningfilesRunningDATABASE_URL · S3_* · FOUNDRY_API_TOKEN →appRunning
DescriptorPendingProvisioning / wiringRunningDATABASE_URLS3_*auth issuer

Getting Started with Valkey: Sub-Millisecond Caching for Your Application

· 6 min read
FoundryDB Team
Engineering @ FoundryDB

Most applications hit a performance wall that has nothing to do with their code. The database query that takes 50ms works fine until you are serving 10,000 requests per minute and your connection pool is saturated. Adding an in-memory caching layer drops that response time to under a millisecond and takes the read load off your primary database.

Valkey is the open-source, Redis-compatible in-memory data store that the community rallied behind after Redis changed its license in 2024. It is wire-compatible with Redis, which means your existing Redis clients, libraries, and tooling work without modification. No license concerns, no vendor lock-in, and active development under the Linux Foundation.

This guide walks through provisioning a managed Valkey instance on FoundryDB and implementing common caching patterns in Python, Node.js, and Go.

Valkey replication & Sentinel failover
FAILOVER Replica promoted · clients redirected :6380
ClientsTLS :6380redirected →Primary (new)promoted⇢ repl :6379Replica 2read-only
Primary (rw)Replica (read-only)Promoted primarySentinelRDB / AOFClient TLS :6380 (public)SDN-internal :6379 (dashed)