# Can I have two gateways using the same SQL database for historic logging?

**URL:** <https://forum.inductiveautomation.com/t/can-i-have-two-gateways-using-the-same-sql-database-for-historic-logging/56816>\
**Category:** Ignition\
**Created:** [March 4, 2022, 12:58am UTC](https://forum.inductiveautomation.com/t/can-i-have-two-gateways-using-the-same-sql-database-for-historic-logging/56816 "2022-03-04T00:58:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [March 4, 2022, 12:58am UTC](https://forum.inductiveautomation.com/t/can-i-have-two-gateways-using-the-same-sql-database-for-historic-logging/56816/1 "2022-03-04T00:58:18Z")

</div>

Question’s in the title. Is this possible / recommended?

I have a front and backend split gateway, but I want to trend some system tags on both systems and really I don’t see the need or want to have two databases, one for each, so I wanted to create a database connection on both pointing to the same SQL instance and database. I’m not sure what chaos this will create though (if any) and also how partitioning will be affected?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 4, 2022, 9:05pm UTC](https://forum.inductiveautomation.com/t/can-i-have-two-gateways-using-the-same-sql-database-for-historic-logging/56816/2 "2022-03-04T21:05:44Z")

</div>

Not a problem at all (as long as they have distinct gateway names).

The historian already uniquely identifies every record by what system and tag provider it came from.  
Check `sqlth_drv`, there will be at least two records (one `null`, one probably with an entry for `default`) for each gateway you connect to a given historian.
