How do you model projects, jobs, and media artifacts in a database?
Separate durable project data, generation attempts, and output references so revisions and retries remain traceable.
How do you model projects, jobs, and media artifacts in a database?
A project, a job, and an artifact represent different concepts. Keeping their relationships explicit helps the application explain what was requested and what actually exists.
Define identities and ownership
A project can store its owner and editable content. A generation job records the requested input version and processing state. Artifacts identify saved audio, images, captions, or video. Store references between these records rather than relying on filenames to reconstruct the relationship.
Plan for history and cleanup
Keep attempt information when retries need independent diagnosis. Record creation and update times, failure categories, and the canonical completed result. Do not put growing binary media directly into ordinary project records by default; use appropriate file storage and retain references. Walk through editing a script, regenerating a video, and deleting a project. The data model should identify both the current result and obsolete artifacts eligible for cleanup.
A project can have multiple revisions and generation requests, each with its own state and result.
No. Ownership should be established through trusted stored relationships and authorization checks.
The input version and job history needed to distinguish the new output from earlier results.
Related learning resources
Ready to master AI completely?
Want to upskill yourself, crack your next interview, and get your dream job? Join our comprehensive course to dive deeper with high-quality video tutorials, solve interview questions, and a premium community.
Master AI
Want to upskill yourself, crack your next interview, and get your dream job? Join our comprehensive course.

