homepage

A Database for Neural Simulations

Introduction

This document seeks to design a database suitable for the internal data structures of NEURON and of neural simulators in general. A database is a software tool for organizing and managing data.

The State of the Art

Currently NEURON and all other state of the art neural simulators are written in an object oriented programming style. Data is held in arrays of structures or classes which are connected together by pointers. They use the programming languages built-in data structures and algorithms. Their data structures are specified by their source code, which works well for an immediate implementation, but also forces them to use the syntax and semantics of the programming language which they write in.

The case for using a Database

Innovations

Most of aspects of this design are not novel. Rather, they came about as solutions to common problems that arose in the course of implementing neural simulators. What is novel is the combination of all of these pieces to form a cohesive set of tools, where all of the pieces work together with synergy but still remain flexible.

User Profiles

The database will be used by two groups of people: first by programmers and then by the end users of their programs. The database will have two API’s, one for each user group.

Profile of a Computer Programmer

Profile of the End User

Two API’s

The programmers API allows access to the data arrays.

The end users API presents an easy to use interface:

Terminology

This database is tailored for running physics simulations, and to that end it has special words for dealing with the physical things which exist in your simulation.

There is a clear correspondence between these terms and the more familiar object oriented terminology of C, C++, Python, etc. For example consider the following python program:

class Neuron:
    def __init__(self):
        self.voltage = -70 # mV

my_neuron = Neuron()

Now let’s describe this program using the database terminology:

Requirements

Creating Schema

Components

There are many different types of components for representing different and specialized data structures and algorithms.

Attributes

Global Constants

Sparse Matrixes

Error Checking

Each component can be configured to check for common issues.

Entities

Entity Handles

EntityHandles are special code objects that the database uses to represent a specific entity.

Entity Storage and Movement

Pointers

A pointer is a way to refer to an Entity.

Destroying Entities

Pointers to destroyed entities are invalid and must be either overwritten or destroyed. Components containing pointer values can be configured to either allow or disallow NULL pointers.

Sets of Entities

Programmers will need persistent references to large numbers of entities.

To meet this need: the database could implement efficient collection types for Entities.

However, I would recommend deferring the design and implementation of this idea until after the rest of the database is implemented and programmers start trying to use it, at which point it will become more clear what faculties the database lacks regarding collections of entities.

Documentation

As the central repository for the data, it makes sense to also store any descriptions of the data in the database too.

Introspection

The database will provide an API for inspecting its database schema and all associated meta-data, at run time.

Hardware Memory Spaces

The database can utilize multiple memory spaces.

TODO: how is this specified? by default where do things live? what kind of controls does the programmer/user have over it?

Other Ideas

Grids of Entities

An Archetype could define a regular grid to place Entities on and provide tools for efficiently working with grids of Entities. For example this could be used to implement extracellular diffusion at a course granularity.

Temporary Buffers

It might be nice to have your working data be managed by the database, but not persistently stored. The programmer would be responsible for free’ing it when they’re done with it, or else it would just sit around like permanent data.

Spatial Partitioning Structures

Linear Systems