System architecture
P4 DAM software is composed of popular and powerful open source technologies, which are used in today’s most advanced cloud solutions. The architecture is layered. Each component has its own role in serving user requests.
The entire stack is provided as a standalone native operating system package, also known as a Standard setup. Alternatively, the P4 DAM stack can be split into a number of servers, known as a Enterprise setup. Regardless of the deployment type, the logical layers are as follows:
Proxy
Nginx proxy sits at front and handles all user requests. Based on the operation type (static page, version control system, or Web application) requests are forwarded to the appropriate component.
HTTP server
P4 DAM has two HTTP servers: Apache and Unicorn. Apache is responsible for handling version control operations, and Unicorn serves P4 DAM Web applications.
Application
P4 DAM consists of two major components. On the frontend is Ember powered application responsible for providing a UI to TeamHub APIs. The backend is powered by Ruby on Rails, which exposes RESTful APIs and the TeamHub admin UI. It's important to note, P4 DAM adheres to an API-first strategy. Any functionality seen in the P4 DAM UI can be achieved programmatically with Perforce TeamHub APIs.
Packages
P4 DAM relies on various open source packages that are bundled with P4 DAM. Packages are precompiled for P4 DAM supported operating systems, and are completely isolated from the rest of the system. Following are some of the packages bundled with P4 DAM:
- Resque - Handles background jobs.
- GraphicsMagick - Processes images uploaded to P4 DAM.
Database
At the heart of the stack are the two NoSQL databases. MongoDB is used for storing application data. Redis keeps intermediate data, background jobs and events for example.
File system hierarchy
P4 DAM closely follows Linux File System Hierarchy Standard for its data and bundled packages. Here is the layout of the file system hierarchy P4 DAM uses:
/opt/hth
The root folder for application and its dependencies./opt/hth/bin
The administrator utilities and tools (see Perforce TeamHub control)./var/opt/hth/shared
The data directory with all user data, such as repositories and uploads./var/opt/hth/db
The database directory./var/opt/hth/backups
The directory where backups are stored./var/log/hth
Application and system logs.
For a detailed list of system-wide configuration files that P4 DAM touches, see System overrides.