# Data centralization on hub from multiple spokes

**URL:** <https://forum.inductiveautomation.com/t/data-centralization-on-hub-from-multiple-spokes/95355>\
**Category:** Ignition\
**Tags:** support, ignition81\
**Created:** [August 30, 2024, 5:56am UTC](https://forum.inductiveautomation.com/t/data-centralization-on-hub-from-multiple-spokes/95355 "2024-08-30T05:56:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![a\_kodle](https://avatars.discourse-cdn.com/v4/letter/a/bc79bd/32.png) [@a\_kodle](https://forum.inductiveautomation.com/u/a_kodle)\
**Post date:** [August 30, 2024, 5:56am UTC](https://forum.inductiveautomation.com/t/data-centralization-on-hub-from-multiple-spokes/95355/1 "2024-08-30T05:56:49Z")

</div>

Hi,

I want to setup gateway network following hub and spoke architecture.  
([Hub and Spoke Architecture | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/system-architectures/hub-and-spoke-architecture))

So I have multiple child gateways with their own database(PostgreSQL) and a hub gateway where I want all the spoke's data centralized on master gateway database.

How can I achieve this , Does ignition have capability to centralize the data from multiple spokes to central hub? Apart from manually Fetching data with select statements and inserting the data using insert statements.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 30, 2024, 12:37pm UTC](https://forum.inductiveautomation.com/t/data-centralization-on-hub-from-multiple-spokes/95355/2 "2024-08-30T12:37:42Z")

</div>

You should use PostgreSQL's replication technology to push changes in the spoke databases to read-only replicas in the hub.

For complete data transfer, include all schema changes as they happen, use _Write-Ahead-Log_ based replication, described here:

> **[Chapter 27. High Availability, Load Balancing, and Replication](https://www.postgresql.org/docs/15/high-availability.html)**
>
> Chapter 27. High Availability, Load Balancing, and Replication Table of Contents 27.1. Comparison of Different Solutions 27.2. Log-Shipping Standby Servers 27.2.1. Planning …

With this approach, you end up with a replica in the hub for each spoke.

For partial data transfer, for selected tables and groups of tables, use _Logical_ replication, described here:

> **[Chapter 31. Logical Replication](https://www.postgresql.org/docs/15/logical-replication.html)**
>
> Chapter 31. Logical Replication Table of Contents 31.1. Publication 31.2. Subscription 31.2.1. Replication Slot Management 31.2.2. Examples: Set Up Logical Replication 31.2.3. …

With this approach, you can merge data from all of your spokes into a single database in your hub.

Once you have done this, you can arrange for your history queries in the hub to use their connection(s) to hub-local databases, greatly relieving the workload on the spokes.

---

<div class="post-metadata">

**Author:** ![a\_kodle](https://avatars.discourse-cdn.com/v4/letter/a/bc79bd/32.png) [@a\_kodle](https://forum.inductiveautomation.com/u/a_kodle)\
**Post date:** [August 30, 2024, 2:13pm UTC](https://forum.inductiveautomation.com/t/data-centralization-on-hub-from-multiple-spokes/95355/3 "2024-08-30T14:13:25Z")

</div>

Okay , but is there any way do to it from ignition end without replicating the database?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 30, 2024, 2:51pm UTC](https://forum.inductiveautomation.com/t/data-centralization-on-hub-from-multiple-spokes/95355/4 "2024-08-30T14:51:09Z")

</div>

Yes. You can set up a [Remote History Provider](https://www.docs.inductiveautomation.com/docs/8.1/ignition-modules/tag-historian/tag-history-providers#remote-history-provider) on each spoke pointing at the hub. Then configure a [Tag History Splitter](https://www.docs.inductiveautomation.com/docs/8.1/ignition-modules/tag-historian/tag-history-providers#tag-history-splitter) on each spoke, that points at both your local historian and at the Remote History Provider. For each tag that you want available in both servers, then change its storage provider to the splitter.

---

<div class="post-metadata">

**Author:** ![a\_kodle](https://avatars.discourse-cdn.com/v4/letter/a/bc79bd/32.png) [@a\_kodle](https://forum.inductiveautomation.com/u/a_kodle)\
**Post date:** [September 3, 2024, 10:28am UTC](https://forum.inductiveautomation.com/t/data-centralization-on-hub-from-multiple-spokes/95355/5 "2024-09-03T10:28:01Z")

</div>

but by this method we can't replicate the transaction recorded on ignition(i.e script ran on button to insert some data into database) right?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 3, 2024, 12:11pm UTC](https://forum.inductiveautomation.com/t/data-centralization-on-hub-from-multiple-spokes/95355/6 "2024-09-03T12:11:44Z")

</div>

Correct. Any non-historian database operations would have to be duplicated yourself.
