Symbiota2 Technical UpdateMary Barkworth – Utah State University
Ben Brandt – Northern Arizona UniversityNeil Cobb – Northern Arizona University
Curtis Dyreson – Utah State University Will Pearse – Utah State University
Outline• Installation
• Architecture
Installation• Symbiota site/portal manager installs and maintains
– Web server (typically apache)– DBMS (MySQL)– PHP– Search Engine (SOLR)– Symbiota code (from github)– Other goodies, e.g., phpmyadmin– Edits to various config files to configure
• Goal: make Symbiota2 easy to install, update, configure
Docker• Virtual machine, basic Linux environment• Runs on Mac, Windows, Linux, Android (but not Windows
CE, iOS)• Containers for various software
My Computer
Apache
MySQL
PHP …
DockerImageBuild
Your Computer
Docker Virtual MachineDockerImage
DockerImage
Symbiota2 Installation and Updates• Install Docker once
– Download Docker image from Symbiota2 github– Edit .env file to choose DBMS and configure– Run Docker at a terminal
docker-compose –up –d
– All necessary software provided in the image– Code example
• For developers– IDEs like PHPStorm update the Docker image– Canned starter database
Outline• Installation
• Architecture
Architecture of a Web Site - 1995
client server
GET http://symbiota2.org/api/index.htm
/api
foo.htm
index.htm
/junk
…
Architecture of a Web Site - 2005
client server
GET http://symbiota2.org/api/index.php
/api
foo.php
index.php
/junk
…
PHPInterpreter
MySQL DBMS
JavascriptInterpreter
Architecture of a Web Site - Current
client server
GET http://symbiota2.org/api/index
/api
foo.php
index.php
/junk
…
WebServices
MySQL DBMS
Router
…
…
…
ORM
Object-Relational Mapping (ORM)• Symbiota2 Tables and Relationships
– Next Slide
• Doctrine2 provides– Database abstraction
Drivers for MySQL, Postgres, SQLite– Map tables to objects
• Specify using annotations– Code Example
Benefits of Doctrine2 ORM• DBMS abstraction
Drivers for MySQL, Postgres, SQLite
• Schema is (completely) defined by ORM– Can generate DBMS schema from ORM– Define new ORM mappings, creates new tables in database– Change the ORM, changes pushed to the schema– Can migrate from MySQL to Postgres
JavascriptInterpreter
Architecture of a Web Site - Current
client server
GET http://symbiota2.org/api/index
/api
foo.php
index.php
/junk
…
WebServices
DBMS
Router
…
…
…
ORM
Doctrine2
API-Platform• Built on top of Symfony• Generates
– Router– Web services– Documentation
• Uses ORM and @API annotations– Code Example
JavascriptInterpreter
Architecture of a Web Site - Current
client server
GET http://symbiota2.org/api/index
/api
foo.php
index.php
/junk
…
WebServices
DBMS
Router
…
…
…
ORM
Doctrine2 API Platform
For Developers• Read-only developers
– Got you covered– Use an existing GET web service
• Data modification developers– Use an existing PUT web service– Use event model to attach data cleaners/transformers
• New kinds of data developers– Create ORM– Grow API Platform service end points from the ORM
Future - Controllers• Extra layer of abstraction
• ORM level may be too low-level• Can change ORM level
WebServicesORM
DBMS
Controllers
Future - Event-Based Model
• Cleaning plugin hooks into events between ORM and Web Services
• Translation plugin hooks into post Web Services events
JavascriptInterpreter
client server
GET http://smbiota2.org/api/index
/api
foo.php
index.php
/junk
…
WebServices
DBMS
Router
…
…
…
ORM
JavascriptInterpreter
client server
GET http://smbiota2.org/api/index
/api
foo.php
index.php
/junk
…
WebServices
DBMS
Router
…
…
…
ORM