Database Options for OJS
Open Journal Systems uses a relational database to store all journal content, submissions, users, and workflow state. Choosing the right database engine โ and understanding the broader database landscape โ helps site administrators make informed decisions about performance, scalability, and long-term maintenance.
1. Databases Officially Supported by OJSโ
OJS supports two RDBMS engines out of the box. The choice is made in config.inc.php before running the installer.
1.1 MySQL 8.xโ
| Property | Value |
|---|---|
| Type | RDBMS |
| Licence | GPL (Community) / Commercial (Enterprise) |
| OJS driver | mysqli |
| Character set | utf8mb4 (required for emoji / full Unicode) |
| PKP default | Yes โ most community documentation assumes MySQL |
MySQL is the most widely used database for OJS installations. It is included in every major Linux distribution's package repositories and supported by all control panels (cPanel, Plesk, HestiaCP, CyberPanel).
Recommended config.inc.php for MySQL:
driver = mysqli
host = localhost
username = ojsuser
password = your_password
name = ojs_production
Minimal my.cnf tuning for OJS:
[mysqld]
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
innodb_buffer_pool_size = 512M ; Set to ~50-70% of available RAM
innodb_log_file_size = 128M
max_allowed_packet = 128M
query_cache_type = 0 ; Disable query cache (deprecated in MySQL 8)
1.2 PostgreSQLโ
| Property | Value |
|---|---|
| Type | RDBMS โ Advanced Features |
| Licence | PostgreSQL Licence (permissive open source) |
| OJS driver | postgres9 |
| PKP support | Fully supported; some PKP developers prefer it |
| Strengths | ACID compliance, JSON support, advanced indexing, full-text search |
PostgreSQL is the preferred choice for larger installations, multi-journal deployments, or administrators who need advanced query features. It is also better suited for read-heavy workloads with complex analytics (e.g., COUNTER statistics).
Recommended config.inc.php for PostgreSQL:
driver = postgres9
host = localhost
username = ojsuser
password = your_password
name = ojs_production
Database creation:
CREATE USER ojsuser WITH PASSWORD 'your_password';
CREATE DATABASE ojs_production
OWNER ojsuser
ENCODING 'UTF8'
LC_COLLATE 'en_US.UTF-8'
LC_CTYPE 'en_US.UTF-8';
GRANT ALL PRIVILEGES ON DATABASE ojs_production TO ojsuser;
postgresql.conf performance tuning:
shared_buffers = 512MB # ~25% of RAM
work_mem = 32MB
maintenance_work_mem = 128MB
effective_cache_size = 1GB
random_page_cost = 1.1 # For SSD storage
checkpoint_completion_target = 0.9
2. MySQL-Compatible Databases (Drop-in Replacements)โ
Several databases are wire-compatible with the MySQL protocol and can be used with OJS's mysqli driver without code changes.
2.1 MariaDBโ
| Property | Value |
|---|---|
| Type | RDBMS โ MySQL compatible |
| Licence | GPL |
| OJS support | Works with mysqli driver; widely used in the community |
| Default in | Ubuntu (when installed via apt install mariadb-server) |
MariaDB is a community-developed fork of MySQL, created by MySQL's original developer (Monty Widenius) after Oracle acquired MySQL. It is a drop-in replacement for MySQL and the default database on many Linux distributions and control panels.
Key differences from MySQL 8:
- No authentication change to
caching_sha2_password(usesmysql_native_passwordby default โ important for some PHP versions) - Slightly different query optimizer (sometimes faster for reporting)
- Galera Cluster for multi-master replication (useful for high-availability OJS)
CONNECTstorage engine for CSV/JSON data
MariaDB is recommended over MySQL for: most OJS deployments on Ubuntu/Debian, users of HestiaCP or CyberPanel, and anyone wanting simpler apt-based management.
Source: MariaDB Documentation
2.2 Percona Server for MySQLโ
| Property | Value |
|---|---|
| Type | RDBMS โ MySQL-compatible, enhanced |
| Licence | GPL |
| OJS driver | mysqli (compatible) |
| Strengths | XtraDB storage engine, superior InnoDB performance, audit logging, Percona Toolkit |
Percona Server is a drop-in replacement for MySQL with enhanced performance, more detailed monitoring, and enterprise-grade features at no cost. It is particularly suitable for high-volume OJS multi-journal installations where InnoDB performance is critical.
When to use Percona:
- You have 10+ active journals on a single installation
- You need detailed MySQL performance metrics (Percona Monitoring and Management โ PMM)
- You require audit logging for compliance (HIPAA, GDPR)
- You want automatic schema change without downtime (Percona Online Schema Change)
Source: Percona Server Documentation
2.3 TiDBโ
| Property | Value |
|---|---|
| Type | Distributed RDBMS โ MySQL compatible |
| Licence | Apache 2.0 |
| OJS driver | mysqli (TiDB is MySQL protocol compatible) |
| Architecture | Distributed SQL โ scales horizontally across nodes |
| Use case | Very large scale, cloud-native, multi-region |
TiDB is a distributed SQL database that is MySQL-wire-compatible. It is designed for very large data volumes (billions of rows) and cloud-native deployments with horizontal scaling. For typical OJS deployments (even large multi-journal setups), TiDB is over-engineered. However, it could be relevant for a national repository running hundreds of journals with millions of submissions.
OJS + TiDB considerations:
- TiDB does not support all MySQL features (e.g., some stored procedures,
FULLTEXTindexes) - OJS has not been officially tested with TiDB; test thoroughly before production use
- Suitable only for very large institutional repositories, not for individual journal hosting
Source: TiDB Documentation
2.4 CockroachDBโ
| Property | Value |
|---|---|
| Type | Distributed RDBMS โ PostgreSQL compatible |
| Licence | BSL (core) / Enterprise |
| OJS driver | postgres9 (CockroachDB speaks PostgreSQL wire protocol) |
| Architecture | Distributed; automatic replication, geo-partitioning |
CockroachDB is a distributed PostgreSQL-compatible database designed for global applications with automatic failover. Like TiDB, it is significantly over-engineered for most OJS deployments but could be relevant for very large-scale national or international platforms.
OJS + CockroachDB considerations:
- PostgreSQL wire protocol means OJS's
postgres9driver should work - CockroachDB does not support all PostgreSQL extensions (e.g., specific aggregate functions)
- Requires careful testing; not officially supported by PKP
3. Database Landscape: NoSQL and Other Systemsโ
The following databases are commonly encountered in web infrastructure discussions. While none of them are supported as OJS primary databases, understanding them helps administrators who run OJS alongside other applications or services.
3.1 SQLiteโ
| Property | Value |
|---|---|
| Type | RDBMS โ Lightweight, embedded |
| Licence | Public Domain |
| OJS support | โ Not supported for OJS |
| Use cases | OJS local development / testing only, embedded applications |
SQLite stores the entire database in a single file. It is not suitable for production OJS because:
- No concurrent write support (single-writer model)
- Not designed for multi-process web server access
- No network access (can't be used with separate app/database servers)
SQLite can be useful for local development if you run OJS via Docker and want a zero-config database for quick testing, but PKP does not officially support it.
3.2 MongoDBโ
| Property | Value |
|---|---|
| Type | NoSQL โ Document storage |
| Licence | SSPL (Server Side Public Licence) |
| OJS support | โ Not supported |
| Strengths | Schema flexibility, horizontal scaling, JSON documents |
MongoDB stores data as BSON (binary JSON) documents. It is widely used for content management applications, but OJS's relational schema (foreign keys between submissions, users, journals, review rounds) is fundamentally relational and does not map well to a document model. OJS cannot use MongoDB as its primary database.
Where MongoDB is relevant to an OJS ecosystem:
- Storing analytics/telemetry data alongside OJS
- An API layer that caches OJS content for high-read scenarios
- Companion applications (e.g., author profile aggregation)
3.3 Redisโ
| Property | Value |
|---|---|
| Type | NoSQL โ In-memory key-value store |
| Licence | RSALv2 / SSPL (v7.4+), earlier versions BSD |
| OJS integration | โ Supported as session cache and object cache |
Redis is NOT an OJS primary database. However, it is directly relevant to high-performance OJS deployments as:
- PHP Session Storage: OJS can use Redis to store PHP sessions, enabling sticky-session-free horizontal scaling across multiple app servers.
- Object Cache: With an object caching layer, repetitive database queries (e.g., journal configuration, navigation menus) are served from RAM.
Enable Redis for PHP sessions:
; /etc/php/8.2/fpm/pool.d/ojs.conf
php_value[session.save_handler] = redis
php_value[session.save_path] = "tcp://127.0.0.1:6379"
3.4 Apache Cassandraโ
| Property | Value |
|---|---|
| Type | NoSQL โ Wide-column distributed store |
| Licence | Apache 2.0 |
| OJS support | โ Not supported |
| Strengths | Linear write scalability, no single point of failure, multi-datacenter |
Cassandra excels at time-series data, IoT, and large-scale write-heavy workloads. It is not suitable for OJS because OJS requires complex JOIN queries and relational consistency that Cassandra does not support.
3.5 Couchbase Serverโ
| Property | Value |
|---|---|
| Type | NoSQL โ Document storage + Key-value |
| Licence | BSL / Enterprise |
| OJS support | โ Not supported |
| Notable feature | Mobile sync (Couchbase Lite); N1QL query language |
Couchbase is a document database designed for mobile-first applications and offline sync. Not applicable to OJS's server-side relational data model.
3.6 ArangoDBโ
| Property | Value |
|---|---|
| Type | Multi-model โ Graph, document, key-value |
| Licence | BSL (core) |
| OJS support | โ Not supported |
| Strengths | Single engine for graph, document, and key-value queries (AQL query language) |
ArangoDB's multi-model nature makes it attractive for applications requiring graph traversal (e.g., citation networks, co-authorship graphs). While not an OJS database, it could be used in a companion service that analyses citation relationships across journal content.
3.7 RethinkDBโ
| Property | Value |
|---|---|
| Type | NoSQL โ Document storage, real-time push |
| Licence | Apache 2.0 |
| OJS support | โ Not supported |
| Notable feature | Real-time changefeeds โ database pushes updates to clients without polling |
RethinkDB is well-suited for real-time collaboration applications (collaborative editing, live dashboards). Its development has slowed significantly in recent years. Not applicable to OJS.
3.8 Cloudant (IBM)โ
| Property | Value |
|---|---|
| Type | NoSQL โ Distributed document store (CouchDB-based) |
| Licence | Commercial (IBM Cloud service) |
| OJS support | โ Not supported |
| Notable feature | Managed CouchDB; HTTP API; geo-distributed replication |
IBM Cloudant is a managed CouchDB-as-a-service. Not applicable to OJS's relational model.
3.9 OrientDBโ
| Property | Value |
|---|---|
| Type | Multi-model โ Graph and document |
| Licence | Apache 2.0 (Community) / Commercial |
| OJS support | โ Not supported |
| Notable feature | Supports SQL-like query syntax over graph data |
OrientDB combines graph database capabilities with document storage. Suitable for citation networks or knowledge graphs, not for OJS operational data.
3.10 MarkLogicโ
| Property | Value |
|---|---|
| Type | Multi-model โ Enterprise document/search |
| Licence | Commercial |
| OJS support | โ Not supported |
| Notable feature | Built-in semantic search, ACID transactions at scale, XQuery/JavaScript APIs |
MarkLogic is used by large publishers (Elsevier, Springer Nature) for managing massive document corpora. Its XML-native storage and semantic capabilities make it suitable for full-text archives of scholarly literature โ but as a document management layer, not as an OJS backend.
3.11 Microsoft SQL Serverโ
| Property | Value |
|---|---|
| Type | RDBMS โ Enterprise |
| Licence | Commercial (Microsoft) |
| OJS support | โ Not officially supported |
| Available on | Windows and Linux |
Microsoft SQL Server is a mature enterprise RDBMS. OJS does not have an MSSQL driver. Running OJS on SQL Server would require significant porting effort. Not recommended; use MySQL/MariaDB or PostgreSQL.
3.12 Oracle Databaseโ
| Property | Value |
|---|---|
| Type | RDBMS โ Enterprise |
| Licence | Commercial (Oracle) |
| OJS support | โ Not supported |
Oracle Database is widely used in large enterprises and universities. OJS does not include an Oracle driver. Not applicable to standard OJS deployments.
4. Database Comparison Summaryโ
| Database | Type | OJS Support | Best For OJS Context |
|---|---|---|---|
| MySQL 8.x | RDBMS | โ Official | Most deployments; excellent community support |
| PostgreSQL | RDBMS | โ Official | Large scale, advanced queries, statistics |
| MariaDB | RDBMS (MySQL-compat) | โ Community | Ubuntu/Debian VPS; drop-in MySQL replacement |
| Percona Server | RDBMS (MySQL-compat) | โ Community | High-volume multi-journal; enterprise monitoring |
| TiDB | Distributed RDBMS (MySQL-compat) | โ ๏ธ Experimental | Very large repositories only |
| CockroachDB | Distributed RDBMS (PG-compat) | โ ๏ธ Experimental | Geo-distributed, high availability |
| SQLite | RDBMS (embedded) | โ No | Dev/testing only |
| MongoDB | NoSQL document | โ No | Companion analytics services |
| Redis | NoSQL in-memory | โ As cache only | PHP session store, object cache layer |
| Cassandra | NoSQL wide-column | โ No | External analytics at scale |
| Couchbase | NoSQL document | โ No | Mobile sync apps |
| ArangoDB | Multi-model (graph) | โ No | Citation graph analysis tools |
| RethinkDB | NoSQL real-time | โ No | Real-time dashboards |
| Cloudant | NoSQL (CouchDB) | โ No | Managed document store |
| OrientDB | Multi-model (graph) | โ No | Graph-based citation tools |
| MarkLogic | Multi-model enterprise | โ No | Large publisher document archives |
| SQL Server | RDBMS enterprise | โ No | Not applicable |
| Oracle DB | RDBMS enterprise | โ No | Not applicable |
5. Choosing the Right Database for OJSโ
| Your Situation | Recommended Database |
|---|---|
| New OJS installation on Ubuntu/Debian VPS | MariaDB (default apt package, drop-in MySQL) |
| New OJS installation on AlmaLinux/Rocky/cPanel | MySQL 8.x (standard for RHEL-based systems) |
| Large multi-journal platform (10+ journals) | PostgreSQL or Percona Server |
| Need advanced statistics and reporting | PostgreSQL (superior query planner and COUNTER stats) |
| High-availability, zero-downtime upgrades | Percona XtraDB Cluster or MariaDB Galera Cluster |
| Cloud-native containerised deployment | MySQL 8.x or PostgreSQL in managed cloud DB services |
| Quick local development/testing | MariaDB in Docker Compose (official pkp/docker-ojs image) |
6. Backup Essentialsโ
For whichever database you choose, establish automated daily backups. See the OJS Server Infrastructure article for complete backup scripts covering both MySQL/MariaDB and PostgreSQL.
Quick reference:
# MySQL / MariaDB / Percona backup
mysqldump --single-transaction --routines --events \
--defaults-file=/etc/mysql/backup.cnf ojs_production \
| gzip > /backup/ojs_$(date +%Y%m%d).sql.gz
# PostgreSQL backup
PGPASSFILE=/etc/postgresql/.pgpass \
pg_dump -U ojsuser -F c ojs_production \
> /backup/ojs_$(date +%Y%m%d).pgdump
Referencesโ
-
PKP Admin Guide โ System Requirements
https://docs.pkp.sfu.ca/admin-guide/en/ -
MariaDB Documentation
https://mariadb.com/kb/en/ -
PostgreSQL Documentation
https://www.postgresql.org/docs/ -
MySQL 8 Documentation
https://dev.mysql.com/doc/refman/8.0/en/ -
Percona Server Documentation
https://docs.percona.com/percona-server/latest/ -
TiDB Documentation
https://docs.pingcap.com/tidb/stable -
CockroachDB Documentation
https://www.cockroachlabs.com/docs/ -
Redis Documentation
https://redis.io/docs/ -
PKP docker-ojs (GitHub) โ Official Docker images with MySQL and PostgreSQL support.
https://github.com/pkp/docker-ojs -
PKP Community Forum โ Database discussions
https://forum.pkp.sfu.ca/