# Key concepts

There are a number of foundational concepts that you will come across as you develop and deploy apps on the Appfarm platform. You will find that development is easier and faster if you first understand how these concepts fit together.

{% @arcade/embed flowId="JbSzneMvTnj2kZsRnxSm" url="<https://app.arcade.software/share/JbSzneMvTnj2kZsRnxSm>" fullWidth="true" %}

## Solution

When you are signed into Appfarm Create, you are in the context of a *solution*. If you have access to multiple solutions this is indicated by an arrow (:arrow\_down\_small:) next to the name of your current solution.

![Solution menu](/files/CC2qS8p2WeWeK228nVBo)

A solution is a distinct development environment which contains [apps](#apps) and [services](#services) that share a [global data model](#global-data-model). The apps and services in a solution share a common root URL for end-user access, relative to the deployment [environment](#environment) in use.

![Visual representation of the key concepts in a solution where apps and services leverage a shared global data model.](/files/L4mM8lGwZUat7Q1rqyxN)

## Global data model

The *global data model* is where you define all your business objects, or *object classes*. The global data model is shared across all the apps and services in a solution. This enables different views into your business data by creating applications tailored to different roles and use cases.

On top of the global data model, you can define a granular security layer controlling who can create, read, update and delete data.

{% hint style="info" %}
Read more about the [global data model](/reference/data-model.md) in the reference guide.
{% endhint %}

## App

An *app* is a web application composed of a user interface, data sources, and actions. Data sources provide access to the data in the global data model as well as other application-specific data. Actions enable application flow and business logic. The user interface is connected to data sources and actions to display data and collect and respond to user input.

Apps can range from advanced desktop business applications to lightweight mobile web apps.

{% hint style="info" %}
Read more about [apps](/reference/apps.md) in the reference guide.
{% endhint %}

## Service

A *service* can be thought of as an app without a user interface. A service is composed of one or more endpoints, data sources, and optionally actions. An endpoint acts as the external interface of the service, facilitating which data is returned and what actions, if any, are triggered.

Services are triggered by external web requests, by schedules, or by other services and apps.

{% hint style="info" %}
Read more about [services](/reference/services.md) in the reference guide.
{% endhint %}

## Data source

You define which objects from your global data model you want to use in an app or service by creating *data sources*. A data source may hold one or many objects. This is referred to as *cardinality*. A data source with a cardinality of many can be configured with a filter to contain a subset of objects. You can create multiple data sources that point to the same object class.

{% hint style="info" %}
Read more about [data sources](/reference/apps/data/data-sources.md) in the reference guide.
{% endhint %}

## Action

An *action* is where you define application flow and business logic such as navigation, data manipulation and iterations, conditional logic, file import/export, web requests to external APIs, and more.

In apps, actions are triggered by events such as when a user first loads an app, clicks a button, or uses a keyboard shortcut. In services, actions are triggered when an endpoint is called.

An action consists of one or more action nodes, which are pre-built logic and function blocks that you can easily combine and configure. Many action nodes are common for apps and services, but some are only relevant for one of them, such as navigation logic for apps.

{% hint style="info" %}
Read more about [actions](/reference/actions.md) in the reference guide.
{% endhint %}

## Users, roles and permissions

Appfarm implements a layered approach to security through *users*, *roles* and *permissions*. For a user, whether they are a human or an external API, to access and use an app or service, they must be assigned a role that has been granted the necessary permissions.

A *user* exists at the solution level and spans all enabled deployment environments. Each user can be assigned one or more *roles*, for example `Administrator` or `Editor`. Each role is granted *permissions*, which are granular definitions of what environments, functionality, and data that role can interact with. The sum of the permissions granted to a user's roles determines their access.

{% hint style="info" %}
Read more about [security and permissions](/reference/security.md) in the reference guide.
{% endhint %}

## Environment

A solution can be deployed across four environments: Development, Test, Staging, and Production. The environments available in a given solution depend on your solution tier. The Development, Test, and Production environments each have their own separate databases. The Staging environment uses the Production database.

All changes are automatically deployed to the Development environment as you make changes in Appfarm Create. In order to push changes to another environment you must manually deploy them.

{% hint style="info" %}
Read more about [environments](/how-to/security-testing-and-deployment/test-and-debug.md).
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.appfarm.io/getting-started/key-concepts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
