# One datasource in two viewers / sharing datasources

**URL:** <https://community.cesium.com/t/one-datasource-in-two-viewers-sharing-datasources/14430>\
**Category:** CesiumJS\
**Created:** [July 15, 2021, 7:42am UTC](https://community.cesium.com/t/one-datasource-in-two-viewers-sharing-datasources/14430 "2021-07-15T07:42:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ruediger\_Brand](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ruediger_brand/32/4004_2.png) [@Ruediger\_Brand](https://community.cesium.com/u/Ruediger_Brand)\
**Post date:** [July 15, 2021, 7:42am UTC](https://community.cesium.com/t/one-datasource-in-two-viewers-sharing-datasources/14430/1 "2021-07-15T07:42:33Z")

</div>

Hi,

is it possible to share datasources between two viewers ?  
i.e. considering the syncing example in the sandcastle - esp. for 3d-Tiles ?

Rüdiger

---

<div class="post-metadata">

**Author:** ![sam.rothstein](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/sam.rothstein/32/6584_2.png) [@sam.rothstein](https://community.cesium.com/u/sam.rothstein)\
**Post date:** [July 15, 2021, 8:42pm UTC](https://community.cesium.com/t/one-datasource-in-two-viewers-sharing-datasources/14430/2 "2021-07-15T20:42:49Z")

</div>

@Ruediger_Brand

Great question! Two viewers can certainly view the same data source. Are you considering an application where two viewers can also edit the same data source? In this application, when edits are made, they are visible to both viewers.

-Sam

---

<div class="post-metadata">

**Author:** ![Alexander\_Johannesen](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/alexander_johannesen/32/2008_2.png) [@Alexander\_Johannesen](https://community.cesium.com/u/Alexander_Johannesen)\
**Post date:** [July 16, 2021, 12:00am UTC](https://community.cesium.com/t/one-datasource-in-two-viewers-sharing-datasources/14430/3 "2021-07-16T00:00:25Z")

</div>

Hi there,

Yes, you can duplicate anything into different viewers. However, there’s performance penalities for multiple viewers, as well as the fact that you have to duplicate (not share or reference) that data between them. A Cesium viewer is its own instance with its own engine and memory and JS stack and rendering.

Depending on the complexity of a scene, it can get pretty crazy. Now, you can probably sync the view cameras in iteresting ways, but if there’s a lot of data it will get very slow very quickly. But some tricks where you calculate distance to camera (I usually do this every X seconds per item) for the items in a scene and stream them in and out based on that will speed up the overall performance.

Cheers,

Alex

---

<div class="post-metadata">

**Author:** ![Ruediger\_Brand](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ruediger_brand/32/4004_2.png) [@Ruediger\_Brand](https://community.cesium.com/u/Ruediger_Brand)\
**Post date:** [July 22, 2021, 3:31pm UTC](https://community.cesium.com/t/one-datasource-in-two-viewers-sharing-datasources/14430/4 "2021-07-22T15:31:04Z")

</div>

Hi Sam,

is there a sandcastle or example code ?

Rüdiger

---

<div class="post-metadata">

**Author:** ![Alexander\_Johannesen](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/alexander_johannesen/32/2008_2.png) [@Alexander\_Johannesen](https://community.cesium.com/u/Alexander_Johannesen)\
**Post date:** [July 23, 2021, 1:41am UTC](https://community.cesium.com/t/one-datasource-in-two-viewers-sharing-datasources/14430/5 "2021-07-23T01:41:14Z")

</div>

Of what?
