I’m creating what I hope will be a ‘simple’, but performant and scalable app. Reading the recommended article on data modelling for product catalog tells me that getting the ‘performant and scalable’ part right may not be so simple, but that these objectives can be achieved with an appropriate data model.
This is my current schema:
type User {
active: Boolean!
username: String!
description: String
email: String
mobile: String
playedAs: [Player!]! @relation
}
type Player {
active: Boolean!
rank: Int!
ranking: Ranking! @relation
challenger: User @relation
}
type Ranking {
active: Boolean!
rankingname: String!
rankingdesc: String
player: Player @relation
}
type Mutation {
createNewUser(active: Boolean!, username : String!, password : String!, description: String, email: String, mobile: String): loginResult! @resolver(name: "create_new_user")
loginUser(username: String!, password: String!): loginResult! @resolver(name: "login_user")
}
type Query {
allUserNames: [String!]! @resolver(name: "all_user_names")
allPlayerUIDs: [String!]! @resolver(name: "all_player_uids")
allPlayerRanks: [Int!]! @resolver(name: "all_player_ranks")
allPlayerChallengerUIDs: [String!]! @resolver(name: "all_player_challenger_uids")
allPlayers: [Player] @resolver(name: "all_players")
allRankings: [Ranking] @resolver(name: "all_rankings")
allUsers: [User] @resolver(name: "all_users")
gotPlayersByRankingId (rankingid: String!): [Player] @resolver(name: "got_players_byrankingid")
gotRankingIdsByPlayer (uid: String!): [String] @resolver(name: "got_rankings_byplayerid")
}
type loginResult @embedded
{
token : String
logginUser : User
}
I would like for there to be unlimited number of Users, Players and Rankings and for each ranking to potentially contain up to 600K players (although this would be very rare and most rankings would contain less than 20 players, especially initially).
I would like to be able to query a list of UserRankings or UserPlayers and to be able to create a new UserRanking from a single click in the app (that and ranking re-sorting on a result are probably the most complex operations in the app). I have read the Fauna docs re: Data Modelling.
I’m attempting to avoid analysis paralysis but at the same time do not wish to oversimplify data modelling now and regret having done so later on.
Do the Fauna docs alone cover everything I need to understand and implement these business requirements effectively or do I need to read over and get to grips with the more complex nuances like these from StackOverflow?
Any comments, recommendations, requests for/links to more information etc. gratefully received.
Thanks …