App Factory uses the same datasource name to connect the application with different databases in different environments. When you promote/demote an application from one lifecycle stage to another, App Factory automatically connects it with respective databases using the same datasource name. This datasource uses a unique name but is registered with different connection details across different stages of the application's lifecycle.
Figure 1: Same datasource name is registered in all environments
The four default App Factory user roles have different levels of permissions in creating and configuring datasources as shown below:
|User Role||Level of Permissions|
|App Owner||Can create and edit datasources in Development and Testing environments|
|Developer||Can create and edit datasources in Development environment|
|QA||Can configure a datasource in Testing environment|
|DevOps||Can configure a datasource in Production environment|
In a typical development environment, developer build applications around customer data stored in production databases to which they do not have access. Developers create datasources to point to the dummy databases in the development environment. After the development work is complete, the application is promoted to Testing and Production environments. As explained below, at each of stage, QA or a DevOps persons can map the endpoint URL of the development database and point the same datasource to testing or the production databases without changing the application's code.
Before you begin, follow the steps in . Once you are done, you will have the following users imported to the system:
Follow the steps below to create a datasource for your application and reuse it in different lifecycle stages: