<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Shared Global Context for each CloudCode invocation?]]></title><description><![CDATA[<p dir="auto">Does each CloudCode call have some global/shared context?</p>
<p dir="auto">I'm thinking of global "tuning" data for a custom loot box system.  Or would this be System Global Data?  If it is System Global Data, then I suppose accessing the data would cost me 1 api call per invocation.</p>
<p dir="auto">Thanks,<br />
Travis</p>
]]></description><link>https://forums.getbraincloud.com/topic/111/shared-global-context-for-each-cloudcode-invocation</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Apr 2026 10:05:42 GMT</lastBuildDate><atom:link href="https://forums.getbraincloud.com/topic/111.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 22 Oct 2020 21:37:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Shared Global Context for each CloudCode invocation? on Sun, 01 Nov 2020 04:00:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forums.getbraincloud.com/uid/112">@Travis-Brown-John</a> You can create them manually from the Monitoring menu.</p>
<p dir="auto">Monitoring | Global Monitoring | Global Entities.</p>
<p dir="auto">Note - if your app is live, you need to unlock it first. You'll see a bit [+] button to the right of the Bulk actions drop-down.</p>
<p dir="auto">Good luck!</p>
<p dir="auto">Paul.</p>
]]></description><link>https://forums.getbraincloud.com/post/361</link><guid isPermaLink="true">https://forums.getbraincloud.com/post/361</guid><dc:creator><![CDATA[Paul Winterhalder]]></dc:creator><pubDate>Sun, 01 Nov 2020 04:00:49 GMT</pubDate></item><item><title><![CDATA[Reply to Shared Global Context for each CloudCode invocation? on Fri, 30 Oct 2020 20:18:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forums.getbraincloud.com/uid/5">@Paul-Winterhalder</a> said in <a href="/post/359">Shared Global Context for each CloudCode invocation?</a>:</p>
<blockquote>
<p dir="auto">Hi Travis,</p>
<p dir="auto">Hmm - 100Kb is not appropriate for Global Properties. We don't recommend more than 3-4Kb of JSON in a global property, for example.<br />
Perfect, thanks.  Good to know a rough size to work with.</p>
</blockquote>
<blockquote>
<p dir="auto">Global Entities are fine for <strong>tuning data</strong> - just ensure that you can look up your entities using the entityIndexedId. That id is essential for fast lookup.</p>
</blockquote>
<p dir="auto">I think the id lookup restriction will be fine, and since they are read-only, I won't need to worry about write contention.</p>
<p dir="auto">One more question, I wa hunting around the dashboard, and I couldn't find a place to create a global entity.  What am I missing?</p>
<p dir="auto">Thanks,<br />
Travis</p>
]]></description><link>https://forums.getbraincloud.com/post/360</link><guid isPermaLink="true">https://forums.getbraincloud.com/post/360</guid><dc:creator><![CDATA[Travis Brown-John]]></dc:creator><pubDate>Fri, 30 Oct 2020 20:18:49 GMT</pubDate></item><item><title><![CDATA[Reply to Shared Global Context for each CloudCode invocation? on Fri, 30 Oct 2020 17:33:39 GMT]]></title><description><![CDATA[<p dir="auto">Hi Travis,</p>
<p dir="auto">Hmm - 100Kb is not appropriate for Global Properties. We don't recommend more than 3-4Kb of JSON in a global property, for example.</p>
<p dir="auto">That said - you can have a bunch of global properties. Lots of folks use them for their tuning data - but more as individual key+value pairs - and smaller JSON blobs. So you can definitely store tuning data there - in more atomic form.</p>
<p dir="auto">Global Entities are fine for <strong>tuning data</strong> - just ensure that you can look up your entities using the entityIndexedId. That id is essential for fast lookup.</p>
<p dir="auto">Global Entities are not good for transactional data or player-owned data - cause the numbers group to large. For those, you definitely want Custom Entities. But if you are talking about reference (i.e. read-only) data with known ids for quick look-ups, then Global Entities should work fine for you.</p>
<p dir="auto">Hope that helps!</p>
<p dir="auto">Paul.</p>
]]></description><link>https://forums.getbraincloud.com/post/359</link><guid isPermaLink="true">https://forums.getbraincloud.com/post/359</guid><dc:creator><![CDATA[Paul Winterhalder]]></dc:creator><pubDate>Fri, 30 Oct 2020 17:33:39 GMT</pubDate></item><item><title><![CDATA[Reply to Shared Global Context for each CloudCode invocation? on Fri, 30 Oct 2020 16:22:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forums.getbraincloud.com/uid/60">@JasonL</a> said in <a href="/post/357">Shared Global Context for each CloudCode invocation?</a>:</p>
<blockquote>
<p dir="auto">Based on the description of your use case, I'd recommend you to use <a href="http://help.getbraincloud.com/en/articles/3754150-custom-entities-a-scalable-and-flexible-app-data-storage-and-querying-solution" rel="nofollow ugc">custom entities</a>, which natively have the user access control (ACL) configured.  And check out this article about some size limits on entities in case you haven't see it. <a href="http://help.getbraincloud.com/en/articles/3472603-what-are-the-size-limits-on-user-entities" rel="nofollow ugc">http://help.getbraincloud.com/en/articles/3472603-what-are-the-size-limits-on-user-entities</a></p>
</blockquote>
<p dir="auto">I've read that article, but it doesn't talk specifically about Global Properties.</p>
<p dir="auto">What is the downside of going with Global Properties, or Global Entities?</p>
<p dir="auto">As far as ACL goes, I was planning on blacklisting most BrainCloud client apis (more likely whitelisting apis) and returning the data I want to go to the client with custom cloud code.</p>
]]></description><link>https://forums.getbraincloud.com/post/358</link><guid isPermaLink="true">https://forums.getbraincloud.com/post/358</guid><dc:creator><![CDATA[Travis Brown-John]]></dc:creator><pubDate>Fri, 30 Oct 2020 16:22:52 GMT</pubDate></item><item><title><![CDATA[Reply to Shared Global Context for each CloudCode invocation? on Fri, 30 Oct 2020 15:51:06 GMT]]></title><description><![CDATA[<p dir="auto">Based on the description of your use case, I'd recommend you to use <a href="http://help.getbraincloud.com/en/articles/3754150-custom-entities-a-scalable-and-flexible-app-data-storage-and-querying-solution" rel="nofollow ugc">custom entities</a>, which natively have the user access control (ACL) configured.  And check out this article about some size limits on entities in case you haven't see it. <a href="http://help.getbraincloud.com/en/articles/3472603-what-are-the-size-limits-on-user-entities" rel="nofollow ugc">http://help.getbraincloud.com/en/articles/3472603-what-are-the-size-limits-on-user-entities</a></p>
]]></description><link>https://forums.getbraincloud.com/post/357</link><guid isPermaLink="true">https://forums.getbraincloud.com/post/357</guid><dc:creator><![CDATA[JasonL]]></dc:creator><pubDate>Fri, 30 Oct 2020 15:51:06 GMT</pubDate></item><item><title><![CDATA[Reply to Shared Global Context for each CloudCode invocation? on Thu, 29 Oct 2020 23:23:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forums.getbraincloud.com/uid/5">@Paul-Winterhalder</a> said in <a href="/post/349">Shared Global Context for each CloudCode invocation?</a>:</p>
<blockquote>
<p dir="auto">Hi Travis,</p>
<p dir="auto">You have a few options:</p>
<ul>
<li>Global Entities - simple, basic API - but not very scalable. Definitely make sure you have &lt; 1000 entities.</li>
<li>Un-owned Custom Entities - more scalable, custom indexes, etc. Requires plus plan</li>
<li>Global Properties - store simple strings and smaller JSON objects</li>
</ul>
</blockquote>
<p dir="auto">Thanks Paul,</p>
<p dir="auto">Question: with Global Properties or any of these other approaches, what are some performance implications or limits to keep in mind?  Is 100kb of json (stringified) per property slot too large?</p>
<p dir="auto">I am looking for a place to store my global app "tuning" data.  The tuning is broken up into logical sections (for example: Clash Royale style loot drop tuning, world progression tuning etc.).   The largest sample tuning section I have right now is around 100kb of json data.  Is that too large?</p>
<p dir="auto">The tuning would be "read-only" from the client/players perspective: neither the client, nor cloud code could modify the tuning.  Some of the tuning would be sent down to the client, probably via a custom cloud script call (getClientTuning), and some of the of the tuning would be exclusive to the server (drop rates).</p>
<p dir="auto">I have been playing around with this idea in Cloud Code, and it would look something like this:</p>
<pre><code>    var tuning = {}
    tuning.lootbox= JSON.parse(bridge.getGlobalProperty('lootbox'));
    tuning.cards = JSON.parse(bridge.getGlobalProperty('cards'));
    tuning.levels= JSON.parse(bridge.getGlobalProperty('levels'));

    DropItems(tuning);
</code></pre>
<p dir="auto">Hope this makes some sense!<br />
Travis</p>
]]></description><link>https://forums.getbraincloud.com/post/356</link><guid isPermaLink="true">https://forums.getbraincloud.com/post/356</guid><dc:creator><![CDATA[Travis Brown-John]]></dc:creator><pubDate>Thu, 29 Oct 2020 23:23:34 GMT</pubDate></item><item><title><![CDATA[Reply to Shared Global Context for each CloudCode invocation? on Fri, 23 Oct 2020 00:11:11 GMT]]></title><description><![CDATA[<p dir="auto">Hi Travis,</p>
<p dir="auto">You have a few options:</p>
<ul>
<li>Global Entities - simple, basic API - but not very scalable. Definitely make sure you have &lt; 1000 entities.</li>
<li>Un-owned Custom Entities - more scalable, custom indexes, etc. Requires plus plan</li>
<li>Global Properties - store simple strings and smaller JSON objects</li>
</ul>
<p dir="auto">Those would be the main options. And yes - accessing them uses API calls - but remember, you get 3 free API calls in a script - and every call from then on is just 1/2 a count.</p>
<p dir="auto">So if you have a script that makes say 5 API calls - it will actually only cost you 2 API counts: 1 to call the script, 3 are free, and the remaining 2 calls are 1/2 each.</p>
<p dir="auto">Hope that helps!</p>
<p dir="auto">Paul.</p>
]]></description><link>https://forums.getbraincloud.com/post/349</link><guid isPermaLink="true">https://forums.getbraincloud.com/post/349</guid><dc:creator><![CDATA[Paul Winterhalder]]></dc:creator><pubDate>Fri, 23 Oct 2020 00:11:11 GMT</pubDate></item></channel></rss>