NREL / api-umbrella

Open source API management platform
http://apiumbrella.io
MIT License
2.02k stars 324 forks source link

Should we migrate the web-app component to Lua? #304

Open GUI opened 7 years ago

GUI commented 7 years ago

For background, API Umbrella's architecture can be separated into 3 main components:

Since we migrated the gatekeeper to Lua, it's sort of been in the back of my mind to consolidate the web-app APIs to be written in Lua too. This type of task is more in the realm of "cleanup" or "maybe nice to have," so I don't think this is particularly pressing (and perhaps doesn't even make sense at all), but I wanted to create a ticket to track this and list out some current pros/cons.

Pros:

Cons:

GUI commented 7 years ago

And I guess to summarize my current stance, given some of the current cons (notably, mail support and OmniAuth), I'm more inclined to keep things as-is with the web-app remaining a separate Rails app. While I think maybe someday it might be nice to consolidate the code-base so the server-side code isn't split between languages, I don't currently see it as particularly beneficial or worth the lift.

cmc333333 commented 7 years ago

I agree with your analysis, but will highlight one factor. The major cons you listed stem from Ruby/Rails being a well-understood, well-used framework. They create a big framework, though, with frequent security vulnerabilities and releases. One pro argument is around reducing our attack surface. I don't mean to imply OpenResty is more stable/secure/what-have-you (I'd argue newer technologies are inherently insecure), but OpenResty is essential to the current stack while Ruby/Rails is not.

In any event, I agree that there are much bigger fish to fry. However, if there comes a point where maintaining the Ruby/Rails component becomes particularly burdensome, an OpenResty rewrite seems in scope.

GUI commented 7 years ago

Thanks for the feedback, @cmc333333! Those are excellent points about the surface-area and what's essential in our stack.

In the very beginning, the whole admin was much more of a typical server-side Rails app (no APIs, all server-side rendering), so we were probably getting more benefit out of Rails then. But as we've transitioned to driving everything via APIs with the Ember.js admin interface, our reliance on Rails has obviously diminished (and thus, the benefit we get from Rails). I think we're in agreement that it's not worth tackling now, but I like your thought process of deciding when Rails maintenance becomes burdensome to figure out when a rewrite might be worth revisiting.

Related, it's probably worth noting that master is on an unsupported version of Rails (so to some degree, this has already bit us), but I have already tackled the upgrade to a supported version in a branch (see #259--the merge into master is pending some of the Ember and testing upgrades it's unfortunately gotten tied up with). I was contemplating some of these same issues before I upgraded Rails, but I guess right now, it still seemed like a Rails upgrade was easier than the alternatives. But that might change the next time we need to weigh a Rails upgrade.