How to Configure SingleStore Replication User

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up a singlestore replication user by making a dedicated database account. Then you grant this account cluster sync rights and strict host limits. Many engineering teams take a shortcut and use a full admin role instead. This broad role lets any person or script change data or drop tables. A least-privilege setup stops bad queries from breaking your main or backup clusters. How a singlestore replication user works SingleStore copies data from a primary cluster to a secondary cluster fo

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

You set up a singlestore replication user by making a dedicated database account. Then you grant this account cluster sync rights and strict host limits. Many engineering teams take a shortcut and use a full admin role instead. This broad role lets any person or script change data or drop tables. A least-privilege setup stops bad queries from breaking your main or backup clusters.

How a singlestore replication user works

SingleStore copies data from a primary cluster to a secondary cluster for safety. The secondary cluster logs in to the primary cluster to pull transaction logs. It uses the dedicated singlestore replication user account to read these ongoing changes. First, an admin creates the account on the primary aggregator node. The admin locks the account to the exact IP address of the secondary cluster. Next, the admin assigns only the cluster sync permissions needed to read logs. This account does not need permission to write data or change table schemas. Once the user exists, the team starts the replication process on the secondary side. The secondary cluster stores the password and pulls updates as they happen. If you add new databases later, you grant the account read rights on them. You should also turn on encrypted transport so passwords do not travel in plain text. Teams must rotate the account secret on a set schedule to keep clusters safe.

What native grants solve and what they miss

Native database roles do a good job of locking down cluster-to-cluster links. Host restrictions stop external machines from logging in with the sync account. Scoped permissions keep the secondary cluster from writing data back to the primary node. Still, static database grants only check who logs in at the start. They do not inspect what individual queries do during a live human session. Admins still log in to the primary and secondary clusters to fix sync lag. During an outage, engineers share high-level database accounts to check replication status. Once an admin logs in, the database allows every command tied to that role. A tired engineer can run a drop command on the wrong cluster by mistake. Also, shared database accounts make audit logs very hard to read. The database log shows the shared role name instead of the actual person. Native roles also return raw table data to anyone who runs a test query. If a table holds emails, phone numbers, or card numbers, admins see it all. Static setup controls the initial login, but it cannot filter live commands or mask fields.

How to keep admin sessions safe during replication checks

Teams should separate machine sync accounts from human admin accounts at all times. Keep the replication account locked to the cluster nodes and never share its password. When engineers need to check replication health, tie their sessions to their corporate identity. This approach links every SQL statement in the log to a real person. You should also require quick peer approval before an engineer runs a state-changing command. For daily debugging, apply data masking to rewrite sensitive fields like national IDs in results. This way, engineers can fix broken pipelines without pulling raw customer records onto their laptops.

User Provisioning (SCIM) + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits inline in the protocol beside the service as an open-source proxy, a sidecar for your database or API. On every production query an agent or human runs, hoop.dev decides whether to pass, mask, block, or escalate it for review.

Before a query runs, hoop.dev guardrails check the statement against your rules, an AI Analyzer you configure can score intent or hold risky calls for human approval, and hoop.dev data masking rewrites sensitive fields in responses in memory. Explore the MIT-licensed project on GitHub.

Frequently asked questions

Should I use the root account to sync SingleStore clusters?

No, you should never use the root account for cluster replication. If someone steals that password, they gain full control over every database. Always create a separate account with only the permissions needed to read logs.

How do I limit where the replication account can log in from?

When you create the database user, bind it to the secondary cluster IP address. The primary cluster will then reject login attempts from any other host or office network.

Why do engineers still need access to a replica cluster?

Engineers log in to check sync lag, test failover steps, and run read-heavy reports. Tying these human sessions to individual identities keeps your audit logs clean and accurate.

The query runs. The emails stay hidden.