async function createCouchbaseCluster() {
  if (cached.conn) {
    return cached.conn;
  }

  cached.conn = await couchbase.connect(
    "couchbase://" +
      COUCHBASE_ENDPOINT +
      (IS_CLOUD_INSTANCE === "true"
        ? "?ssl=no_verify&console_log_level=5"
        : ""),
    {
      username: COUCHBASE_USER,
      password: COUCHBASE_PASSWORD,
    },
  );

  return cached.conn;
}
Global is used here to maintain a cached connection across hot reloads
in development. This prevents connections growing exponentially
during API Route usage.