Skip to content
BENIBIX Learn

Seed Data

Development🗃️ DatabasesDatabases in Code

Also known as Database Seeding, Seeding, Seed File

Data put into an empty database at the start. The app or tests use it.

Think of it like

Think of it like putting toys in a new playroom. Then kids have something to play with on day one.

Example

Lucy joins Jack's team. She runs the seed script and gets 50 fake customers and 200 fake orders to test with.

Why it matters

An empty database makes an app hard to try out. Seed data gives everyone the same starting point.

Definition

Seed data is the first data a script puts into an empty database. It can be real data the app needs, like a list of countries. It can also be fake data for tests. A seed script runs after the migrations have built the tables. It lets each coder start with the same data in seconds. It should never hold real customer details or real passwords.

Common mistake

Seeding with a copy of real customer data. It puts private details on each laptop that runs it.

Key takeaways

  1. 1
    A starting point. Data in an empty database.
  2. 2
    After migrations. Tables first, then rows.
  3. 3
    Never real people. Fake names and emails only.