Moving the X-Road message log to a remote database: when it is worth it
Moving the X-Road message log to a separate PostgreSQL server gives the log its own storage, sizing and backups, and the Security Server must still run against a supported PostgreSQL version. Start this decision when the message log is the reason the database host is short of disk or the nightly backup window no longer fits, not simply because the log is large. The Security Server requires PostgreSQL, either local or remote, and the installation requirements name managed services such as AWS RDS and Azure Database for PostgreSQL as options for the remote case. Before you plan the move, confirm in the Security Server installation guide which database and schema hold the message log in your installed version. The exact configuration keys for pointing the log at another server are not covered here, so take them from the guide for your release.
Check the PostgreSQL version against the current support window before you provision anything. PostgreSQL 14 reaches end of support on November 12, 2026, so a remote server built on it would already be unsupported today, while versions 15 through 18 remain inside their published support periods under the PostgreSQL versioning policy. Confirm with the X-Road release notes or the vendor which PostgreSQL versions your Security Server release supports, then plan the upgrade path now. A later major upgrade on a database holding a large log takes its own dump, restore or replication window, and that window is much harder to fit in when the log is already straining the host. Also review the network path between the Security Server and the database, because the message log now crosses a link that was previously local to the host.
Decide who owns the remote database before cutover. The Security Server operator and the database team need a written split: who sizes storage and monitors growth, who runs backups and point-in-time recovery, and who rotates the database credentials the Security Server uses. PostgreSQL offers several client authentication methods, including password, certificate, GSSAPI and LDAP, and PostgreSQL 18 deprecated MD5 password authentication in favor of SCRAM, so choose the method your security policy allows and confirm that the Security Server connects with it. Rehearse the move on a copy of the log database and time the switch-over, so the first live cutover does not also serve as the first test of your restore procedure.
Local or remote database for the X-Road message log
This table compares three places to host the X-Road message log: a local PostgreSQL on the Security Server host, a self-managed PostgreSQL on a separate server, and a managed PostgreSQL service. Read each column for fit, who runs backups and upgrades, and the network and access controls each placement needs. The main takeaway is that moving the database off the host can shift some operational work to another team, so confirm ownership before you choose.
| Decision point | Local on Security Server host | Self-managed on separate server | Managed service such as AWS RDS or Azure Database for PostgreSQL |
|---|---|---|---|
| Best fit | One Security Server with modest message volume and no separate database team | High message volume that needs its own sizing, or a team that already runs PostgreSQL | Teams already operating in AWS or Azure with approved managed database services |
| Who runs backups | Security Server team, on the same host as the message log | Your database team, which sets the backup schedule and tests restores | Provider runs the platform; your team confirms retention, restore and log export settings |
| Who runs upgrades | Security Server team, alongside operating system and X-Road upgrade windows | Your database team, using minor updates and planned major upgrades | Shared: provider schedules maintenance; your team confirms versions and windows |
| Network controls | No database network path to manage; the database stays on the host | Allow the database port only from Security Server hosts, with TLS enabled | Private endpoint or allowlist for Security Server subnets; confirm TLS options |
| Access controls | Dedicated database role; restrict operating system access to the host | Dedicated role limited to the message log schema; authentication such as SCRAM | Dedicated role; confirm which authentication methods the service supports |
| Availability and failover | Tied to the Security Server host; no separate database failover | Replication and any failover tooling are your design, since PostgreSQL does not detect failure alone | Confirm standby and failover options against your recovery targets |
| Operational visibility | Monitoring runs on the host alongside X-Road monitoring | Your team monitors the database server with its own tooling | Confirm which metrics and logs the provider exposes to your team |
| Shared by several Security Servers | Not applicable: the database serves only its host | Confirm with NIIS and your own design whether one database can serve more than one Security Server | Confirm with NIIS and the provider whether one instance can serve more than one Security Server |
When a busy X-Road message log justifies its own PostgreSQL server
Move the message log to its own PostgreSQL server when it competes with the Security Server for resources, or when its backup and restore needs no longer fit the window you have. The Security Server needs PostgreSQL, local or remote, and its host already needs at least 3 GB RAM (4 GB with monitoring add-ons) and 3 GB free disk. Watch disk and memory over a full business cycle, including busy days, and check whether log growth is squeezing the space the operating system and server configuration need. A second signal is a need to back up and restore the log on its own schedule, separate from the Security Server's configuration backups. The third is organizational: if a database team already runs managed PostgreSQL, such as AWS RDS or Azure Database for PostgreSQL, it can apply its existing backup, patching and monitoring practice to the log.
The trade-off is dependency. Once the log lives on another host, the Security Server depends on the network path and the database being reachable, so a network fault, firewall change or database maintenance window can now interrupt message recording. Plan the path with the same care as the exchange ports, document the firewall rules for each direction, and name the person who responds when the path breaks. Then confirm what the Security Server does when the log database is unavailable: whether it refuses exchanges, queues log entries or continues without logging, and how it recovers when the connection returns. Confirm this with the vendor documentation or a lab test before you commit, because the answer sets how much redundancy the database needs and whether an outage becomes an evidence gap.
Settle the database version and ownership before you build. Confirm which PostgreSQL versions your X-Road release supports, then choose one that stays in support for the life of the deployment. PostgreSQL 14 is supported only until November 12, 2026, while 17 is supported through November 8, 2029 and 18 through November 14, 2030. Ask the database team which backup method they will apply to the log, such as logical dumps or point-in-time recovery from archived write-ahead logs, and who approves changes to connection settings. Before go-live, restore a copy of the log and record the elapsed time, since that measured figure sets the backup window. Ask any implementation partner for a fixed-scope quote built on these decisions.
The Security Server writes the message log to one remote database path
The diagram starts with partner Security Servers on the external network. They reach this Security Server on TCP 5500 for message exchange and TCP 5577 for OCSP. Administrators use the admin UI on TCP 4000 from the internal network. The key hand-off is the configured database connection, the path you set up so the Security Server writes the message log to a remote PostgreSQL server on the internal network. Database dumps go to a separate backup target. Check that only the Security Server can reach the database path, and that the backup target has access controls matching the sensitivity of the log it holds.
Trust boundaries, exposed ports and the database path the Security Server configures.
Setting up a remote database for the X-Road message log
This sequence moves the Security Server message log onto a PostgreSQL server that runs apart from the Security Server. Each step ends with a check, so the team knows the remote log is writing, can be restored, and is reachable only from the Security Server addresses. Exact commands stay in the installation guide.
Confirm the PostgreSQL major version
Before any installation work, check the PostgreSQL major version against the X-Road release you plan to run. The current release is 7.8.3, and the supported versions are 7.8.3, 7.7.4 and 7.6.5, so confirm which release line your environment will follow. PostgreSQL's versioning policy lists major versions 14 through 18 as supported, and the installation guide states which versions the Security Server accepts. Done when the team has recorded the X-Road release and PostgreSQL major version as a pair that the installation guide confirms, and that pair is written into the change record.
Size the server and storage
Estimate how much message data each Security Server will write, using traffic from a pilot or your expected production load, along with the retention period your archiving process requires. Size the PostgreSQL host's CPU, memory and storage from that estimate, leaving headroom for growth and for backup files if they land on the same volume. The Security Server minimums of 3 GB RAM (4 GB with monitoring add-ons) and 3 GB free disk apply to the Security Server host, so they do not size the database. Done when the sizing sheet is signed off by the teams that own storage and backups, and alerts for free space on the database volume are configured.
Create a dedicated database role
Create a PostgreSQL role used only for the Security Server's message log. Grant only the privileges the installation guide lists for the log database and schema, and keep superuser, role creation and database creation rights out of this role. Set a strong credential using an authentication method your PostgreSQL configuration supports, and limit who can read the file that holds it on the Security Server. Done when a login with this role can reach the message log schema and is refused on any other database that a test connection tries.
Restrict network access to the Security Servers
Limit the database port to the Security Server addresses. Configure the host firewall and the PostgreSQL listener so that only the Security Server addresses, and any connection pooler placed in front of the database, can reach the port. Add matching entries to the PostgreSQL host-based authentication file, and enable encrypted connections if your security standard requires them. The external ports 5500 and 5577 serve message exchange and OCSP, so the database port should stay off that path. Done when a connection from a host outside the list is refused and a connection from each Security Server succeeds.
Point the Security Server at the database
On each Security Server, follow the X-Road Security Server installation guide to change the database settings from the local database to the remote host, port, database name and role. Record the previous settings first so you can return to them. Then populate the remote schema with the procedure the guide describes, which creates the tables the Security Server writes to. Use the guide for exact commands and keep your own record of each change. Done when the Security Server restarts cleanly, the admin interface loads, and the schema objects the guide lists are present on the remote server.
Send a test message and check the log
Send one test request through the Security Server to a service in your test environment, using a consumer and producer whose access rights already allow the call. Then find the record in the message log on the remote database, and compare its message identifier and timestamp with the request you sent. Confirm that the logging mode for that subsystem is the one you planned, since metadata logging stores less than full logging. Done when the record appears in the remote database and the local log stops receiving new entries for that Security Server.
Time a test backup and restore
Take a dump of the remote message log database using the backup tool your database team uses, and time it from start to finish. Restore that dump into a separate test PostgreSQL instance and time the restore the same way. Compare both durations with the backup window and recovery time that your operations plan requires, and record the figures beside the sizing sheet. Done when the restored copy opens, row counts on the log tables match the source at the time of the dump, and the timings are in the operations runbook.
What drives dump and restore time for a busy X-Road message log
Dump and restore time for the message log depends on how much data moves, how fast it moves, and how the tools read and write it. The five drivers below interact, so a change to one can shift the others. Measure a test restore in your own environment, using a copy of your production log and your planned retention settings, because no timing figure applies to your hardware, network or volume.
Log size and retention period
The total size of the message log sets the baseline for every other driver. Size grows with message volume and with the number of days you keep entries online, so the retention period you choose drives the work directly. Before you plan the move, measure the current size of the log database and project it across your planned retention window. Ask your implementation partner or your own team whether retention cleanup runs in the same window as a dump, because a large cleanup job adds load and changes the data being copied.
Dump format and parallel options
The dump format and the number of parallel jobs decide how much of the work runs at once. Not every pg_dump output format supports parallel jobs, and the format you choose also limits how pg_restore can read it. Confirm the format, flag and version compatibility details in the PostgreSQL backup documentation before you script the job. Then test the restore with the same format and job count you plan to use in production, so the timing you measure matches the timing you will depend on.
Network throughput between components
With a remote database, the dump stream crosses the network between the PostgreSQL server and the backup target, and the restore stream crosses it again in the other direction. Sustained throughput on that path often sets the pace, especially when both ends have fast disks. Check bandwidth, latency and any firewalls or inspection devices between the database host, the backup target and the Security Server. Also confirm whether backup traffic shares links with live message exchange, and run a test transfer of a full dump file to measure the result.
Storage speed on both ends
Dump and restore are I/O-bound at both ends. The source disk must sustain reads while the dump runs, and the target disk must sustain writes during restore, along with the write-ahead log activity and index builds that restore triggers. Slow or shared storage on either side can stretch the window even when the network is fast. Ask whether the remote database host and the backup target use the same storage class, and measure sustained throughput under load, not peak figures from a datasheet.
Archived log files handled separately
Archived log files are a separate data set from the live database, so whether a dump includes them changes both its size and the restore steps. Decide in advance which copy is the recovery source for archived content, and keep archive transfers out of the dump window where you can. If your PostgreSQL setup also archives write-ahead log files for point-in-time recovery, confirm how that archive is included in your recovery plan and test it. Record the split in the runbook so the restore team knows which files to fetch from each location.
Continuous archiving docsUpgrading the remote PostgreSQL server without losing the message log
Minor PostgreSQL releases never change the internal storage format, so a minor update on the remote server only means replacing the executables and restarting the service. The work and the risk sit in major upgrades, which change the on-disk format and need one of three routes: a dump and restore with pg_dumpall, pg_upgrade, or logical replication. Before the upgrade window is booked, confirm which of these routes the X-Road release you run supports for the message log database, and get that answer in writing. The choice depends on it. Check the server version too: the supported PostgreSQL versions are 18, 17, 16, 15 and 14, and PostgreSQL 14's support window ends November 12, 2026, so a server still on 14 is already past that date and needs a plan.
Logical replication is the route that keeps the outage shortest. The PostgreSQL upgrading documentation states that it works between different major versions and allows a major upgrade with only several seconds of downtime. The cost is setup work and a more careful cutover: you publish the data on the old server, subscribe from the new server, let it catch up, then point the Security Server at the new host during a short pause in message writes. Confirm with the X-Road documentation that this route is supported for the message log database, since the cutover changes its connection settings. Also confirm how sequence values and schema changes are carried over, because you cannot assume they follow the data. Plan a way back to the old server, because messages accepted after cutover will not appear there on their own.
pg_upgrade upgrades the cluster in place without a logical copy, but the server must be stopped for the duration of the run. PostgreSQL 18's pg_upgrade retains planner statistics across the upgrade, so the upgraded server does not start with missing statistics that slow queries until analyze runs. It also adds parallel jobs and a --swap option, which you should review in the PostgreSQL 18 documentation before relying on them. Re-check that the X-Road release supports pg_upgrade for this database. A dump and restore with pg_dumpall is the simplest route to reason about, but its outage grows with the size of the message log, so measure it on a restored copy before choosing it. Whichever route you pick, take a verified backup first and rehearse the full upgrade, including the Security Server reconnect, on a copy of the database.
Securing the remote X-Road message log database
Four controls protect the remote message log database: who authenticates, who can reach the listener, how dumps are kept, and how the host is hardened. Each one matters because the database holds the evidential record that the Security Server writes. Treat the database host as part of the same security boundary as the Security Servers that depend on it.
Authentication to the database
Each Security Server connects to PostgreSQL under a client authentication method set in pg_hba.conf. The PostgreSQL documentation lists password, GSSAPI, SSPI, LDAP, RADIUS, certificate, PAM and OAuth, so pick the method that fits your identity estate and give each Security Server its own database role. PostgreSQL 18 deprecated MD5 password authentication in favor of SCRAM, so confirm that every role uses SCRAM before you connect a new server. Check which methods your managed service exposes, since providers do not always offer every option.
Network exposure of the listener
Set listen_addresses so PostgreSQL listens only on the interface the Security Servers reach, then limit pg_hba.conf entries to the Security Server addresses, the database and the role each one needs. Nothing else on the network should reach the port, including the information systems that sit behind the Security Servers. Restrict the database listener to Security Server addresses and enforce the same rule at the host firewall and any network security group. On a managed service, confirm which of these controls the provider enforces and which you must set yourself.
Backup protection for dumps
Dumps of the message log contain the evidential record, so a dump file carries the same weight as the live tables. Treat each dump as the log itself: encrypt it at rest, restrict who can read or restore it, record where copies are kept, and apply the retention rules your evidence policy sets. Protect every dump like the live message log, and test restores under the same access controls. Ask your backup tool or managed service how encryption keys are stored and who can export them.
Continuous archiving docsHost hardening of the database server
The database host sits in the same trust chain as the Security Server, so apply the X-Road security hardening guide to it as well. The guide recommends locking accounts after repeated failed logins, enforcing a minimum password length, and allowing only key-based SSH. Apply the guide's account lock, password length and key-only SSH settings to the database host, keep the operating system on a supported release and patched. Verify each setting after changes and record the result in your evidence file.
Security hardening guideQuestions buyers ask before moving the X-Road message log to a remote database
How much effort does moving the X-Road message log to a remote database take?
The effort depends mainly on how large the message log already is, how many Security Servers write to it, and who runs the database. A single Security Server with a small log is a contained task: create the schema on the remote server, point the Security Server at it, and verify the result. Effort grows with log size, because existing data must be dumped and restored, and the cutover window depends on how long that copy takes. Each additional Security Server adds configuration, connection and verification work. A self-run database adds operating system hardening, backups and patching to your team's list, while a managed service moves some of that to the provider but still needs network, parameter and backup checks. High availability adds replicas, failover tooling and failover tests. Ask any partner to break the estimate down by these drivers so you can see which one moves the cost.
How long does a remote message log database move take?
No duration is given here because the answer depends on facts only your environment can supply: the current log size, the copy speed between the current and new database hosts, the number of Security Servers involved, and the maintenance window your operations team will approve. The move has two time-sensitive parts. The dump and restore of an existing log is the part most likely to grow with data volume, so it should be timed on a copy of your data before any date is set. The cutover itself needs a window in which the Security Server stops writing, the final data is loaded and the configuration is switched. Ask for a schedule built from a timed test restore and a written list of dependencies. Treat any duration that lacks that measurement as a guess.
What does the team need from us for a database move?
The work needs four things from your side, and the first two usually need the longest lead time to arrange.
- Access to your database team to create roles, the schema and a restore target on the remote server.
- Network changes so the Security Server can reach the remote PostgreSQL port through your firewalls, with the connection secured to your standard.
- A maintenance window for the cutover, agreed with the owners of the services that depend on the Security Server.
- A test restore on a copy of the message log, with the duration recorded and the restored data checked against the source.
Your team also needs to confirm who approves the cutover and who can call a rollback during the window. Settle these answers before the technical work starts, so the schedule reflects real availability.
Can our in-house team move the X-Road message log alone?
Yes, if your team already runs X-Road Security Servers and PostgreSQL in production, the move is within reach of an internal team. Confirm that skill set before committing, because the risk sits in the cutover and rollback, not in the schema setup. Check the PostgreSQL version first: the versioning policy lists 18, 17, 16, 15 and 14 as supported, and PostgreSQL 14 reaches its end of support on November 12, 2026, so a new target should be a version with a later date. Then run these checks:
- Compare row counts or checksums between the source log and the restored copy.
- Measure the dump and restore time on a copy of production data.
- Confirm the Security Server writes to the new database after cutover.
- Test the rollback path and a restore from a backup of the new database.
Document each result so an auditor or a later team can follow the change.
Does a remote PostgreSQL message log need high availability?
It depends on what happens to data exchange if the log database stops. PostgreSQL supports hot standby servers, which can serve read-only queries, and two replication modes: synchronous replication, where a commit waits for the standby, and asynchronous replication, where it does not. Synchronous replication protects committed log records at the cost of waiting on the standby. Asynchronous replication is faster but can lose the most recent transactions if the primary fails. PostgreSQL does not detect a failed primary and promote a standby by itself, so automatic failover needs external tools, and those tools need their own testing. Set the recovery objectives with your operations and compliance owners first, then choose the replication mode and failover tooling to match. Managed services may bundle some of this, so confirm their behavior in writing.
What should a quote for the database move include?
A quote should follow from a written scope. DeployOpen does not publish a price list, and it agrees scope, deliverables and timelines in writing before work starts. Ask that the quote state:
- The source and target PostgreSQL versions, the number of Security Servers in scope, the log size assumed and the high availability design.
- Who does what, so your database, network and operations teams can see their own tasks.
- The deliverables, such as the remote schema configuration, a runbook, verification and rollback steps, and a test restore report.
- The assumptions and dependencies, including access, maintenance windows and approval steps.
- Milestones, and how a change in log size or scope would change the price and timeline.
- Which items are one-time and which recur, such as ongoing patching, backup checks or a support retainer after cutover.
Limits to confirm in your environment before the move
The move changes which database version, high availability design and deployment shape your Security Server depends on, so several limits need checking first. Each card below is one check. Confirm every item against your own environment, your X-Road release and your PostgreSQL provider's current documentation before you commit to a target design.
PostgreSQL 14 is out of support
PostgreSQL 14 is listed as supported only until November 12, 2026, and that date has passed. Do not place a new remote message log on it. Choose a major version still in support, such as 17 or 18, and confirm its end date against the PostgreSQL versioning policy before you build. Include the upgrade path for any existing PostgreSQL 14 server in this move.
Versioning policyMinimums do not size the database
The published minimums for the Security Server, 3 GB of RAM (4 GB with monitoring add-ons) and 3 GB of free disk space, describe the application host only, so they do not size the database server. They say nothing about the memory, storage or I/O a PostgreSQL server needs to hold and query a busy message log. Size the database from your message volume, retention period and archive timing, then confirm the result with a load test on a copy of your data.
Installation guideManaged services need release checks
The Security Server installation guide names AWS RDS and Azure Database for PostgreSQL as supported options. That names the services, not your exact combination of X-Road release, PostgreSQL version and message log setup. Confirm with the provider and in a test environment that the managed instance accepts the database setup the Security Server expects, that message log writes, dumps and restores behave as planned, and that the offered version is still in support.
X-Road 8 is still in beta
The current X-Road release is 7.8.3, and 7.8.3, 7.7.4 and 7.6.5 are the supported versions. X-Road 8 is available as 8.0.0 Beta 2 for testing, with its production release scheduled for December 2026. Do not plan production on X-Road 8. Design the remote database on a supported 7.x release, and confirm the exact release you run before you schedule the change.
X-Road releasesPostgreSQL failover is external
PostgreSQL provides hot standby servers and both synchronous and asynchronous replication, but it does not include software that detects a primary failure and notifies the standby. Any automatic failover is an external tool that you select, install and operate. Test promotion, client reconnection and Security Server behavior during a failover in a non-production environment, and document who makes the call when automatic failover is absent.
PostgreSQL failover docsConfirm shared database support
Decide whether one remote PostgreSQL instance can serve more than one Security Server, or whether each server needs its own database. Confirm this for your X-Road release before you finish capacity planning, because the answer changes backup scope and how far a database outage reaches. If a shared database is supported and you use it, check how schemas, roles and message log tables are separated between servers, and who owns the restore procedure.
How DeployOpen scopes and delivers a remote message log database
DeployOpen treats moving the X-Road message log to a remote database as a planned change to a system that carries evidence. We agree the scope in writing, build the separate PostgreSQL server and remote schema in infrastructure you control, then test, document and hand over the result. Most engagements are fixed-scope, and ongoing support is available as a retainer.
How we scope
- The written scope names the PostgreSQL version, server placement and network paths between the Security Server and the database.
- It records which message log mode each Security Server uses, and the volume that the remote database must absorb.
- Fixed-scope terms cover the dump and restore window, cutover steps and acceptance tests agreed before work starts.
How we build
- Provision the PostgreSQL server in your own infrastructure, with database access limited to the Security Server.
- Point the Security Server at the remote database, then configure and populate the schema before go-live.
- Time the dump and restore on a copy of your live message log so the cutover window reflects your own volume.
How we hand over
- Test that new messages are logged, and that a dump and restore completes, before handover.
- Document the connection settings, schema setup, network paths and dump and restore procedure for your operations team.
- Hand over a runbook covering restarts, backups of the remote database and the steps to restore it.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers for the database and Security Server.
- Plan PostgreSQL major upgrades for the remote server as a separate change, with the upgrade method confirmed in advance.
- Share the message log growth figures and dump times from your environment so the next review starts from measured data.

