Setting up a Research Database
Learn how to design and organize your research data for optimal usability
Introduction
Creating an effective research database is essential for organizing, analyzing, and sharing your scientific data. Cnidarity provides a flexible platform for modeling and managing various types of research data, from experimental results to specimen collections, literature references, and more.
This guide will walk you through the process of setting up a comprehensive research database tailored to your specific research needs. We'll cover database planning, data modeling, attribute selection, and relationship design, with practical examples to help you get started.
Planning Your Database
Proper planning is crucial before building your research database. This step ensures that your data structure will accommodate your research needs and facilitate efficient data management.
Identify Your Research Objectives
Begin by clearly defining what you want to achieve with your database:
- What types of data will you collect?
- What questions do you need to answer with this data?
- How will the data be analyzed?
- Who needs access to the data and how will they use it?
Outline Your Data Entities
List all the main "things" (entities) you need to track in your research:
Example Entities for Different Research Types
- Clinical Research: Patients, Visits, Treatments, Lab Tests, Adverse Events
- Environmental Research: Sites, Samples, Observations, Measurements, Equipment
- Lab Research: Experiments, Specimens, Protocols, Reagents, Results
- Literature Review: Publications, Authors, Topics, Keywords, Notes
Map Entity Relationships
Sketch out how your entities relate to each other:
- Which entities are connected?
- What is the nature of their relationship (one-to-one, one-to-many, many-to-many)?
- Are there hierarchical relationships (parent-child)?
Create a simple diagram showing your entities as boxes and relationships as lines between them. This visual representation can help identify potential issues in your data structure before building it.
Creating Effective Models
After planning your database structure, the next step is to create models in Cnidarity that represent your research entities. Each model will have its own set of attributes and relationships.
Model Design Principles
Follow these principles when creating your models:
Single Responsibility
Each model should represent one clear type of entity. Avoid creating "catch-all" models that try to store multiple types of data.
Example: Instead of a generic "Data" model, create specific models like "Patient", "Sample", and "Measurement".
Normalization
Avoid redundancy by structuring your models to eliminate duplicated data. Store information in the most appropriate model.
Example: Store researcher information in a "Researcher" model rather than duplicating contact details in every experiment record.
Consistent Naming
Use clear, consistent naming conventions for your models and their attributes. This makes your database more intuitive to use.
Example: Use singular nouns for model names (e.g., "Experiment" not "Experiments") and descriptive names for attributes (e.g., "collection_date" not just "date").
Creating Models in Cnidarity
To create models in your project:
- Navigate to your project dashboard
- Click on "Models" in the navigation
- Click the "Create Model" button
- Provide a name, short description, and detailed description for your model
- Click "Create Model" to add it to your project
Consider your model names carefully. While you can edit a model's display name and description later, changing the underlying model name after creating attributes and relationships can be complex.
Choosing the Right Attributes
Attributes are the specific data points you collect for each entity in your research. Selecting appropriate attribute types ensures data accuracy, validation, and usability.
Essential Attributes for Research Data
Most research models should include these fundamental attribute types:
Purpose | Attribute Type | Example |
---|---|---|
Unique Identifiers | Text | sample_id, patient_code, experiment_number |
Categorical Data | Select | sample_type, treatment_group, status |
Temporal Data | Date | collection_date, experiment_start, follow_up_time |
Quantitative Measurements | Number | concentration, weight, temperature, score |
Descriptive Text | Text Area | observations, methodology, notes |
Binary Conditions | Boolean | is_control, has_complication, passed_quality_check |
Attribute Selection Strategy
Follow these guidelines when defining attributes:
Be Comprehensive but Focused
Include all necessary fields for your research questions, but avoid the temptation to add attributes "just in case." Focus on data that you will actually collect and analyze.
Use Appropriate Validation
Set validation rules that ensure data accuracy. For example, set minimum/maximum values for numeric fields, use required fields for essential data, and create specific regex patterns for formatted text.
Prefer Structured Over Unstructured Data
When possible, use specific attribute types rather than storing everything as text. This facilitates searching, filtering, and analysis. For example, use a Select attribute for predefined categories rather than free text.
Remember that attribute types cannot be changed after creation. If you're unsure about the right type, consider your data format, validation needs, and how you'll query the data later.
Establishing Relationships
Relationships connect different models in your database, creating a network of related data that mirrors the real-world connections in your research. Properly designed relationships are essential for a useful research database.
Common Research Relationship Types
In research databases, you'll typically need these relationship patterns:
Hierarchical (Parent-Child)
One entity contains or owns multiple instances of another entity.
Example: A Study contains multiple Experiments, which each contain multiple Samples.
In Cnidarity: Create a relationship with Related Records Limit = 0 (unlimited).
Reference
One entity refers to exactly one instance of another entity.
Example: A Sample belongs to one Subject, a Result comes from one Experiment.
In Cnidarity: Create a relationship with Related Records Limit = 1.
Collaborative
Multiple entities of one type are associated with multiple entities of another type.
Example: Researchers collaborate on multiple Studies, each Study involves multiple Researchers.
In Cnidarity: Create two relationships (one in each direction) with Related Records Limit = 0.
Creating Effective Relationships
When establishing relationships between your models, consider these practices:
- Use descriptive names: Name relationships clearly (e.g., "experiment_samples" or "primary_investigator").
- Configure display attributes: Select attributes from the related model that best identify it (e.g., title, ID, name).
- Set appropriate limits: Use the Related Records Limit to enforce structural rules (e.g., an experiment must have exactly one protocol).
- Make critical relationships required: For essential connections, check the "Required" option to ensure data integrity.
Before creating relationships, ensure you've created all the necessary models. While you can add relationships at any time, planning your entire data structure first will save time and prevent rework.
Example Research Database
To illustrate how all these concepts come together, let's walk through an example research database for a hypothetical ecological field study.
Project: Coastal Ecosystem Monitoring
This project tracks monitoring activities at coastal sites, collecting data on water quality, species observations, and environmental conditions.
Model 1: Site
Purpose: Track monitoring locations
Key Attributes:
- site_code (Text, Required): Unique identifier
- name (Text, Required): Descriptive name
- latitude (Number): Geographical coordinate
- longitude (Number): Geographical coordinate
- habitat_type (Select): Type of coastal habitat
- access_notes (Text Area): Information on site access
Relationships:
- Has many Visits (unlimited)
Model 2: Visit
Purpose: Document site visits and conditions
Key Attributes:
- visit_date (Date, Required): When the visit occurred
- weather_conditions (Select): Weather during visit
- tide_level (Number): Tide height in meters
- temperature (Number): Air temperature (°C)
- visit_notes (Text Area): General observations
Relationships:
- Belongs to one Site (required)
- Has many Samples (unlimited)
- Has many Observations (unlimited)
Model 3: Sample
Purpose: Track water and sediment samples
Key Attributes:
- sample_id (Text, Required): Unique identifier
- sample_type (Select, Required): Water or sediment
- collection_time (Date): Precise collection time
- depth (Number): Collection depth in meters
- ph_level (Number): pH measurement
- storage_location (Text): Where sample is stored
Relationships:
- Belongs to one Visit (required)
- Has many Test Results (unlimited)
Model 4: Observation
Purpose: Record species sightings
Key Attributes:
- species_name (Text, Required): Species observed
- observation_time (Date): Time of observation
- count (Number): Number of individuals
- behavior (Select): Observed behavior
- photo_taken (Boolean): Whether photos exist
- notes (Text Area): Additional observations
Relationships:
- Belongs to one Visit (required)
Model 5: Test Result
Purpose: Store laboratory analysis results
Key Attributes:
- test_type (Select, Required): Analysis performed
- test_date (Date, Required): When test was done
- result_value (Number): Numerical result
- units (Text): Measurement units
- method_used (Text): Analysis method
- notes (Text Area): Comments on results
Relationships:
- Belongs to one Sample (required)
This database structure allows researchers to track site visits, collect samples and observations, and record test results in a structured way that reflects the hierarchical nature of ecological field research.
Best Practices
To maximize the effectiveness of your research database in Cnidarity, follow these best practices:
Start Small and Iterate
Begin with a minimal viable database structure and refine it based on actual usage. It's easier to add to a simple database than to reorganize a complex one. Create core models first, then expand as needed.
Use Standardized Terminology
Maintain consistent naming conventions across your database. This includes using standard field names, units of measurement, and classification systems recognized in your research discipline.
Document Your Database Structure
Use the description fields for models and attributes to document their purpose, expected values, and conventions. This helps team members understand how to use the database correctly.
Plan for Data Export and Analysis
Consider how you'll export and analyze your data when designing your database structure. Ensure your models and attributes will support the types of queries and reports you'll need.
Test with Sample Data
Before committing to your database structure, test it with sample data that represents real research scenarios. This helps identify potential issues before you've collected significant amounts of data.
Consider Long-term Data Preservation
Design your database with long-term archiving in mind. Include sufficient metadata and documentation to ensure your data remains meaningful and reusable even years after collection.
Remember that a well-designed research database is more than just a data repository—it's a tool that actively supports your research workflow, enables collaboration, and enhances the value of your collected data.