Handling data consistency in a Document Database

You know what an invoice looks like.  We have all seen thousands of them - probably too many. But invoices illustrate an interesting problem - and I am not talking about your VAT  return. I am talking about the new kids on the database block - document databases.  An example is MongoDB. These can store all the data for one invoice in a single structured record (called a 'document').   

In a traditional Relational Database on the other hand, the data is held in flat tables, like big spreadsheets. Invoices will be stored in two tables, one for information about the invoice, like customer and date  (call it the 'invoice header'). The second table will store all the invoice lines. One row per line. The lines will be linked back to their invoice by an invoice number.  But what happens if the invoice header disappears but the invoice lines are still there?

Lost in MongoDB: Learning to Aggregate

I am getting to the end of stage one in writing a database driver for MongoDB to use in my Lockdown Project sudsjs.com. All has gone well until I get to totalling up a field in the database. I had to enter the wonderful world of aggregation, which is confusing, powerful and function-rich. 

Why why API?

I was looking at a page on the IBM website last week when something odd happened. Half the page loaded, then there was a spinning circle (a.k.a. a throbber) for a second or so, then the rest of the page loaded. The page itself is a few paragraphs of very boring text plus a menu. So why the drama with the throbber for a page like that?

Why Mongo DB is revolutionary (and is this a good thing?)

NOSQL databases like MongoDB are making a big splash in the computer industry. But are they set to replace the tried and test technology of the last fifty years? 

Here is my take on it, with a bit of history thrown in.

My Lockdown Project

SUDSJS is the result of a project to keep my brain active during the lockdown. It has grown to a serious database support system allowing users to create, update, delete and search information. I tested it with MySQL, SQLite, PostgreSQL and I am working on MongoDB.

Why did I do this?