Notify and LicensePublished by Mark Wylde on 2021-08-15

I've just finished implementing the notify logic. Logic has now been implemented to detect a temporary primary replica called isDocumentPrimaryReplica.

This can be used from an internal controller, when an action should be performed only once per internal method. For example:

  1. When you have PATCHed 1 document that has 3 replicas, it should only NOTIFY once.
  2. When you need to return the effected documents (not replicas).

The current logic is:

function isDocumentPrimaryReplica (context, document) {
  return document._replicatedNodes[0] === context.thisNode.name;
}

But ideally, this needs to also take into consideration if the actual primary replica is offline/unhealthy. I'll get to that later.

License change

The main project is deliberately licensed as AGPL-3, but I realised the client library was also licensed as AGPL-3 too.

That was not my intention. If you want to use the canhazdb client library, you do not have to release your entire app as AGPL-3. For example, if you run a canhazdb server cluster, and then build a separate app that talks to the server (either using the client library or your own), the project does not have to be licensed as AGPL-3.

Therefore, I have changed the canhazdb client license to be MIT.

Note, the license of the canhazdb server is still AGPL-3. The intention being, if you make any changes to the server or embed it into another product, the project should be licensed as AGPL-3 and source code released.

Next - Statistics

The last major feature for me to implement is the system.collections collection. I'll try to get that completed this week.

Once that's finished, I'm going to embed a very simple http server (without websocket notify support). Then finally, I can get the ha branch into master. Milestone reached!