Skip to main content
Version: Weekly Build

Babelfish

Babelfish provides a PostgreSQL-backed database endpoint with Microsoft TDS compatibility, which makes it suitable for workloads and tooling that expect SQL Server semantics.

PropertyValueNotes
Provider namebabelfishUse this in landscape provider definitions.
Versionv1Current schema version exposed by the provider.
CategoryDatabaseShown in the managed services catalog.
ScopeglobalAvailable at team scope rather than being tied to a single workspace runtime.
Team singletonfalseTeams can create multiple Babelfish service instances.
Pause supporttrueThis provider supports pausing.

Preview Feature

This provider is currently a preview feature. It is not enabled by default and needs to be enabled by your operator. As a preview, the provider is still evolving, its schema, plans, and behavior may change in the future.

Capabilities

CapabilitySupportedNotes
BackupsBackups are stored in the object store as native PostgreSQL physical backups, utilizing the standard PostgreSQL storage architecture.
Point-in-time recoveryThe database can be restored to a specific point in time.

Good to know

  • High availability is not yet available; the service runs as a single instance.
  • Upgrades are never applied automatically. Manual minor version upgrades are supported via the version config field.
  • Storage does not grow automatically, but you can increase the storage plan parameter manually at any time.

Architecture

Under the hood, a Babelfish service is the same managed PostgreSQL setup as the PostgreSQL provider — a dedicated PostgreSQL server powered by the CloudNativePG operator — with the Babelfish for PostgreSQL extensions installed and enabled. Babelfish adds a T-SQL dialect and a Microsoft TDS wire-protocol endpoint on port 1433, so SQL Server clients and drivers can connect directly.

  • Pinned version pairs: The version config field pins a compatible pair of PostgreSQL and Babelfish versions — for example, 17.6-5.3.0 is PostgreSQL 17.6 with Babelfish 5.3.0.
  • Shared foundation: Storage (replicated Ceph block storage), networking, and the backup mechanism are identical to the PostgreSQL provider.

Schema

Config

FieldTypeRequired on createNotes
versionstringNoCombined PostgreSQL and Babelfish version. Default: 17.6-5.3.0. Allowed values: 17.7-5.4.0, 16.11-4.8.0, 17.6-5.3.0, 16.10-4.7.0. Minor upgrades only.

Secrets

FieldTypeRequired on createNotes
superuserPasswordstringYesPassword for the administrative database user.

Details / Output

FieldTypeAvailabilityNotes
hostnamestringExposed after provisioningInternal service hostname.
portintegerExposed after provisioningTDS port.
dsnstringExposed after provisioningTDS connection string for the superuser against the master database.
readybooleanExposed after provisioningIndicates whether the instance is ready for connections.

Plan

The provider exposes one plan, Small (id: 0). Example plan: Small (id: 0).

ParameterTypeDefaultMinimumMaximumStaticNotes
cpunumber1--YesPriced as cpu-tenths.
memoryinteger128--YesPriced as ram-mib.
storageinteger1024512-NoPriced as storage-mib.

Example in a Landscape

schemaVersion: v0.2

run:
sqlserver-compatible-db:
provider:
name: babelfish
version: v1
plan:
id: 0
parameters:
storage: 2048
config:
version: "17.7-5.4.0"
secrets:
superuserPassword: "${{ vault.babelfishSuperuserPassword }}"

Within other runtimes, use the returned dsn directly with SQL Server compatible drivers, or use hostname and port with 1433-compatible tooling. That same internal endpoint is reachable from other Codesphere runtimes, including reactives, managed containers, and Virtual Cluster workloads.

Connecting to a Babelfish DB

Prerequisites

Once your Babelfish DB is deployed, you can connect to it from your Codesphere workspaces. Each service lists non-sensitive connection details in their respective settings page, in the overview tab (or in the details property in the public API payload).

info

Before connecting, make sure the service is synchronized and running: in the service settings, ready must be true.

Connecting via Terminal (tsql)

You can use tsql (part of the FreeTDS package) to connect. Note that tsql might need to be installed in your workspace.

# Install FreeTDS
nix-env -iA nixpkgs.freetds

# Syntax
TDSENCRYPTION=required tsql -H <hostname> -p 1433 -U <username> -D <database>

# Example
TDSENCRYPTION=required tsql -H ms-babelfish-v1-123-my-server.ms-postgres -p 1433 -U postgres -D master

Connecting via Node.js

Using the mssql library:

const sql = require('mssql');

(async () => {
const config = {
user: 'postgres',
password: 'superSecret',
server: 'ms-babelfish-v1-123-my-server.ms-postgres',
port: 1433,
database: 'master',
options: {
encrypt: true,
trustServerCertificate: false
}
};

await sql.connect(config);
const result = await sql.query`SELECT 1 as val`;
console.log(result.recordset[0].val);
})();

Backups

Since the underlying engine of a Babelfish service is a regular PostgreSQL server, backups work exactly like backups of the PostgreSQL provider: the CloudNativePG Barman Cloud plugin stores native PostgreSQL physical backups in your S3-compatible backup store and continuously archives the write-ahead log, enabling point-in-time recovery.

Configuration, recovery, required S3 permissions, and limitations are identical to PostgreSQL — see the PostgreSQL backup documentation for examples.