SQL or NoSQL?

Alexandria is primarily deployed as a web application, where users log in and interact with the information they have stored on the platform. Therefore, robust and scalable database choice is a must.

Our research comparing between SQL and NoSQL databases centred around the following issues.

Parameter SQL NoSQL
Ability to handle high volume of complex queries
Scalability Vertical Horizontal
Data type Structured Unstructured

SQL

Structured Query Language (SQL) is the standard language for dealing with relational databases that define relationships in the form of tables. SQL databases works with a predefined schema, and can be used to effectively insert, search, update, and delete database records. SQL databases are table-based, and known for its vertical scalability.

NoSQL

NoSQL represents non-relational database management systems, where fixed schema is not required. It also avoids joins, and is easy to scale. NoSQL databases can be document based, key-value pairs, or graph databases. It uses dynamic schema for unstructured data, and is known for its ability to scale horizontally.

Choosing SQL

Our choice of SQL is based primarily on its ability to handle a high volume of complex queries. Each user interacting with Alexandria may upload text, select words from the text to add translations to, change status of a word, or even switch language, all within the same session. Each action requires sometimes complex queries to complete. In particular the capability of joining tables is essential for a couple of key features.

While SQL became Alexandria’s database of choice, we are acutely aware of the shortcomings of a SQL database, namely its vertical, versus horizontal scalability. Vertical scalability means that while we can increase the load on a single server by increasing RAM, CPU, or SSD, NoSQL databases handle more traffic by sharding and adding more servers, allowing it to become larger and preferable in the cases for large and ever-changing data sets.