News for hackers. Stuff that matters.
Re:Why we're sticking with Ruby on Rails by revskill on Friday July 08, 2022 @08:00AM (#32026002)
I think people think about microservice because they themselves failed to achieve modular monothlic.
Re:Why we're sticking with Ruby on Rails by jfabre on Friday July 08, 2022 @08:14AM (#32026162)
It always baffled me to hear:" Oh we're gonna do microservices, because our monolith is a total mess and we're very unproductive". If you can't organize a monolith, what makes you think you will be able to organize microservices which are vastly more complicated to work with. How about you learn as a company the proper skills and habits to achieve logical modularity within a single process before you try doing that with multiple processes.
Re:Why we're sticking with Ruby on Rails by arwhatever on Friday July 08, 2022 @04:46PM (#32026788)
I’m probably the last person on here to discover https://grugbrain.dev/, but I like the particular quote:

“grug wonder why big brain take hardest problem, factoring system correctly, and introduce network call too”

Re:Why we're sticking with Ruby on Rails by jfabre on Friday July 08, 2022 @08:31AM (#32026373)
And I would also add:

The reason your monolith is a mess is because your organization has low standards on code quality and doesn't value it. It is not willing to invest in it, and probably your department didn't acquire the skills and habits to produce clean code in cheap manner. The developers who are used to good code usually leave you out of frustration. No one likes to be unproductive, especially productive people.

Re:Why we're sticking with Ruby on Rails by atom_arranger on Saturday July 09, 2022 @01:13PM (#32037171)
I wonder if part of why microseconds work for some companies is the hype helps justify the work to management.

> We need to convert to microservices.

Sounds like a cool shiny new approach enabling better scaling and organization.

> We need to refactor this mess.

Sounds like complaining, why is it a mess anyways?

These two things may essentially be doing the same thing, organizing/breaking up the code logically, one just might sound more appealing to management.

Re:Why we're sticking with Ruby on Rails by eddd-ddde on Friday July 08, 2022 @10:48PM (#32031001)
I hate how much I can relate to this.
Re:Why we're sticking with Ruby on Rails by gitfan86 on Friday July 08, 2022 @08:31AM (#32026374)
"productive" means shipping code to these people. They are trying to minimize how often someone says "we are blocked on deploying that code"
Re:Why we're sticking with Ruby on Rails by jfabre on Friday July 08, 2022 @08:43AM (#32026530)
You would need to provide me with a concrete example, because I've never really had the issue you're describing. I'm willing to bet it's fixable by having better management.
Re:Why we're sticking with Ruby on Rails by vore on Friday July 08, 2022 @04:45PM (#32026768)
Assume you're having to ship a large single release bundling the code of multiple integrating teams: a bug in one of those teams' code will likely delay the release of the entire bundle: bugs are inevitable and no amount of better management will solve them. With microservices, you add coordination overhead but teams have more autonomy in shipping their own individual bundles.
Re:Why we're sticking with Ruby on Rails by NortySpock on Friday July 08, 2022 @06:08PM (#32028089)
I must be missing something:

1) if you have a blocking bug or code dependency between two microservices OR two monolith modules, that should of course block until it is fixed and resolved. Microservices do not magically solve that.

2) other code changes or features that are not blocked, can be unblocked by being released in a smaller release ( git rebase those commits to a new release branch on main, and cut, test and deploy a smaller release -- basically gitflow)

3) once the blocking modules are fixed, they should be rebased onto the latest main.

The blocking "effect", even in a monolith, seems like it would be better solved by using a version control system with good rebase support.

Coordination needs to happen for larger changes, and/or the changes need to be smaller.

Re:Why we're sticking with Ruby on Rails by therealdrag0 on Friday July 08, 2022 @10:32PM (#32030863)
It just doesn’t seem like that’s scales. The application I work on has a half dozen teams. Releases includes tons and tons of commits soaked for up to weeks. We can’t solve this with cherry picks lol.
Re:Why we're sticking with Ruby on Rails by jfabre on Saturday July 09, 2022 @08:52PM (#32040827)
Wouldn't it be more sensible to release often and in smaller increments instead? Why can't you do that? You only release one feature on top of master, test it to make sure nothing is broken then release it. The second feature has to merge on top of the new stable git hash once it's ready to be released. And so on... Bundling a bunch of stuff all at the same time seems like asking for misery and weird integration issues in production.
Re:Why we're sticking with Ruby on Rails by gitfan86 on Friday July 08, 2022 @08:07AM (#32026082)
The big advantage of microservices is organizational not technical. You can hire teams and tell them that they are responsible for an API that receives specific data and should return specific data. These teams can operate independently. You don't have to force all the teams to use the same language or dev process. That could be good or bad depending on the circumstances, but at least you have the option with microservices.
Re:Why we're sticking with Ruby on Rails by cdavid on Friday July 08, 2022 @08:13AM (#32026147)
That's the theory. What I've observed is that that companies who cannot achieve modularity w/ monolith are often the same ones incapable to achieve modularity w/ MS anyway.

So now you have in practice is a distributed monolith, with brittle, ad-hoc dependencies between services. A symptom is that most features require touching many MS.

Re:Why we're sticking with Ruby on Rails by Barrin92 on Friday July 08, 2022 @05:08PM (#32027116)
This isn't a good idea organizationally though. What matters is the performance of the system, not the performance of its parts, this is kind of a systems 101 lesson.

If you build a car and send each team off to find the best parts in isolation and screw them together, you don't have the best car, you likely have something that doesn't even drive, because the parts don't fit. The performance of a system is in the interaction of its parts, not the sum of the performance of its parts taken individually.

Teams can never operate independently because it only ever makes sense to improve a part if it improves the functioning of the entire system. The whole problem with the microservices approach it that it optimizes the wrong thing.

Re:Why we're sticking with Ruby on Rails by mpyne on Friday July 08, 2022 @06:28PM (#32028415)
> This isn't a good idea organizationally though.

It's absolutely necessary for very large organizations though. The alternative of trying to centrally plan the IT operations of an organization of, say, 500,000, gets to be quickly intractable.

Groups try to do it with frameworks like SAFe and while that may help a little bit, in the end you need to treat different parts of the organization as individual silos that are able to control and execute on their specific mission set within the wider org. Otherwise the complexity of the problem set they're dealing with makes it impossible to do anything without breaking other systems or teams.

Re:Why we're sticking with Ruby on Rails by Lio on Friday July 08, 2022 @08:45AM (#32026556)
The downside to that is that if you get the factoring of the app wrong you now have to refactor across disparate codebases separated by network calls.

It's much easier to start with a monolith and refactor it into microservices later than it is to refactor microservices written in different languages by different teams into a single codebase.

Re:Why we're sticking with Ruby on Rails by whodidntante on Friday July 08, 2022 @04:56PM (#32026959)
What about basic business functionality, for example, a function to create a site URL, which can be quite complex, and which would be very time consuming and complex and a maintenance nightmare if implemented in multiple languages.

You could, of course, create this as a service. And then make possibly hundreds of calls to this service to generate a single web page.

Or, you can provide a library that does this, and the calls are cheap, reliable, and predictable.

Of course, if it is a service, the caller would locally the cache the information needed to make all the calls, do a batch call to the service, and then backfill in all the links. This then precludes generating and sending the page as you go, and creates the possibility for an explosion in complexity if a simple change in requirements that causes the arguments for the URL generation to be dependent on another service/library call.

Not everything should be a service call.

Re:Why we're sticking with Ruby on Rails by ironmagma on Friday July 08, 2022 @08:12AM (#32026145)
All those things are quite achievable with a modular monolith. The API is the module.
Re:Why we're sticking with Ruby on Rails by windows_sucks on Friday July 08, 2022 @08:20AM (#32026255)
yeah but deployments and language choice are no longer a single teams choice now. microservices really do allow for a "we did our job" development
Re:Why we're sticking with Ruby on Rails by ironmagma on Friday July 08, 2022 @04:58PM (#32026976)
Language is always brought in as a "pro" for microservices. I would call it a "con." Fragmentation across languages can be a big problem if your business logic is complicated; suddenly you have to link against code written in another language, or worse, rewrite it.
Re:Why we're sticking with Ruby on Rails by eddd-ddde on Friday July 08, 2022 @10:51PM (#32031034)
You can still 100% just use whatever language and build a library, instead of sending json or binary data through network calls, you just use FFI.
Re:Why we're sticking with Ruby on Rails by rco8786 on Friday July 08, 2022 @10:31PM (#32030856)
Kind of unrelated unless the language chosen is the reason a team can’t do their work?
Re:Why we're sticking with Ruby on Rails by devoutsalsa on Friday July 08, 2022 @04:45PM (#32026780)
But they can't work independently. Unless your micro service operates in a vacuum, it's sending generating messages that will be consumed by other services. All of that communication requires a lot of frikkin' work. You need to maintain API documentation, update client libraries, remove garbage messages from the queue, coordinate deployment schedules, and all sorts of other crap. If you have FAANG level resources, maybe you can mock out & automate everything to the point where you don't need to worry nearly as much, but that's a monolithic effort (pun intended).
Re:Why we're sticking with Ruby on Rails by quickthrower2 on Friday July 08, 2022 @08:10AM (#32026115)
Do you need services though to achieve this? How about libraries?
Re:Why we're sticking with Ruby on Rails by adra on Friday July 08, 2022 @04:44PM (#32026761)
Libraries are great, but you can't deploy new versions of library without needing to step on toes. If your dev teams are just "shove this at ops" and done, then it may not make a difference, but if you need to be responsible for the code running in the real world, just library segregation doesn't cut it.
Re:Why we're sticking with Ruby on Rails by magicalhippo on Friday July 08, 2022 @06:28PM (#32028427)
I'm being dense it seems, because I don't see what microservices brings to this. What's the fundamental difference in this regard between shipping an executable with a bunch of dynamic libraries, and deploying a bunch of microservices?
Re:Why we're sticking with Ruby on Rails by olalonde on Friday July 08, 2022 @11:26PM (#32031282)
It's mostly about data. Each micro services is responsible for their own data, data migrations, data store, etc. Think of it as a mini web app with an API. In theory, you could use a library in that way but I have never seen such use in practice. You would also run into the problem of having to always keep all library users on the latest version as to avoid having two versions which expect different database schemas. It also largely forces you to stick to a single programming language.
Re:Why we're sticking with Ruby on Rails by quickthrower2 on Saturday July 09, 2022 @03:13AM (#32032660)
Conversely though, if you can make do with a single data store and data layer (orm or just simple queries) the libraries can use that.

The schema and generated classes could be a shared common library that different teams can work on (maybe with some architecture obersight)

Or if using schema-less each library “knows” it’s own json formats

Then you get nice things like atomic transactions across multiple “services”. You also have no network concerns.

You can pull out microservices for things that need special attention. Such as a spikey-load service that might need to run as a lambda.

Version management is a solved problem. Use your languages package manager and semantic versions.

I concede you need to stick to one language. Ish. You have C FFIs. A .NET app could reference a dll written in C++ or Rust. But yeah not as flexible as services. Although there are inbetween things like RPC.

Re:Why we're sticking with Ruby on Rails by quickthrower2 on Friday July 08, 2022 @05:09PM (#32027122)
I can’t get my head around that though.

I agree to split into services where “you’r have to do that anyway”.

But adding services where part A of the monolith needs to use part B where a library would do the job seems odd.

If you are trying to solve a specific scaling issue, then sure, but this is rare.

Re:Why we're sticking with Ruby on Rails by giancarlostoro on Friday July 08, 2022 @08:16AM (#32026189)
Yes, and in some cases, maybe you really need some crucial python library but the rest of your systems are in Go, and maybe you discovered a new library that does exactly what you need, in a third language in the most efficient way possible, you can embed a microservice into the mix. I think though, it is usually best to hire for one common language as much as possible, this way your team can jump across projects if the need arises.
Re:Why we're sticking with Ruby on Rails by rco8786 on Friday July 08, 2022 @10:29PM (#32030833)
Yikes I would never consider introducing a network layer as an organizational tool. Teams that do this are vastly underestimating the latency and general complexity of distributed systems.
Re:Why we're sticking with Ruby on Rails by fleddr on Friday July 08, 2022 @04:47PM (#32026822)
The big disadvantage of microservices is also organizational.
Re:Why we're sticking with Ruby on Rails by giancarlostoro on Friday July 08, 2022 @08:14AM (#32026160)
I think it can have its benefits but I don't think it should be your entire application. I know some people swear by it, and if that's what works for them and keeps them profitable, you know what? Go for it.

I think serverless is fantastic on the other hand[1]. I had a web application where I was parsing shapefiles to then import them into SQL Server. These files could be massive and take longer to process than they took to upload. As a result I figured that it might make more sense to create a serverless function in Azure to parse them once they were uploaded to blob storage. This was very easy to implement and transparent. If you are using something like Azure and want efficient ways to process your data without doing it all in your monolithic application and blocking your users, or creating a thread in the background which makes me a little uncomfortable, then serverless is a godsend.

I think Microservice architecture if I had to pin where it might make sense would be for APIs. I would then emphasize on versioning each microservice API. If you do a microservice architecture for APIs you can update parts of your API without taking the whole beast down (unless you use something like Erlang or slots in the case of Azure Web Apps, where it forwards new requests to new slot). I think this might be a reasonable use case for microservices. For a normal website though, I think monolithic with some serverless helper functions (if needed) is probably good enough otherwise.

[1] Note: Let's not confuse microservices for serverless, because it's not necessarily the same thing, although some people use serverless to achieve the microservice architecture, serverless functions can do so much more!

Re:Why we're sticking with Ruby on Rails by manfre on Saturday July 09, 2022 @10:12AM (#32035258)
The monolithic vs microservices arguments are more about where to arbitrarily draw separation lines in the deployed architecture.

Someone with a monolith that embeds the database could claim those who use MySQL failed to achieve modular monolithic.

Re:Why we're sticking with Ruby on Rails by dehrmann on Saturday July 09, 2022 @01:01AM (#32031878)
Without diligence, monoliths tent to turn into dependency spaghetti. Microservices can force you to spend more time structuring things.
Re:Why we're sticking with Ruby on Rails by gedy on Saturday July 09, 2022 @12:11PM (#32036470)
Especially in Rails apps where almost any bit of code can modify anything else.
Re:Why we're sticking with Ruby on Rails by BlargMcLarg on Friday July 08, 2022 @08:09AM (#32026104)
The main reason I hear when poking more is "so we're not dependent on other teams to release our module".

For some reason, I feel this is somewhat of a scapegoat and fails in practice. But I don't have enough experience.

Re:Why we're sticking with Ruby on Rails by NoGravitas on Friday July 08, 2022 @08:33AM (#32026410)
In any case, that sounds like an organizational problem, not a technical one.
Re:Why we're sticking with Ruby on Rails by iampims on Friday July 08, 2022 @05:34PM (#32027485)
Microservices are one way to help with scaling the organization, not necessarily the product/code.