Skip to content

Keeping Dynamics 365 Finance & Operations and PostgreSQL in Step

A guide to keeping a PostgreSQL application database and Microsoft Dynamics 365 Finance & Operations consistent. It explains why a product keeps a local copy of F&O data, why two one-way exports drift and echo, and how a real two-way sync uses field-level change detection, origin tracking, and conflict resolution to keep both databases in step. Follows one record through its sync lifecycle, including the throttling and conflict branches.

Author
Ruben Burdin · Founder & CEO
Published
July 21, 2026
Read time
9 min read
Keeping Dynamics 365 Finance & Operations and PostgreSQL in Step
DATA ENGINEERING

Plenty of products need what lives in Dynamics 365 F&O, order status, credit limits, invoice balances, without making users log into the ERP. The usual answer is to pull that data into the app's own PostgreSQL database. The moment you do, you have two copies of the same records, and they start to drift. Keeping them in step is a two-way sync problem.

This guide is about doing that properly: what two-way sync means when one side is an ERP and the other is a Postgres app database, how a record moves through its sync lifecycle, and why field-level sync beats a pair of one-way exports.

A nightly DMF export versus a live two-way sync between Dynamics 365 F&O and PostgreSQL: stale batches and throttling versus real-time, field-level, origin-aware sync

The setup assumes a two-way sync platform such as Stacksync between F&O and Postgres. The Dynamics 365 connector and PostgreSQL connector pages cover the surface; here we focus on keeping the two consistent.

Why an app keeps a local copy of F&O data

Your product cannot make thousands of users hit the F&O OData endpoints directly. It is too slow for an app UI, and it would trip priority-based throttling in minutes. So the app keeps the data it needs, customers, orders, balances, in its own Postgres database, where reads are fast and under your control.

That local copy is only useful if it is accurate. If a payment posts in F&O and the app still shows an open balance, or a customer updates an address in the app and F&O never hears about it, the copy is worse than no copy, because people trust it. Two-way sync is what keeps the copy honest.

What two-way sync actually means here

Two one-way exports are not a two-way sync. A pair of scripts, one F&O-to-Postgres and one Postgres-to-F&O, will fight each other: each treats the other's write as a fresh change and echoes it back, and when both sides edit the same record, one blindly overwrites the other. A real two-way sync puts an engine in the middle.

Dynamics 365 F&O and PostgreSQL connected through a two-way sync engine that does change detection, origin tracking, and conflict resolution
The engine in the middle is what makes it a sync, not two exports pointed at each other.

The engine does three things a pair of scripts cannot: it detects changes at the field level so only what moved is synced, it tracks the origin of every change so a write does not loop back, and it resolves conflicts under one shared policy when both sides touch the same field. That is the difference between two databases that agree and two databases that argue.

The life of a synced record

It helps to follow one change through the system. An edit in either F&O or Postgres enters a lifecycle: detected, mapped, applied, and confirmed, with branches for conflicts and for throttling.

The lifecycle of a synced Dynamics 365 F&O record: detected, mapped, applied, then confirmed, with branches for conflict resolution and for throttled retries
One record's path: detected to confirmed, with conflict and throttling handled, not dropped.

When a write is throttled, F&O returns a 429 and the engine backs off and retries rather than dropping the change. When both sides changed the same record, the engine merges at the field level and re-applies the winner. Only when the target acknowledges the write is the record marked confirmed and both sides declared in sync. Nothing is silently lost, and nothing loops.

Book a Stacksync demo: keep a Postgres app database and Dynamics 365 F&O consistent with two-way sync

One-way export vs two-way sync

The pair-of-scripts approach looks cheaper on day one. The table lays out what it actually costs every day after.

Two one-way exportsField-level two-way sync
ConsistencyDrifts between runsBoth sides match in seconds
Echo loopsEach write re-triggers the otherOrigin tracking stops the loop
ConflictsLast write wins, blindlyMerged per field, one policy
Load on F&OFull pulls trip throttlingOnly changed fields
OperationsTwo scripts to babysitOne engine, monitored, retried

Two exports look cheaper on day one and cost more every day after, in drift and reconciliation.

That daily cost shows up as reconciliation, as support tickets about wrong balances, and as the engineer who owns the cron jobs. A real two-way sync moves that cost off your plate, and it is the same engine that keeps F&O and Snowflake in step, so a second pairing is configuration, not a second project.

Two databases, one truth

Keeping Dynamics 365 F&O and PostgreSQL in step is not about copying data faster. It is about an engine that detects field-level changes, tracks their origin, and resolves conflicts, so the app's local copy is always something users can trust. Set that up once and the drift, the echo loops, and the reconciliation go away.

Stacksync is built for exactly this: real-time, field-level, origin-aware two-way sync between F&O and Postgres, with backoff that respects F&O throttling. To keep your own app database and F&O consistent, book a demo.

Sync Dynamics 365 F&O and Postgres both ways, field-level and origin-aware

FAQ

Frequently asked questions

How do I set up two-way sync between Dynamics 365 F&O and PostgreSQL?
Connect a sync platform to the F&O OData data entities and to your PostgreSQL database, map the F&O entities you need to Postgres tables field by field, set a conflict policy, and turn the sync on. With Stacksync, a change on either side is detected, mapped, and applied to the other in seconds, with origin tracking so writes do not loop. You do not maintain two separate export scripts.
Why not just run two one-way exports?
Because a pair of one-way exports fights itself. Each treats the other's write as a fresh change and echoes it back, and when both sides edit the same record, one blindly overwrites the other. A real two-way sync puts an engine in the middle that tracks the origin of every change to stop the loop and resolves conflicts per field instead of last-write-wins.
What happens when the same record changes in both F&O and Postgres?
The engine resolves it per field under one shared policy rather than letting one side overwrite the other. If the app updates a contact field in Postgres while finance updates the credit limit in F&O on the same customer, both changes survive because conflict resolution works at the field level, not the whole record.
Will syncing to Postgres trip F&O API limits?
Not if the sync is field-level. F&O applies priority-based throttling and returns HTTP 429 with a Retry-After header when a client sends too many requests. A field-level sync only moves what changed, so it stays well under the limits, and the engine honors the Retry-After header and retries rather than dropping the change.
How does the sync avoid echo loops?
Through origin tracking. Every change carries a tag for where it came from, so when the engine writes a change into F&O that originated in Postgres, F&O reporting that write back is recognized as the same change and ignored, not treated as new. That is what keeps a continuous two-way sync from doubling every edit.
Can I sync only some F&O entities to Postgres?
Yes. You choose which entities and which fields sync, and in which direction per object. Most apps only need a subset, customers, orders, invoices, balances, so you map those and leave the rest of F&O out of the Postgres schema entirely.

About the author

Ruben Burdin
Ruben Burdin
Founder & CEO

Ruben Burdin is the Founder and CEO of Stacksync, the first real-time and two-way sync for enterprise data at scale. Ruben is a Y Combinator alumni with a strong background in software engineering and business.

All posts by Ruben Burdin

About Stacksync

Stacksync powers real-time, two-way sync between CRMs, ERPs, and databases. Engineers sync data at scale and automate workflows, not dirty API plumbing.

Coworkers laughing in front of a laptop in a casual office setting

Your last integration took months.
Your next one takes a prompt.