Few Questions #150
Replies: 9 comments
-
Hello! Thanks for your interest.
I use repetoir for dependency injection. It's about mechanical simplicity; no annotation processing, no runtime reflection, and a single place in the code where services are instantiated (so it's extremely easy to see, from an auditing perspective, which implementations are being used). I'm less concerned about performance; the JVM is already stupidly fast. The
The code consuming services doesn't care if they're singletons or not. From the perspective of code consuming services, it just asks for an instance of a particular interface and gets it.
I'm strongly opposed to Project Lombok; it has a tendency to make codebases completely incomprehensible, and it's very difficult to migrate any code away from it once it's in a codebase. The |
Beta Was this translation helpful? Give feedback.
-
Thanks for the great answer. I'll try to run it locally. How many requests in 500 ms locally? Since when is it getting used in production? Does it offer Attribute based access control.. fine grained permission stuff? |
Beta Was this translation helpful? Give feedback.
-
I don't know how many requests it can sustain in 500ms, I've not benchmarked beyond the initial performance tests I did to ensure that I wasn't doing anything horribly sub-optimal with the database. It uses Helidon Nima for the embedded HTTP server, and PostgreSQL for the database, so performance is essentially defined by those two components.
I've been running it in my own projects for about two years.
The admin interface uses a capability-based permissions model: https://www.io7m.com/software/idstore/documentation/index.xhtml#id_634db1a2-1705-44ae-abac-8fa281b100f4 The user interface doesn't have permissions because there aren't actually any operations for users to perform; all the server does for users is determine if they're permitted to log in or not. 🙂 |
Beta Was this translation helpful? Give feedback.
-
As may or may not be obvious, the server doesn't do all that much that's interesting by itself. It exists because I write a lot of server software, and I didn't want to repeatedly implement password/credential handling in all of the other servers. There were no other pure identity servers I could find that would match the very stringent requirements I have with regard to security, code quality, operational simplicity, protocol simplicity, etc, hence |
Beta Was this translation helpful? Give feedback.
-
Hi Thank you for the detail response. I agree that the Here is an IAM written in Java, but the code is complex and it is using Spring which I do not like, its code is over-abstracted.. offers much more than it is needed. Also, performance-wise it is unpleasant. If you are interested in knowing about the At the top two are: Vertx and Jooby. Vertx is |
Beta Was this translation helpful? Give feedback.
-
Yes, I find Spring is generally a red flag. I've never really understood what problem it's trying to solve. It very much has the feel of "The bureaucracy is expanding to meet the needs of the expanding bureaucracy.". It seems like a lot of the "problems" it "solves" can be solved by not using Spring at all.
Yeah, I'm vaguely aware of the performance characteristics of Helidon. I followed the development of virtual threads closely and did a lot of testing on the JDK preview releases (although all of the problems I found had already been found by others by the time I reported any of them). The performance of
To be honest, I'm really not interested in web frameworks. I consider about 90% of the technology to be a stack of bad solutions to problems the technology itself caused. So many of the problems the frameworks purport to solve can be solved by just ... not doing anything. Even HTTP as a protocol is absurdly complex for what it does: Take a look at the HTTP/1.1 specification! The protocol has only gotten larger and more complicated since then. Netty is actually a prime example of an extremely complicated solution to a problem that's now solved relatively trivially with blocking I/O and virtual threads. In my experience, it's far better to build something small and bespoke with well-understood and well-defined operational semantics than it is to try to crowbar something large and general purpose into whatever problem you're facing. Unfortunately, there's a pretty widespread belief that one should always use solutions to problems written by others regardless of the cost. It takes confidence in one's own ability and a solid understanding of the problem to do otherwise. |
Beta Was this translation helpful? Give feedback.
-
Great ! I will add two cents of mine.. Most of the companies blindly start using the Stack that gets popular. An ideal example is Spring. I have seen Reddit users stating that they don't want to use Spring but their company wants them to use for the only reason that Spring devs are easy to find. I am following Spring since a decade. They are still sticking to (keep modifying) their legacy Spring framework library. So the bottom line we should stick to Java JDK as closely as possible.
I didn't get to understand this.. what exactly do you want to say. |
Beta Was this translation helpful? Give feedback.
-
Yes, exactly. The VM itself has well-specified semantics, and the fewer layers of crap between it and the actual application, the better.
If you take a look at how the login operation code works in The reason for this is to make brute-force password guessing impractical; if the admin has set a one second login delay, then it's obviously only possible for an attacker to try one password per second in serial. In terms of how this affects performance: What I meant was that most of the time we're thinking of performance in terms of requests handled per second, but the primary operation that the |
Beta Was this translation helpful? Give feedback.
-
Right, I got it now. Thanks |
Beta Was this translation helpful? Give feedback.
-
Hi @io7m
While browsing the github site, I stumbled upon this repository. The code looks really organised.
For creating instances, I am seeing you are using the
new operator
, and not using any Dependency Injection library or using Javax @Inject annotation. It is probably because it takes a toll on performance. Is this correct? But there are few dependency injector like Dagger that reads the annotation at compile time and performance is not affected.Is the code making sure that the service objects should be singletons i.e. only a single object in memory? I didn't encounter the @singleton annotation.
While most of the models are declared using the
record
keyword, some models like this are simply defined using the old-fashionedclass
keyword. You may opt using theProject Lombok
library.Thanks
Raman
Beta Was this translation helpful? Give feedback.
All reactions