r/Clojure • u/clojureftw • May 16 '16
Ask /r/Clojure: Secure web frameworks for building REST Api?
I'm evaluating Pedestal and I guess I like it's built-in security features although I'm not sure whether this is just a fluff piece of somebody has actually done a thorough auditing.
I'm working in fintech space and since I'm using datomic I'm pondering what my backend endpoint api stack is going to be. I like the appeal of keeping everything clojure to save the cognitive cost of switching between backend server / datomic, and all in all I've gone through the clojure essentials yesterday and was just blown away by it's concise and straight forwardness, no ambiguity, and see it as a powerful language for dealing with lot of data, and more importantly it feels like the first time I began learning programming, but I digress, I'm turning to the community to get some advice preferably from people who work in fintech.
So should I use Pedestal + Datomic?
I'm sort of wary about using "collection of libraries" that people seem to advocate, and this arises from my experience of using "microframeworks" like Flask in the Python world and ending up googling "how to get stuff I got for free in full MVC frameworks but in Flask + 3rd party libraries that seem sporadically updated by individuals". It left a very bad taste and I've made some pre-judgement here coming to clojure....
However, if I could attain a better security feature by employing the "collection of libraries from the shelf" to build backend API, I might consider it seeing how tight the community is and not flaky like Flask....but again if Pedestal or some full framework on clojure lets me achieve higher productivity and security features then I'd much much prefer the full framework approach.
Anyways I'm going through the more advanced topics on clojure and will come back time to time to check on people's replies.
Thanks y'all.
2
u/yogthos May 20 '16
I agree that trying new things is important, and I do think there's value in both Ring and Pedestal being available and exploring different approaches.
However, it's also worth recognizing that Clojure is already bleeding edge in many respects. So, simply by choosing Clojure you're already ahead of the pack so to speak.
Given that context, I do think being a bit conservative has value. Again, it largely comes down to the ecosystem and the documentation. Ring has a definite advantage in both regards.
While it's true that download numbers are a distorted metric, one would assume the same type of distortion applies to both Ring and Pedestal equally. I think if we were talking about a variation of a few thousand, then it would be meaningless. However, when the difference is in orders of magnitude that's really something to take note of.