Author image Christopher Fields
and 1 contributors




  use Bio::DB::BioSQL::MultiDB;

  # create the common biosql db adaptors
  my $swissprot_db;  # Physical databases may be located on different servers
  my $embl_db;       # or accessible by different users.

  # register them by bio-database
  my $multiDB = Bio::DB::BioSQL::MultiDB->new(
      'swissprot' => $swissprot_db,
      'embl' => $embl_db

  # Each time before you want to create a persistent object for
  # Bio::Seq, assign the 'namescape' sub of seq object first, as the
  # biodatabase name.
  my $seq;    # for either store or fetch.

  # OR you need to assign the default namespace for multiDB

  my $pseq = $multiDB->create_persistent($seq);

  # If you want to fetch a seq, then you have to specify namespace for
  # multiDB first
  $pseq = $multiDB->get_object_adaptor->find_by_unique_key($seq);


The scalability issue will arise, when multiple huge bio databases are loaded in a single database in RDBMS, due to the scalability of the RDBMS. So one solution to solve it is simply to distribute them into multiple physical database, while a user expects to manage them by one logic adaptor.

So here you go, MultiDB aims at such issue to solve. The way to apply that is pretty simple. You, first, load data from different biodatabase, such as swissprot or embl, into physical RDBMS databases; then create a db adaptor for each simple physical biosql db; finally register these adaptors into MultiDB and use it as that was a normal dbadaptor.


Juguang Xiao,





This method offers the same interface as Bio::DB::BioSQL::DBAdaptor, hence the usage is same as well.

NOTE: You need to assign $obj->namespace as the biodatabase name, such as embl, before you invoke this method.

Get/Set for default namespace