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

Is the WCA API worth the complexity? #133

Closed
fw42 opened this issue Apr 16, 2015 · 2 comments · Fixed by #178
Closed

Is the WCA API worth the complexity? #133

fw42 opened this issue Apr 16, 2015 · 2 comments · Fixed by #178

Comments

@fw42
Copy link
Owner

fw42 commented Apr 16, 2015

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: #53, #52, #51, #49

Pro API

  • Clean separation of concerns.
  • The table design of the WCA DB is a total shitshow and organically grown out of a shitty PHP app (afaik). Doesn't follow any best practices for naming etc. It's kinda hacky to make it work with ActiveRecord (but possible).

Contra API

  • Feels like additional complexity
  • Two codebases written in two different languages
  • Deployment becomes more complicated (now I need to deploy both a Rails and a Rust app)
  • Operation becomes more complicated (API goes down)
  • We need to think about stuff like "what to do when the API server is down or is slow"
  • Doesn't feel very flexible. Adding things like batching or other queries seems tedious. Would be much easier (for me at least) in MySQL/ActiveRecord.

@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
Copy link
Owner Author

fw42 commented May 3, 2015

@timhabermaas any opinions here?

@timhabermaas
Copy link
Collaborator

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.

@fw42 fw42 mentioned this issue May 17, 2015
@fw42 fw42 closed this as completed in #178 May 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants