📙
Sunbird Lern
AskDot
  • LEARN
    • Overview
    • Functional Capabilities
    • Technical Architecture
      • Technical Architecture Diagram
      • Tech Stack
    • Dependencies
    • Product Roadmap
  • USE
    • Overview
    • Release Notes
      • Release V 8.0.0 (Ongoing)
      • Release V 7.0.0
      • Release V 5.4.0
      • Release V 5.3.0
      • Release V 5.2.0
      • Release V 5.1.0
      • Release V 5.0.1
      • Release V 5.0.0
      • Release V 4.10.0
      • Release V 4.9.0
      • Release V 4.8.0
      • Release V 4.7.0
    • Developer Guide
      • USER & ORG SERVICE
        • Features/Core capabilities
        • Architecture
          • Code Flow
        • Developer Installation
          • System Requirements
          • Tech Stack
          • Installation Guide
          • Keycloak Local setup
          • Additional Installation Dependencies:
          • Source Code
          • Installation Configuration
        • Data Models
          • Cassandra
            • Data Dictionary
              • User
              • Organisation
              • System Settings
              • Role
              • Bulk Upload Process
              • Tenant Preference
              • Cassandra Migration Version
              • User Consent
              • Email Template
              • OTP
              • Page Management (LMS Service)
              • Location
              • User Notes
              • Deprecated
          • Elastic Search
          • Redis
        • APIs
          • User Management
            • User Deletion API
            • Ownership Transfer API
          • Organisation Management
          • Location Management
          • Consent Management
          • OTP Services
          • Tenant Configurations
          • Bulk Upload
          • System Settings
          • API Management Service
          • Data Sync
          • Notification APIs
        • Flink Jobs
          • User Cache Updater
          • User Deletion Cleanup Flink Job
          • Ownership Transfer Flink Job
        • Reports
          • Standard Exhaust
            • State Admin Geo report
            • State Admin Report
          • Other Jobs
            • User Cache Indexer Job
            • Delete Users Assets Report
          • Data Products Developer Installation
            • System Requirements
            • Tech Stack
            • Installation Dependencies
            • Local installation of data-products
            • Server setup Guide
            • Installation Configuration
            • Data-product creation guide
            • Troubleshooting a data-product
        • Logs, Telemetry Events
        • Configuration
          • Functional Configurations
          • System Settings
          • Email Configuration
          • SMS Configuration
          • OTP based SMS Configuration
        • Roles
          • System Roles
          • User Roles
          • RBAC
        • Dependencies
        • Keycloak on Sunbird
        • How to Guide
          • Create Organization
          • Create User
          • Add new user type & location
        • Single Sign-on with Sunbird
        • Caching and Denormalising User Metadata
          • ETLUserCacheUpdaterJob
          • UserCacheUpdaterFlinkJob
        • Unit Tests and Code Coverage
        • FAQs
      • LMS(BATCH) SERVICE
        • Features/Core Capabilities
        • Architecture
          • Code Flow
        • Developer Installation
          • System Requirements
          • Tech Stack
          • Installation Guide
          • Source Code
        • Data Models
          • Cassandra
            • Data Dictionary
          • ElasticSearch
          • Redis
        • APIs
        • Flink Jobs
          • Merge User Courses
          • Relation Cache Updater
          • Activity Aggregate Updater
          • Assessment Aggregator
          • Enrolment Reconciliation
          • Collection Certificate Pre-Processor
          • Collection Certificate Generator
        • Reports
          • On-Demand Exhaust
            • Response Exhaust
            • User Info Exhaust
            • Progress Exhaust
          • Other Jobs
            • Collection Summary Job
            • Course Batch Status Updater Job
            • Cassandra Migrator Job
            • Score Metric Migration Job
            • Assessment Score Correction Job
            • Collection Reconciliation Job
            • Course Enrollment Job
            • Course Consumption Job
        • Logs, Telemetry Events
        • Configuration
          • System Configuration
          • Functional Configuration
        • Dependencies
        • Certificate Registry and Credentialing using Sunbird-RC
          • Configuring PublicKey in Sunbird-RC
          • Server Setup guide for Sunbird-RC
          • API Guide For Sunbird-RC
        • Certificate Flow
          • Certificates Creation and Configuration
        • FAQs
      • GROUPS
        • Features/Core Capabilities
        • Architecture
          • Code Flow
        • Developer Installation
          • System Requirements
          • Tech Stack
          • Installation Guide
          • Source Code
          • Installation Configuration
        • Data Models
          • Cassandra
            • Data Dictionary
          • Redis
        • APIs
          • Create Group
        • Logs, Telemetry Events
          • UI Telemetry Events
          • Service Telemetry Events
        • Configuration
          • Functional Configurations
        • Design References
        • Dependencies
        • Unit Tests and Code Coverage
      • NOTIFICATION SERVICE
        • Features/Core Capabilities
        • Architecture
          • Code Flow
        • Developer Installation
          • System Requirements
          • Tech Stack
          • Installation Guide
          • Source Code
          • Installation Configuration
        • Data Models
          • Data Dictionary
        • APIs
        • Flink Jobs
        • Logs, Telemetry Events
        • Configuration
          • Functional Configurations
        • Dependencies
        • Unit Tests and Code Coverage
      • DISCUSSION FORUM
        • Features/Core capabilities
        • Architecture
          • Code Flow
        • Developer Installation
          • System Requirements
          • Tech Stack
          • Installation Guide
            • Nodebb setup
            • Discussion Middleware Setup
            • Discussion Middleware
            • Discussion forum integration with any application
            • Discussion-UI setup along with demo application.
            • Sunbird-lern portal for DF
          • Source Code
        • APIs
          • Category APIs
          • User APIs
          • Post APIs
          • Topic APIs
          • Forum APIs
        • Context Schema
        • Configurations
          • Nodebb Admin panel settings
          • Discussion MW & Nodebb System Config
        • Telemetry Events
        • Dependencies
      • ML SERVICE
        • DATA PIPELINE (Flink Jobs)
          • Program User Info
            • Component Diagram
            • Data Model
            • Folder Structure
          • Ml User Delete
            • Component Diagram
            • Data Model
            • Folder Structure
        • DATA PRODUCTS
          • Program Exhaust
            • Component Diagram
            • Folder Structure
    • Server Installation
    • Dependency setup
    • Deprecation
      • Release-5.4.0
    • Jenkins Jobs
    • Release Calendar
    • Learn More
      • Tech References
      • Telemetry Processing
      • Data Dictionary
        • Sample Data
      • Delete User Functionality
      • Asset Ownership Transfer
    • FAQs
  • Engage
    • Discuss
    • Contribute to Sunbird Lern
    • Raise an Issue
    • Contribution Guidelines
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. USE
  2. Developer Guide
  3. USER & ORG SERVICE

Caching and Denormalising User Metadata

PreviousSingle Sign-on with SunbirdNextETLUserCacheUpdaterJob

Last updated 1 year ago

Was this helpful?

Various data products in sunbird depends on the user metadata which are generated on joining different tables from core cassandra and LP cassandra. The logic for joining the table and fetching the information per user type is complex.

Solution :

Fetch the information from cassandra table, compute all the required fields in the flink job (user-cache-updater job) and update all the fields to the redis cache.

Design for the fields to be fetched:

Field Name
Type
Table Name
Description

1

User-ID

String

User

It indicates user unique Identifier

2

Mobile Number

String

User

User phone number in an encrypted format

3

Email ID

String

User

User mail id in an encrypted format

4

ID

String

User

User unique identifier

5

First Name

String

User

User first name

6

Last Name

String

User

User Last Name

7

Phone Verified

String

User

It indicates whether user is verified the phone number or not

8

Email Verified

String

User

It indicates whether user is verified the email or not

9

Flags Value

Int

User

10

Framework

Map[String, List[String]]

User

User framework

11

Rootorgid

String

User

User root org id (can be used to differentiate between custodian and state user)

12

CreatedBy

String

User

User created By

13

Subject

List[String]

User

User subjects

14

Language

List[String]

User

User Language

15

Grade

List[String]

User

User grades

16

Roles

List[String]

User

User roles

17

Status

Int

User

User status

18

Webpages

List[Map[String, String]]

User

19

Createddate

String

User

User created date

20

Emailverified

Boolean

User

User email is verified or not

21

Isdeleted

Boolean

User

User is deleted or not

22

Locationids

List[Strings]

User

  1. If the user is Self Signed Up (custodian) user: USER.locationids

  2. If the user is tenant user: ORGANISATION.locationids

23

Updateddate

String

User

User last updated date

24

Profilevisibility

String

User

User profile visibility

25

Loginid

String

User

User login id

26

Username

String

User

It’s a combination of user first name and last name columns

27

External-ID

String

User_external_identity

  1. If the user is a self signed up user in the custodian org then the user’s self declared ID will be the value to the field.

    1. Filter the User_external_identity.idtype='declared-ext-id'

    2. Join with ORG table with condition User_external_identity.provider=ORG.channel and fetch User_external_identity.userid , User_external_identity.externalID

  2. If the user is a state user then the tenant provided External ID will be the value to the field.

    1. Join USER and User_external_identity table with User_external_identity.idType =User.channel and User_external_identity.provider=User.channel and fetch User_external_identity.userid , User_external_identity.externalID

28

School Name

String

Custodian User: User_external_identity State User: Organisation

  1. If the user is Self Signed Up (custodian) user then user’s self declared sub org Information code will be the value to the field.

    1. User_external_identity.idtype='declared-school-name' anf fetch User_external_identity.externalid,userid

  2. If the user is state user then tenant provided sub org Information will be the values.

29

School UDISE Code

String

Custodian User: User_external_identity State User: Organisation

  1. If the user is Self Signed Up (custodian) user then user’s self declared sub org Information code will be the value to the field.

    1. User_external_identity.idtype='declared-school-udise-code' and fetch User_external_identity.externalid,userid

  2. If the user is tenant user then tenant provided sub org Information will be the values.

30

State Name

String

Location

  1. If the user is Self Signed Up (custodian) user then user’s self declared location will be the value to the field

  2. If the user is tenant user then tenant location will be selected

31

District Name

String

Location

  1. If the user is Self Signed Up (custodian) user then user’s self declared location will be the value to the field

  2. If the user is tenant user then then tenant location will be selected

32

Block Name

String

Location

  1. If the user is Self Signed Up (custodian) user then user’s self declared location will be the value to the field

  2. If the user is tenant user then tenant location will be the value to the field

Join on User.userId = User_org.userId and then on get User_org.orgId and then join with where isRootOrg = false and fetch the Organisation.orgcode and ORG.orgname as school_name

Join on User.userId = User_org.userId and then on get User_org.orgId and then join with where isRootOrg = false and fetch the ORGANISATION.orgcode and ORG.orgname as school_name

and LOCATION.type='state/' and fetch the name as LOCATION.{state_name},USER.userid

Join ORGANISATION and location table having condition: && Location.type='state and fetch the ,

Join the Dataframe given in (i) and user table with condition: = USER.rootorgid && ORG.isrootorg=true and get the USER.userid,

and LOCATION.type='district' and fetch the name as LOCATION.{district_name},USER.userid

Join ORGANISATION and location table having condition: && Location.type='district and fetch the ,

Join the Dataframe given in (i) and user table with condition: = USER.rootorgid && ORG.isrootorg=true and get the USER.userid,

and LOCATION.type='block' and fetch the name as LOCATION.{block_name},USER.userid

Join ORGANISATION and location table having condition: && Location.type='block' and fetch the ,

Join the Dataframe given in (i) and user table with condition: = USER.rootorgid && ORG.isrootorg=true and get the USER.userid,

Organisation.id
ORGANISATION.id
USER.locationids=LOCATION.id
ORG.locationids=Location.id
Location.name
ORG.id
ORG.id
Location.name
USER.locationids=LOCATION.id
ORG.locationids=Location.id
Location.name
ORG.id
ORG.id
Location.name
USER.locationids=LOCATION.id
ORG.locationids=Location.id
Location.name
ORG.id
ORG.id
Location.name