Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

Learner Service provides APIs related to resources such as Organisations, Users (i.e. learner), Course Batches, Locations, Badges, Pages etc.

...

ApproachProsCons
Cassandra Trigger
  • Immediately triggered
  • Maintains order (not tested in multi-node scenario)
  • Deprecated (refer Datastax documentation)
  • Semi-private and subject to change
  • Performance overhead
Use audit logging of Apache Cassandra 4.0
  • Out of the box product feature which is expected to meet performance and reliability design goals
  • Not yet released
Change Data Capture
  • No performance overhead during write
  • Data not immediately available (requires memtables flush or commit log limit)
  • Every node has a separate commit log (binary format)
  • Consumer needs to handle duplicate events in a multi-node setup
ecAudit (Ericsson Cassandra Audit)
  • Immediately logged (on the node where the query is executed)
  • Read is straightforward as log is in text format
  • Correlation required in case of FAILED events
  • Every node has a separate audit log
  • Performance overhead

...

Code Block
{
    "user": {
        "indexType": "user",
        "key": "id",
        "visibilityEnabled": true
    },
    "user_education": {
        "indexType": "user",
        "path": "education",
        "key": "userid",
        "visibilityEnabled": true
    },
    "user_job_profile": {
        "indexType": "user",
        "path": "jobProfile",
        "key": "userid",
        "visibilityEnabled": true
    },
    "user_org": {
        "indexType": "user",
        "path": "organisations",
        "key": "userid",
        "visibilityEnabled": true
    },
    "address": {
        "types": {
            "usr": {
                "indexType": "user",
                "path": "address",
                "key": "userid",
                "visibilityEnabled": true
            },
            "edu": {
                "indexType": "user",
                "path": "education.address",
                "key": "userid",
                "visibilityEnabled": true
            },
            "job": {
                "indexType": "user",
                "path": "jobProfile.address",
                "key": "userid",
                "visibilityEnabled": true
            },
            "org": {
                "indexType": "org",
                "path": "address",
                "key": "orgid" // TODO
            },
        }
    },
    "organisation": {
        "indexType": "org",
        "key": "id"

    },
    "course_batch": {
        "indexType": "cbatch",
        "key": "id"
    },
    "user_courses": {
        "indexType": "usercourses",
        "key": "id"
    },
    "location": {
        "indexType": "location",
        "key": "id"
    },
    "visibility": {
        "indexType": {
            "user": {
                "table": "user",
                "column": "profilevisibility",
                "indexType": "profilevisibility",
                "key": "id"
            }
        }
    }
}


Action Points

1) Test Cassandra Triggers and ecAudit with different data types (e.g. list, map, blob etc.)

Please refer Cassandra Audit Logging for Different Types

2) Can Cassandra Trigger be applied per column?

No (refer Apache Cassandra Trigger documentation)

3) Performance comparison of Cassandra Triggers and ecAudit (in progress)

4) Drop data in user_education, user_job_profile and address tables based on discussion with Rahul and Rayulu

5) Rename indexType in mapping to ____ ?

Appendix

Learner Service Data Models Comparison