Skip to main content

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โ€‹

PropertyValue
TypeRDBMS
LicenceGPL (Community) / Commercial (Enterprise)
OJS drivermysqli
Character setutf8mb4 (required for emoji / full Unicode)
PKP defaultYes โ€” 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)

Source: PKP Admin Guide โ€“ System Requirements


1.2 PostgreSQLโ€‹

PropertyValue
TypeRDBMS โ€” Advanced Features
LicencePostgreSQL Licence (permissive open source)
OJS driverpostgres9
PKP supportFully supported; some PKP developers prefer it
StrengthsACID 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

Source: PKP Community Forum โ€“ PostgreSQL discussions


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โ€‹

PropertyValue
TypeRDBMS โ€” MySQL compatible
LicenceGPL
OJS supportWorks with mysqli driver; widely used in the community
Default inUbuntu (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 (uses mysql_native_password by 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)
  • CONNECT storage 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โ€‹

PropertyValue
TypeRDBMS โ€” MySQL-compatible, enhanced
LicenceGPL
OJS drivermysqli (compatible)
StrengthsXtraDB 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โ€‹

PropertyValue
TypeDistributed RDBMS โ€” MySQL compatible
LicenceApache 2.0
OJS drivermysqli (TiDB is MySQL protocol compatible)
ArchitectureDistributed SQL โ€” scales horizontally across nodes
Use caseVery 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, FULLTEXT indexes)
  • 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โ€‹

PropertyValue
TypeDistributed RDBMS โ€” PostgreSQL compatible
LicenceBSL (core) / Enterprise
OJS driverpostgres9 (CockroachDB speaks PostgreSQL wire protocol)
ArchitectureDistributed; 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 postgres9 driver 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โ€‹

PropertyValue
TypeRDBMS โ€” Lightweight, embedded
LicencePublic Domain
OJS supportโŒ Not supported for OJS
Use casesOJS 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โ€‹

PropertyValue
TypeNoSQL โ€” Document storage
LicenceSSPL (Server Side Public Licence)
OJS supportโŒ Not supported
StrengthsSchema 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โ€‹

PropertyValue
TypeNoSQL โ€” In-memory key-value store
LicenceRSALv2 / 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:

  1. PHP Session Storage: OJS can use Redis to store PHP sessions, enabling sticky-session-free horizontal scaling across multiple app servers.
  2. 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"

Source: PKP Forum โ€“ Redis session caching


3.4 Apache Cassandraโ€‹

PropertyValue
TypeNoSQL โ€” Wide-column distributed store
LicenceApache 2.0
OJS supportโŒ Not supported
StrengthsLinear 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โ€‹

PropertyValue
TypeNoSQL โ€” Document storage + Key-value
LicenceBSL / Enterprise
OJS supportโŒ Not supported
Notable featureMobile 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โ€‹

PropertyValue
TypeMulti-model โ€” Graph, document, key-value
LicenceBSL (core)
OJS supportโŒ Not supported
StrengthsSingle 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โ€‹

PropertyValue
TypeNoSQL โ€” Document storage, real-time push
LicenceApache 2.0
OJS supportโŒ Not supported
Notable featureReal-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)โ€‹

PropertyValue
TypeNoSQL โ€” Distributed document store (CouchDB-based)
LicenceCommercial (IBM Cloud service)
OJS supportโŒ Not supported
Notable featureManaged 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โ€‹

PropertyValue
TypeMulti-model โ€” Graph and document
LicenceApache 2.0 (Community) / Commercial
OJS supportโŒ Not supported
Notable featureSupports 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โ€‹

PropertyValue
TypeMulti-model โ€” Enterprise document/search
LicenceCommercial
OJS supportโŒ Not supported
Notable featureBuilt-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โ€‹

PropertyValue
TypeRDBMS โ€” Enterprise
LicenceCommercial (Microsoft)
OJS supportโŒ Not officially supported
Available onWindows 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โ€‹

PropertyValue
TypeRDBMS โ€” Enterprise
LicenceCommercial (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โ€‹

DatabaseTypeOJS SupportBest For OJS Context
MySQL 8.xRDBMSโœ… OfficialMost deployments; excellent community support
PostgreSQLRDBMSโœ… OfficialLarge scale, advanced queries, statistics
MariaDBRDBMS (MySQL-compat)โœ… CommunityUbuntu/Debian VPS; drop-in MySQL replacement
Percona ServerRDBMS (MySQL-compat)โœ… CommunityHigh-volume multi-journal; enterprise monitoring
TiDBDistributed RDBMS (MySQL-compat)โš ๏ธ ExperimentalVery large repositories only
CockroachDBDistributed RDBMS (PG-compat)โš ๏ธ ExperimentalGeo-distributed, high availability
SQLiteRDBMS (embedded)โŒ NoDev/testing only
MongoDBNoSQL documentโŒ NoCompanion analytics services
RedisNoSQL in-memoryโœ… As cache onlyPHP session store, object cache layer
CassandraNoSQL wide-columnโŒ NoExternal analytics at scale
CouchbaseNoSQL documentโŒ NoMobile sync apps
ArangoDBMulti-model (graph)โŒ NoCitation graph analysis tools
RethinkDBNoSQL real-timeโŒ NoReal-time dashboards
CloudantNoSQL (CouchDB)โŒ NoManaged document store
OrientDBMulti-model (graph)โŒ NoGraph-based citation tools
MarkLogicMulti-model enterpriseโŒ NoLarge publisher document archives
SQL ServerRDBMS enterpriseโŒ NoNot applicable
Oracle DBRDBMS enterpriseโŒ NoNot applicable

5. Choosing the Right Database for OJSโ€‹

Your SituationRecommended Database
New OJS installation on Ubuntu/Debian VPSMariaDB (default apt package, drop-in MySQL)
New OJS installation on AlmaLinux/Rocky/cPanelMySQL 8.x (standard for RHEL-based systems)
Large multi-journal platform (10+ journals)PostgreSQL or Percona Server
Need advanced statistics and reportingPostgreSQL (superior query planner and COUNTER stats)
High-availability, zero-downtime upgradesPercona XtraDB Cluster or MariaDB Galera Cluster
Cloud-native containerised deploymentMySQL 8.x or PostgreSQL in managed cloud DB services
Quick local development/testingMariaDB 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โ€‹

  1. PKP Admin Guide โ€“ System Requirements
    https://docs.pkp.sfu.ca/admin-guide/en/

  2. MariaDB Documentation
    https://mariadb.com/kb/en/

  3. PostgreSQL Documentation
    https://www.postgresql.org/docs/

  4. MySQL 8 Documentation
    https://dev.mysql.com/doc/refman/8.0/en/

  5. Percona Server Documentation
    https://docs.percona.com/percona-server/latest/

  6. TiDB Documentation
    https://docs.pingcap.com/tidb/stable

  7. CockroachDB Documentation
    https://www.cockroachlabs.com/docs/

  8. Redis Documentation
    https://redis.io/docs/

  9. PKP docker-ojs (GitHub) โ€” Official Docker images with MySQL and PostgreSQL support.
    https://github.com/pkp/docker-ojs

  10. PKP Community Forum โ€“ Database discussions
    https://forum.pkp.sfu.ca/