It's great. Then, the second bit is you want to use a module. It's called under-pressure, and under-pressure protects your service from being overloaded. So, you probably have heard about event-loop trashing, and it automatically protects you from that and essentially ensures that if your service receives too much load, it starts returning a nice 503 and, at least, is not crashing or going into a situation that's unrecoverable. Oh, by the way, that module is also part of platformatic, so you get it for free, if you use our stuff. Cool.
And the JSON file was very specific. How would I know what to put there if I am not Matteo? Oh, there is auto-completion if you didn't notice. It's actually very straightforward to put in there, it's JSON schema-based, and the JSON schema provides a guide. Finally, there, yay. That's my next question. It's great, and you can put it there, it's fully documented, but also there is auto-completion. So if there is auto-completion, it's great.
So, do you hate TS? Nope, nope, that's the answer, nope. Nope, I don't. In fact, the platformatics support full TypeScript compilation, so you can just write your plug-ins in TypeScript and everything will work fine as expected. So yes, no, I don't hate TypeScript. What happens to the plug-ins when the application is converted to microservices? Oh, you know, microservices is just a plug-in, right? So, that's what it is.
And when modularizing by domain, where do you place code that doesn't fall under a particular domain category? Some helper to be reused across API endpoints. So, okay, that is two bits. So, when you're building this kind of system, you have two levels of reuse. One level of reuse is typically at the code level. And when working larger teams, especially on a modular monolith, you tend to use a mono-repo. So each one of your modules, as I showed, instead of being structured, instead of just being a single folder, it also has a nice package JSON attached to it, right? So you could very practically have a utility library that you are actually importing and requiring in there. So if you just need code to reuse the utility, you can just, you know, share code. And that's it. If you want to set the key part is keep the domain separate, mostly keep the database separate. Keep the data of each domain contained so that it's not shared between boundaries. Cool. Thoughts on separating the transport HTTP GraphQL PubSub from business logic to allow business logic reuse between them.
Comments