8  Database convergence

Relational databases are boring and boring is good, especially when money is concerned. DocumentDBs like MongoDB is popular for their straightforward start but the problems comes later when you need to keep your data consistent.

Also, old boring technologies will have a lot of utilities for different needs. For example, schema comparison is widely supported in old boring databases but please look at for same use case in document databases.

8.1 relational database is a very good first choice for a lot of use cases

You should always start with relational database when starting your application. Premature optimization is root of all evil. Then, if needed add other technologies to your application.

For a lot of use cases, relational databases are very good first choice. You could use facade design pattern when you are implementing your API. Then when needed, you could switch underlying implementation to different technologies. This could be done with a lot of use case like below:

  • Events
  • Logs
  • Documents
    • Search in documents
  • Key/Value cache like redis
  • Full text search

This way, instead of starting with a lot of technologies like kafka, redis, elastic search; you could start with relational database and later add this technologies if/when needed.

8.2 Databases add new technologies to their stacks

  1. Objects
  2. XML Data
  3. JSON Data
  4. Graphs
  5. Vectors

8.3 Object Database

Oracle supports Oracle Object-Relational paradigm. Object databases was popular for a time and oracle incorporated these features. I have never seen these object features used in the production oracle databases.

SQL Server and Sqlite does not support Object-Relational paradigm. Among open source database systems, postgres support it

8.4 XML Data

  • Oracle has native xml storage and query capabilities, see Oracle XML DB.
  • SQL server also has native xml storage and query capabilities, see Sql Server XML Data

8.5 JSON data

After the success of the so-called nosql movement in database world, all of the vendors started to support JSON data. Oracle even supports mongodb (a leading json document database) connections natively and (support SQL with mongodb applications)[https://blogs.oracle.com/database/post/proper-sql-comes-to-mongodb-applications-with-oracle].

JSON is supported in all of the three databases, we will cover in our course.

8.6 Graph Data

8.7 AI/Vector data

Oracle database supports AI vector capabilities in its new version. New Oracle 23 version is even named as 23ai to emphasize this capabilities. - See oracle vector database. - See how oracle 23 ai support generative AI applications

8.8 Redis

Rails offer a plugin for redis replacement in the database.

https://github.com/rails/solid_cable

See below video for an example of an application migration to sqlite (a relation database) from redis, key-value database.

Wafris, a web application firewall, achieved 3x performance improvements with this migration. See following blog post: Rearchitecting: Redis to SQLite and video: Moving from Redis to SQLite with Mike Buckbee. Please note that they have a very specific use case where reading from database was way more important than writing to database.

8.9 Kafka

It is append only log. You can use database tables for this purpose. Of course, it does not scale like kafka to terabytes of data but ask yourself if your application needs that much scale.

Also, for the enterprises, with their powerful database servers like exadata from oracle, it is possible to scale for that much data.

8.11 Integrated programming languages

Using stored procedures and functions, databases offer powerful features to work with data and code together in database. These procedures and functions could be written with their procedural extensions (T-SQL, PL/SQL) or other general purpose programming languages like C#,Java and R.

I am not very fond of most of these features but they are widely used by some software companies.

See Chapter 47 (stored procedures) for more about them.

8.12 Other perspectives for same idea:

Best one. databases will own others, json, vector, text ….

Below are links for Postgres but the idea is still the same.