Skip to content

Development Instance Seeding Script #176

@dahlia

Description

@dahlia

Description

Currently, testing performance optimizations and database improvements (like index changes) in Hollo requires testing on production instances with real data. This makes development difficult and risky. We should create a development seeding script to generate realistic test data for local development.

Context

This need became apparent in PR #175 where index optimization testing requires substantial data volume that's not feasible to create manually. The contributor mentioned they couldn't reproduce performance issues in small test instances and needed to test on their actual production server.

Proposed Solution

Create a seeding script that generates realistic development data including:

Core Data

  • User profile and settings - Complete user profile with avatar, bio, preferences
  • Posts - Various content types (text, images, links, replies, quotes)
  • Media attachments - Sample images and files
  • Interactions - Likes, bookmarks, shares, replies

Social Graph

  • Followers/Following relationships - Realistic social connections
  • Mentions and replies - Conversational threads
  • Activity timeline - Chronological activity data

Federation Data

  • External accounts - Simulated remote users from other instances
  • Federated activities - ActivityPub interactions with remote instances
  • Delivery queues - Outbound federation activities

Performance Testing Data

  • Large datasets - Configurable volume (1K, 10K, 100K posts)
  • Time-distributed data - Posts spread across realistic time periods
  • Varied content sizes - Mix of short and long posts with media

Implementation Considerations

  1. CLI interface - pnpm seed:dev [--size small|medium|large]
  2. Configurable volume - Allow different dataset sizes
  3. Faker.js integration - Generate realistic but fake content
  4. Database transaction safety - Proper cleanup and rollback capabilities
  5. Development-only - Clear guards against running in production

Benefits

  • Performance testing - Test database optimizations locally
  • Feature development - Develop UI features with realistic data
  • Regression testing - Catch performance regressions early
  • Onboarding - New contributors can quickly set up realistic test environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions