# Perspective Workstation architecture question

**URL:** <https://forum.inductiveautomation.com/t/perspective-workstation-architecture-question/59480>\
**Category:** General Discussion\
**Tags:** ignition81, perspective\
**Created:** [May 11, 2022, 9:15pm UTC](https://forum.inductiveautomation.com/t/perspective-workstation-architecture-question/59480 "2022-05-11T21:15:58Z")\
**Posts on this page:** 9\
**Page:** 2

<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:** [May 11, 2022, 11:01pm UTC](https://forum.inductiveautomation.com/t/perspective-workstation-architecture-question/59480/21 "2022-05-11T23:01:34Z")

</div>

I said most 🙂  
You asked for hairs to be split, so hairs are being split.

It is still true that _all_ expressions and _all_ scripts in Perspective are actually being executed on the gateway.

---

<div class="post-metadata">

**Author:** ![peter](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@peter](https://forum.inductiveautomation.com/u/peter)\
**Post date:** [May 11, 2022, 11:04pm UTC](https://forum.inductiveautomation.com/t/perspective-workstation-architecture-question/59480/22 "2022-05-11T23:04:04Z")

</div>

I can’t of any practical situations that wouldn’t require a trip to the GW.

BTW are calls to/from the GW asynchronous? (this is my lack of react knowledge here)

---

<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:** [May 11, 2022, 11:11pm UTC](https://forum.inductiveautomation.com/t/perspective-workstation-architecture-question/59480/23 "2022-05-11T23:11:49Z")

</div>

Yes, Perspective’s relationship to the gateway is conducted asynchronously over a persistent websocket.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [May 13, 2022, 8:02pm UTC](https://forum.inductiveautomation.com/t/perspective-workstation-architecture-question/59480/24 "2022-05-13T20:02:58Z")

</div>

Quick question regarding this. I ran into this a few days ago here:

> [@Writing back to a database](https://forum.inductiveautomation.com/t/writing-back-to-a-database/59359/8):
>
> The biggest difference is that scripts in perspective run in a Gateway scope. When you run some functions like system.db.runPrepUpdate in Gateway scope you will need to provide additional information. In this instance what database connection to run the query against. When running in a vision client, if you don’t provide the database connection, then the default connection is assumed. Thus the script works in a vision client, but not in perspective. See the syntax section on this page in t…

Where the manual says, in this case that `system.db.runPrepQuery` will use the same function signature as you would use in a Vision Client scope, when in Perspective Session Scope. Yet there is no way that I am aware of to set a default DB for a perspective session, and since "all" scripts run in the Gateway I would expect that Gateway Scope is always required.

Is this a difference with Perspective Workstation (I've never personally used it) and that is what Perspective Session scope means, or is the manual just a tad misleading?

---

<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:** [May 13, 2022, 8:46pm UTC](https://forum.inductiveautomation.com/t/perspective-workstation-architecture-question/59480/25 "2022-05-13T20:46:01Z")

</div>

> [@lrose](#):
>
> Yet there is no way that I am aware of to set a default DB for a perspective session, and since “all” scripts run in the Gateway I would expect that Gateway Scope is always required.

Perspective is running inside the context of a particular project (by definition), so on the backend, we pass the project's default database in to the running script's context automatically. The individual scripting function implementations "know" to look for this context and extract it, so both things are true:

1. All Perspective scripts run on the gateway
2. Perspective scripts can assume the default database.

See [this thread](https://forum.inductiveautomation.com/t/bug-5802-async-tag-event-script-loses-reference-paths/57768) if you're interested in how that mechanism actually works.

---

<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:** [May 16, 2022, 7:36am UTC](https://forum.inductiveautomation.com/t/perspective-workstation-architecture-question/59480/26 "2022-05-16T07:36:44Z")

</div>

@Kevin.Herron @paul-griffith just going back to what runs in the gateway. What about Perspective binding transforms, are “Format” transforms run on the gateway? (just trying to see if there are things I can use to reduce load on the gateway)

---

<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:** [May 16, 2022, 2:30pm UTC](https://forum.inductiveautomation.com/t/perspective-workstation-architecture-question/59480/27 "2022-05-16T14:30:33Z")

</div>

Yes - since the rest of the binding inevitably has to run on the gateway anyways, even if we _could_ run some of the simpler transforms client-side, it wouldn’t actually gain much. They’re also running on the backend.

---

<div class="post-metadata">

**Author:** ![DNice](https://avatars.discourse-cdn.com/v4/letter/d/858c86/32.png) [@DNice](https://forum.inductiveautomation.com/u/DNice)\
**Post date:** [May 25, 2022, 7:58pm UTC](https://forum.inductiveautomation.com/t/perspective-workstation-architecture-question/59480/28 "2022-05-25T19:58:24Z")

</div>

Along the lines of the original question… If I decided on using Perspective as my HMI for an industrial machine what should I use as the front end application?  
I guess I would trust the Perspective workstation but I dont like how you cant get a true full screen and remove that white app bar on top. Chrome can go full screen but I trust Chrome to run 24/7? Appreciate any thoughts and or experience!

---

<div class="post-metadata">

**Author:** ![peter](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@peter](https://forum.inductiveautomation.com/u/peter)\
**Post date:** [May 25, 2022, 8:31pm UTC](https://forum.inductiveautomation.com/t/perspective-workstation-architecture-question/59480/29 "2022-05-25T20:31:08Z")

</div>

I think what you are looking for is [Perspective Workstation Kiosk mode](https://docs.inductiveautomation.com/display/DOC81/Perspective+Workstation#PerspectiveWorkstation-LaunchModes-WindowedandKiosk) but I have no experience in this product

[Previous page](https://forum.inductiveautomation.com/t/perspective-workstation-architecture-question/59480.md?page=1)
