News for hackers. Stuff that matters.
Re:Starting with microservices by rapind on Wednesday January 19, 2022 @05:57PM (#30001649)
Pretty sure microservices will be remembered as a horribly convoluted stop gap once we have better language modularization.

They encourage modular patterns which is usually good, but all that plumbing will eventually become unnecessary. I can’t help but remember building 6 versions of each class in the old ejb days whenever I hear microservices hype.

Re:Starting with microservices by steve_taylor on Wednesday January 19, 2022 @06:03PM (#30001730)
OSGi was supposed to solve this problem. You could start by running all bundles together in the same JVM, then split them across a cluster later if required. But it never quite took off beyond an implementation detail of various application servers.
Re:Starting with microservices by kavalg on Thursday January 20, 2022 @03:49AM (#30006429)
OSGi was a horrible dev experience. Lots of quirks and legacy. Nobody wants to maintain that code anymore.
Re:Starting with microservices by sackerhews on Thursday January 20, 2022 @05:29AM (#30007077)
> horrible dev experience

That's an understatement. It was soul destroying awfulness.

Re:Starting with microservices by beefsack on Wednesday January 19, 2022 @07:17PM (#30002436)
Even with language modularisation you lose the ability to provision modules independently if they are bundled together in a single service.

Microservices and monoliths are opposing extremes on a scale. There is a range somewhere in the middle which is entirely sensible.

I feel like I've found my greatest success with my service abstractions by separating things out based on resource and availability needs of the functionality.

Re:Starting with microservices by brightstep on Thursday January 20, 2022 @08:05AM (#30008370)
If you maintain the same interface (same classes, methods, types, etc) it seems to me a module ought to be hot-reloadable within the same process. This is already possible with a loosely-coupled plugin architecture and I could see it being an integrated part of a language.
Re:Starting with microservices by throwaway1777 on Wednesday January 19, 2022 @06:04PM (#30001738)
Example of better language modularization? Who is working on this?
Re:Starting with microservices by trixie_ on Wednesday January 19, 2022 @07:44PM (#30002695)
PHP, hear me out, each file is basically an independent hot swappable 'service'.

I wish more languages/compilers/runtimes had a similar capability.

Re:Starting with microservices by diordiderot on Thursday January 20, 2022 @03:53AM (#30006467)
Could you explain this more??
Re:Starting with microservices by KronisLV on Thursday January 20, 2022 @05:52AM (#30007247)
> PHP, hear me out, each file is basically an independent hot swappable 'service'.

I think that what the OP is referring to is the fact that you can map URLs to PHP files pretty easily and therefore changing what an endpoint does can be as simple as just swapping out a single file for another one.

However, that tends to fall apart with most modern frameworks, like Symfony, Laravel, Lumen and Slim, where you will typically invoke a main application file which deals with all of the bootstrapping first (reading configuration, DB connections, logging etc.) and then will hand off control over to a router, which will usually map to a controller of some sort, which may have the actual business/view logic spread over other referenced files, the way as other similar technologies like (Ruby on Rails) do it.

Of course, that's not a bad thing, especially since it allows you to follow some of the RESTful conventions, like having path variables without doing rewrites at the web server level, such as /users/12345/photos versus /users/photos.php?id=12345

That said, the whole "mostly single file, maybe with a few common imports" approach can also work fine, as long as your endpoints are kept relatively small. I haven't seen it scale up to large projects that well, at least most of the time.

Re:Starting with microservices by diordiderot on Friday January 21, 2022 @07:58AM (#30022808)
Thanks for the reply!
Re:Starting with microservices by Znafon on Wednesday January 19, 2022 @06:18PM (#30001899)
Perhaps some idea and abstractions from Erlang could be interesting to explore in more mainstream languages?
Re:Starting with microservices by davedx on Thursday January 20, 2022 @04:09AM (#30006569)
Yeah erlang is great