Backend
Building the services behind Avicus Network
Services that ran game servers across dedicated machines for Avicus, a Minecraft network with 579K unique players, plus its GraphQL API and client tools.
- 579Kunique players
- 8Munique logins
- 105Mplayer-to-player encounters
- 2xfaster deploys
The problem
Avicus was a Minecraft network running game servers across several dedicated machines. It needed services to start, stop and coordinate those servers, an API that the team and outside developers could build on, and deploys that didn’t eat half a day.
What I built
- Frontend and backend services that orchestrated game servers across multiple dedicated servers
- A custom GraphQL API on Ruby on Rails, used inside the team and by developers outside it
- Our fork of Shopify’s GraphQL Java code generator, which turns the API’s schema into a type-safe Java client. I moved mutations into their own package, added Javadoc from schema descriptions, and made it always select the
_idfield our data used - Additions to quest, a small ActiveRecord-style MySQL library:
LIKEand not-equal operators, alongtype, and fixes for iterators and empty result lists - Deploy automation that cut deploy time in half
- Along the way, I managed a rotating team of part-time developers
- Rails APIGraphQL schema
- Introspectionschema as JSON
- graphql_java_genERB templates
- Java clientquery builders + responses
- Pluginstyped API calls
Using the generated client
# generate
schema = GraphQLSchema.new(introspection_json)
GraphQLJavaGen.new(schema, package_name: "net.avicus.api", custom_scalars: ...).save(path)
// use it from a plugin
query = Schema.query(q -> q.user(id, u -> u.username().rank(r -> r.name())))
response = QueryResponse.fromJson(api.post(query.toString()))
if response.getErrors().isEmpty(): show(response.getData().getUser())
The scale
Over its life the network saw 579K unique players, 8M unique logins and 105M unique player-to-player encounters.