News for hackers. Stuff that matters.
Re:Prime Video Abandons Serverless Distributed Stack for Mon... by boxed on Thursday May 04, 2023 @03:14AM (#35812294)
I built a little microservice on the side of my monolith for PDF creation. It used headless chrome and ghostscript to render html to a nice PDF. The problem I had with having that code inside the monolith was that it increased my docker image creation for deploys by a lot. And that code pretty much never changed anyway.

I did feel a bit embarrassed having to make a microservice after having argued against them so much over the years. Hopefully I can stop producing PDFs soon so I can delete the entire thing :P

Re:Prime Video Abandons Serverless Distributed Stack for Mon... by The_Colonel on Thursday May 04, 2023 @03:28AM (#35812379)
That honestly seems like a reasonable use case for (what I call) auxiliary services serving the monolith. As I imagine, there's no real business logic, no data storage / transactions, no authentication/authorization (besides the service being hidden in the private network probably).
Re:Prime Video Abandons Serverless Distributed Stack for Mon... by foepys on Thursday May 04, 2023 @03:55AM (#35812541)
That's exactly what my team did at a former company. We generated reports through a legacy document engine because some customers cannot switch/update their report templates and so we moved the logic out of the monolith into a service to get rid of a large portion of our dependencies.

Moved the monolith to .NET Core, kept the report service on .NET Framework. A win for everybody.

Re:Prime Video Abandons Serverless Distributed Stack for Mon... by jon-wood on Thursday May 04, 2023 @05:00AM (#35812874)
This is absolutely the way to go in my experience. Keep related functionality together, that'll probably result in a big monolith, with maybe a few smaller services orbiting it with very specific roles, or dramatically different traffic patterns. One project I worked on consisted of two monoliths, because we were at the intersection of two business domains, and it didn't make sense to attempt to slap those radically different concepts into one model.
Re:Prime Video Abandons Serverless Distributed Stack for Mon... by mike_hearn on Thursday May 04, 2023 @05:02AM (#35812886)
Doesn't Docker use cached image layers to solve that? Your PDF rendering could be in one layer that never changes, and the rest goes on top.
Re:Prime Video Abandons Serverless Distributed Stack for Mon... by franga2000 on Thursday May 04, 2023 @05:40AM (#35813086)
The problem is when you have more than one such service. Now when one of them changes, all of them need to be rebuilt. You can solve this with multi-stage builds, but those only work if your build result can be easily copied.
Re:Prime Video Abandons Serverless Distributed Stack for Mon... by mike_hearn on Thursday May 04, 2023 @10:08AM (#35815564)
Is the issue here that images shouldn't be thought of as layers, but rather a tree of cached directory nodes? I don't quite follow what's meant by building here, are you referring to compiling or merging the resulting build artifacts into a final container image?

Non-copyable build outputs sound a bit wild - you're thinking of builds that encode absolute paths into the output binaries?

Re:Prime Video Abandons Serverless Distributed Stack for Mon... by boxed on Thursday May 04, 2023 @07:25AM (#35813782)
In theory yes, but that doesn't work well on github actions for example. The cache layering seems quite bad there for some reason.
Re:Prime Video Abandons Serverless Distributed Stack for Mon... by Guid_NewGuid on Thursday May 04, 2023 @06:37AM (#35813420)
I feel like it's a semantics thing. To me the meaning of microservices has undergone semantic drift to the antipattern in the article where every little component or database table is its own service with an associated "pizza team".

It's fine to just have plain "services" to do things like this where you need to leverage another OS/framework/whatever and just hive off something like PDF conversion while your core application remains a monolith.

Re:Prime Video Abandons Serverless Distributed Stack for Mon... by dontlaugh on Thursday May 04, 2023 @07:01AM (#35813612)
You can produce multiple docker images from the same codebase quite easily. You can deploy and scale them separately. None of that requires separate repositories or expensive RPC instead of local function calls.
Re:Prime Video Abandons Serverless Distributed Stack for Mon... by boxed on Thursday May 04, 2023 @07:22AM (#35813765)
Who said I have separate repositories?
Re:Prime Video Abandons Serverless Distributed Stack for Mon... by darkwater on Thursday May 04, 2023 @08:26AM (#35814207)
What's the difference if they are in one or two repo if they produce two artifacts that are separated? You *will* have network calls between the two, unless you are marrying yourself with a deployment/operational platform that can run the two artifacts together. (ok, there could be a few but I really don't see how this is just using a "monorepo" instead of a "multirepo")
Re:Prime Video Abandons Serverless Distributed Stack for Mon... by pnt12 on Thursday May 04, 2023 @08:13AM (#35814114)
I feel you - I worked on a project with pdf generation and the tool to generate it was quite heavy.
Re:Prime Video Abandons Serverless Distributed Stack for Mon... by manicennui on Thursday May 04, 2023 @10:11PM (#35824523)