# Dynamic ion-config.edn :app-name

**URL:** <https://forum.datomic.com/t/dynamic-ion-config-edn-app-name/1607>\
**Category:** Datomic Cloud\
**Created:** [August 28, 2020, 10:58pm UTC](https://forum.datomic.com/t/dynamic-ion-config-edn-app-name/1607 "2020-08-28T22:58:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kenny](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.datomic.com/kenny/32/529_2.png) [@kenny](https://forum.datomic.com/u/kenny)\
**Post date:** [August 28, 2020, 10:58pm UTC](https://forum.datomic.com/t/dynamic-ion-config-edn-app-name/1607/1 "2020-08-28T22:58:49Z")

</div>

I’d like to deploy the same ion config to N different Datomic Cloud systems and use the same config locally with dev-local. Datomic only allows the ion-config.edn to be specified as a static edn file on the classpath. Right now we have to dynamically generate that file for each datomic system at deploy time. It feels quite hacky though. I’d really like a single “master” config where I can customize the :app-name at deployment time. How are folks handling this now? Is there some undocumented way to do this now? If not, this would be a very helpful feature to add.

---

<div class="post-metadata">

**Author:** ![hadils](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.datomic.com/hadils/32/270_2.png) [@hadils](https://forum.datomic.com/u/hadils)\
**Post date:** [September 1, 2020, 12:17am UTC](https://forum.datomic.com/t/dynamic-ion-config-edn-app-name/1607/2 "2020-09-01T00:17:15Z")

</div>

I have the same problem with dev and prod. I was going to write the same code you already have. I don’t know of another way to do this.

---

<div class="post-metadata">

**Author:** ![m0smithtb](https://avatars.discourse-cdn.com/v4/letter/m/e19adc/32.png) [@m0smithtb](https://forum.datomic.com/u/m0smithtb)\
**Post date:** [September 2, 2020, 2:29pm UTC](https://forum.datomic.com/t/dynamic-ion-config-edn-app-name/1607/3 "2020-09-02T14:29:02Z")

</div>

After implementing a way to customize the app-name I finally realized the proper way to do it is to leave the app-name the same and set it in the query groups that are deployed.

When you deploy a query group, set the SystemName to the name of the Datomic Storage stack and set the ApplicationName to the app-name. By default it is set the SystemName.

---

<div class="post-metadata">

**Author:** ![kenny](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.datomic.com/kenny/32/529_2.png) [@kenny](https://forum.datomic.com/u/kenny)\
**Post date:** [September 2, 2020, 3:12pm UTC](https://forum.datomic.com/t/dynamic-ion-config-edn-app-name/1607/4 "2020-09-02T15:12:10Z")

</div>

To keep data isolated, we run separate topologies for each stage. I think what you described @m0smithtb only works with a single topology.

---

<div class="post-metadata">

**Author:** ![jmshelby](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.datomic.com/jmshelby/32/437_2.png) [@jmshelby](https://forum.datomic.com/u/jmshelby)\
**Post date:** [September 3, 2020, 8:10pm UTC](https://forum.datomic.com/t/dynamic-ion-config-edn-app-name/1607/5 "2020-09-03T20:10:13Z")

</div>

In the [planning documentation](https://docs.datomic.com/cloud/operation/planning.html#production-isolation) there is the scenario of isolated data, with multiple topologies/systems. It still mentions there, that the same rule applies - use the same application name, even across multiple systems. On deployment, you specify compute target name, which includes the system name as well. It has taken me a while to figure this out, and have finally ran across this section of the documentation today.

---

<div class="post-metadata">

**Author:** ![kenny](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.datomic.com/kenny/32/529_2.png) [@kenny](https://forum.datomic.com/u/kenny)\
**Post date:** [September 3, 2020, 9:20pm UTC](https://forum.datomic.com/t/dynamic-ion-config-edn-app-name/1607/6 "2020-09-03T21:20:14Z")

</div>

Geez, okay I think I have a better grasp on what’s going on now. The `:app-name` is a generic name for a bundle of code – it is entirely **independent** from the Datomic system name. When you deploy a Datomic compute or query topology, you specify the code bundle (`:app-name`) you want. If you don’t specify the `:app-name`, the default is the Datomic system name. There can only be **one** code bundle deployed to a compute/query topology at a time.

So it sounds like the solution for a “dynamic” `:app-name` is to actually use a static application name and specify that static application name when deploying your compute/query group.

Does this sound inline with your findings?

---

<div class="post-metadata">

**Author:** ![jmshelby](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.datomic.com/jmshelby/32/437_2.png) [@jmshelby](https://forum.datomic.com/u/jmshelby)\
**Post date:** [September 3, 2020, 11:26pm UTC](https://forum.datomic.com/t/dynamic-ion-config-edn-app-name/1607/7 "2020-09-03T23:26:38Z")

</div>

Yes @kenny - this is my understanding now as well. :app-name is static and unique to a code repo or project (thus being set in a file in that repo), for me, it makes sense just to use the repo name. The target compute group should basically always be specified in whatever deployment scripts or process is running the “deploy” command/fn. And yes, there can only be **one** application (or ion) running in a compute group at a time, which makes sense, because of the configuration needed to expose certain functions.

I think the biggest reason for my (and possibly other’s) confusion, was that the tutorials and many sample repos out there, use :app-name and “system name” interchangeably, and if you don’t specify an app name (during creation), the default is to match it with the system name. This makes sense, to keep it easy to play with datomic, and get a solo system + ions running quickly.

I haven’t discovered these things yet, because up until now, I’ve just been developing my application, and have only needed a solo topology (the same one I first created). I’ve only just recently started planning my production system, and dev/stage policies. That planning documentation is very useful, but, now we have to figure out how easy it is to change the application name on existing compute stacks (if possible at all).
