fw42 / cubecomp

WCA Rubik's Cube competition website hosting
https://cubecomp.de/
MIT License
10 stars 4 forks source link

Is the WCA API worth the complexity? #133

Closed fw42 closed 9 years ago

fw42 commented 9 years ago

I'm starting to have some doubts about the external WCA API.

In the old version of cubecomp, I just had the app connect to a separate MySQL database that holds the WCA data import. That seemed a lot simpler.

I want to use this issue to collect some pros and cons about using a HTTP API vs. using the raw MySQL db.

Related issues: https://github.com/fw42/cubecomp/issues/53, https://github.com/fw42/cubecomp/issues/52, https://github.com/fw42/cubecomp/issues/51, https://github.com/fw42/cubecomp/issues/49

Pro API

@timhabermaas thoughts/comments? Feel free to add things.

Not trying to kill this idea, I just want to reevaluate it (and find the best way to implement the remaining missing WCA API related features).

fw42 commented 9 years ago

@timhabermaas any opinions here?

timhabermaas commented 9 years ago

The pro/contra list seems to be spot-on. I don't think it's necessarily "more complex", though. Conceptually I feel a separate API is simpler since it's self-contained and there's no state to manage. [1] The network failures add a bit of complexity, though.

That being said: I can't compile the API right now. Rust is currently in beta and they've disabled a few features I rely on during the beta stage. I simply don't have the time to sit down and rewrite the code to not use these features.

So, I think the best course of action would be to use the MySQL import and setup a separate database (just like you did with the old app). Trying to comply with the current WCAGateway interface (or generally using some kind of gateway) would probably a good idea since a) there might be an official WCA API in the future and b) we might change our minds.

It's kinda hacky to make it work with ActiveRecord (but possible).

I'd probably just use raw SQL instead of dealing with associations/overriding table names.

[1] My implementation isn't there, yet. It's definitely missing a simple way to deploy and update the current data.