System architecture
Perforce TeamHub 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 Perforce TeamHub stack can be split into a number of servers, known as a Enterprise setup
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
Perforce TeamHub has two HTTP servers: Apache and Unicorn. Apache is responsible for handling version control operations, and Unicorn serves Perforce TeamHub Web applications.
Application
Perforce TeamHub 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, TeamHub adheres to an API-first strategy. Any functionality seen in the TeamHub UI can be achieved programmatically with Perforce TeamHub APIs.
Packages
Perforce TeamHub relies on various open source packages that are bundled with TeamHub. Packages are precompiled for TeamHub supported operating systems, and are completely isolated from the rest of the system. Following are some of the packages bundled with TeamHub:
- Git, Subversion, Mercurial - TeamHub supported Version Control Systems.
- Resque - Handles background jobs.
- GraphicsMagick - Processes images uploaded to TeamHub.
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
Perforce TeamHub closely follows Linux File System Hierarchy Standard for its data and bundled packages. Here is the layout of the file system hierarchy TeamHub 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 TeamHub touches, see System overrides.