application-components

Galaxy Application Components: Models, Managers, and Services

Learning Questions

Learning Objectives

This section will talk about that manager layer and what lies below

There are many ways to describe and visualize the Galaxy server architecture, one is to imagine the Galaxy database as the ultimate source for Galaxy “stuff” and the API controllers as the ultimate sink.

In this architecture imagining of Galaxy, managers are the layer meant to mediate all controller interactions (and isolate the backend from the web framework) while the model layer is meant to mediate all database interactions (and isolate the backend from database internals).

Models and Managers

Services

Handle API and web processing details of requests and responses at a high-level.

Thin layer below the controllers to shield applciation logic from FastAPI internals.

In practice, it is totally fine to skip this layer and have FastAPI controllers talk directly to managers. Also in practice, there are many places where the controller or service layers are thicker than they should be - and these are anti-patterns that shouldn’t be followed.

Managers

High-level business logic that ties all of these components together.

Controllers should ideally be thin wrappers around actions defined in managers.

Whenever a model requires more than just the database, the operation should be defined in a manager instead of in the model.

Managers - Some Key Files

Key Managers

Managers - Some Helpers

Manager Helpers

Galaxy Models

SQLAlchemy Architecture

Galaxy Database Schema Migrations

More on Schema Migrations

Database Diagram

Galaxy Schema

https://galaxyproject.org/admin/internals/data-model/

HDA foor bar...

HDA Dataset

Dataset Metadata

HDAs and HDCAs

Workflows

Workflow Running

Libraries

Library Permissions

Key Takeaways