Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tigase Server and Multiple Databases #24

Open
dnuob opened this issue Mar 14, 2020 · 1 comment
Open

Tigase Server and Multiple Databases #24

dnuob opened this issue Mar 14, 2020 · 1 comment

Comments

@dnuob
Copy link

dnuob commented Mar 14, 2020

Hi, below is sample from tigase administration guide,

dataSource {
    default () {
        uri = 'jdbc:mysql://db2.tigase/dbname?user&password'
    }
    'default-auth' () {
        uri = 'jdbc:mysql://db1.tigase/dbname?user&password'
    }
  }
userRepository {
    default () {}
}
authRepository {
    default () {
        cls = 'tigase.db.jdbc.TigaseCustomAuth'
        'data-source' = 'default-auth'
    }
}

what is the difference between default datasource and default-auth datasource? do they have the same tables, functions and procedures? or another saying, are they clonable structure to each other?

@woj-tek
Copy link
Contributor

woj-tek commented Mar 17, 2020

what is the difference between default datasource and default-auth datasource?

In above example - they use completely different databases (db1.tigase vs db2.tigase)

do they have the same tables, functions and procedures? or another saying, are they clonable structure to each other?

They are mapped to AuthRepository and UserRepository and respective functionality defined in them.
Now, depending on repository used, data structures may be different. In case of MySQL all structures would be effectively the same (tig_users, tig_nodes and tig_pairs being the basis).
However, if you consider 'cloning' then you should just use single data-source for both UserRepository and AuthRepository:

dataSource {
    default () {
        uri = 'jdbc:mysql://db2.tigase/dbname?user&password'
    }
}
userRepository {
    default () {}
}
authRepository {
    default () {}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants