News for hackers. Stuff that matters.
Re:New Grad vs. Senior Dev by bogdanu on Saturday March 28, 2020 @02:39PM (#22713290)
The reverse of this also happens: new team manager joins a team of 4-5 dev and goes "eww... a monolith, we'll write an MVP in 3 weeks with microservices, CQRS and all".

Long story short, one year and a half passes and the mvp is still not finished, the architect leaves the company and some poor guys (from an outsourcing company) are still going at it with the same architecture.

Re:New Grad vs. Senior Dev by cameronfraser on Saturday March 28, 2020 @03:31PM (#22713716)
CQRS and microservices has so much overhead, I'm amazed at how many companies adopt microservices without having anyone know a single thing about distributed systems. I think people underestimate the glue required to make microservices be useful. I had a similar situation at my last company where they spent a year and a half converting their monolith into half ass microservices and it still wasn't working properly. They also stopped releasing new features on their product during this entire conversion which obviously lead to a drop in customers. The mass exodus of employees at the end was something beautiful though.
Re:New Grad vs. Senior Dev by Lapsa on Saturday March 28, 2020 @05:40PM (#22714519)
I would argue that main reason for adaptation of microservices is to actually prolong development time (moar dollars) and make devops as convoluted as possible to safeguard data. Or foolishness.
Re:New Grad vs. Senior Dev by marktolson on Saturday March 28, 2020 @07:01PM (#22714960)
I don't understand the hate for microservices on hn. I have found microservices are a great way to extend monoliths developed with legacy frameworks. There are so many pros with the cons easily avoidable with the right tooling / processes.
Re:New Grad vs. Senior Dev by JamesBarney on Saturday March 28, 2020 @07:40PM (#22715167)
Basically it comes down to

Distributed logging:hard

Distributed debugging: hard

Distributed versioning: hard

Distributed transactions: very hard

And on 95% of projects these problems aren't worth solving for the benefits of microservices.

Re:New Grad vs. Senior Dev by bogdanu on Saturday March 28, 2020 @07:55PM (#22715225)
> And on 95% of projects these problems aren't worth solving for the benefits of microservices.

And especially with a team of 4 or 5 developers.

Re:New Grad vs. Senior Dev by capableweb on Saturday March 28, 2020 @08:19PM (#22715329)
I just started working on a new project about half a year ago, completely greenfield. The backend developer (there is only one...) jumped into microservices directly, deploying on AWS Fargate, trying to split out as many things into containers as possible, because that's the "proper" way of doing it. We still have few users as the project is new, but hey, at least we could scale to 100000s users in a few minutes, instead of having easier logging, debugging and versioning

A lot of stuff in software engineering is just driven by what's popular, not what's needed.

Re:New Grad vs. Senior Dev by bcrosby95 on Saturday March 28, 2020 @08:26PM (#22715369)
A monolith can handle millions of daily unique users. The database is the hard part.

In the web world, if you have less than 10s of millions of daily users, as long as you design an application that holds no state itself, the architecture is usually more important for scaling your team and the size of your codebase rather than the number of users you can handle.

Re:New Grad vs. Senior Dev by cc81 on Saturday March 28, 2020 @09:51PM (#22715728)
I've been in discussions about internal applications with few hundreds users and very moderate amounts of data being shuffled and stored and some people, of various backgrounds, are just so convinced that we need to go all in on Kubernetes, Microservices, Istio etc.

And all I can think about is "Hey, you could build this with a small team as a simple monolith and with proper caching you could probably run this on one or two raspberry pi, that is the amount of power you actually need here".

Don't get me wrong I do think they absolutely have their place and in other parts of the company we have much larger software development projects and they are absolutely making great use of Microservice architectures and Kubernetes and is getting a lot out of it. But that is 100+ teams building a product portfolio together.

Re:New Grad vs. Senior Dev by rumanator on Sunday March 29, 2020 @03:12AM (#22717022)
> And all I can think about is "Hey, you could build this with a small team as a simple monolith and with proper caching you could probably run this on one or two raspberry pi, that is the amount of power you actually need here".

If your product has a global audience who needs to CRUD stuff, caching and a single raspberry pi won't get you very far in the game.

If it's just an intranet stuff with a few hundred users and your front-end isn't very chatty then you're right, you don't need much.

Re:New Grad vs. Senior Dev by capableweb on Sunday March 29, 2020 @06:13AM (#22717730)
If you don't pile abstractions on top of abstractions on top of kubernetes on top of docker, you'd be surprised how much you can do with a single small-sized instance.
Re:New Grad vs. Senior Dev by lima on Sunday March 29, 2020 @06:44AM (#22717872)
k8s has no performance overhead and can be useful even for simple applications (like for reproducible dev environments and CI). Agreed, otherwise.
Re:New Grad vs. Senior Dev by capableweb on Sunday March 29, 2020 @10:56AM (#22719490)
I'm not talking about performance overhead, I'm talking about architecture overhead. Kubernetes doesn't have any advantages over not using Kubernetes for simple applications. Reproducible dev environments and CI you can get easily without Kubernetes, without having to add complex solutions for logging, profiling and other introspection tools.

One could argue that you need the reproducible dev environments and CI to be solved BEFORE even start using Kubernetes.

Re:New Grad vs. Senior Dev by rumanator on Sunday March 29, 2020 @12:50PM (#22720451)
> Kubernetes doesn't have any advantages over not using Kubernetes for simple applications.

So out-of-the-box support for blue/green deployments and fully versioned deployment history with trivial undo/rollbacks are of no advantage to you?

> Reproducible dev environments and CI you can get easily without Kubernetes, without having to add complex solutions for logging, profiling and other introspection tools.

I'd like to hear what you personally believe is a better alternative to kubernetes.

And by the way, Kubernetes does not support not requires distributed tracing tools not "logging, profiling, and other introspection tools". That's somethings entirely different and separate, and something that you only use if for some reason you really want to and make it your point to go out of your way to adopt and use.

In fact, distributed tracing is only a thing not due to kubernetes but due to you operating a distributed system. If you designed a distributed system and get it up and running somewhere else, you still end up with the same challenges and the same requirements.

Re:New Grad vs. Senior Dev by MaxBarraclough on Monday March 30, 2020 @10:34AM (#22728314)
Apparently HackerNews used to run from a single application server + Cloudflare caching, but later moved away from Cloudflare. Unsure how many web servers it runs on now. [0]

In 2016, Stack Overflow ran on 11 IIS web servers, but they really only needed 1.

[0] https://news.ycombinator.com/item?id=18496344

[1] https://nickcraver.com/blog/2016/02/17/stack-overflow-the-ar...

Re:New Grad vs. Senior Dev by mads_ravn on Sunday March 29, 2020 @03:03AM (#22716980)
This.

At least that is what I often think, when I hear people describing micro-services. If there is no data sharing between computations, then the problem is embarrassingly parallel [1] and thus easy to scale. The problem is not the monolith, it is the data sharing, which micro-services only solve if each service owns it’s own data. To be fair people advocating micro-services also often argue that they should own their data, but in quite a few of the instances I’ve heard described, this is not the case.

[1] https://en.m.wikipedia.org/wiki/Embarrassingly_parallel

Re:New Grad vs. Senior Dev by redis_mlc on Saturday March 28, 2020 @09:16PM (#22715574)
With microservices, you lose the ability to use database transactions across services/tables. Later on, when people realize this, it's too late.

It's priceless to see their expressions when senior mgmt. and business owners finally find out.

Re:New Grad vs. Senior Dev by rumanator on Sunday March 29, 2020 @03:16AM (#22717045)
> With microservices, you lose the ability to use database transactions across services/tables. Later on, when people realize this, it's too late.

I don't follow your reasoning. I mean, the ACID vs BASE problem you described is extensively covered in pretty much any microservices 101 course or even MOOC, along other basic microservices tradeoffs such as the distributed tax and ways to mitigate or eliminate these issues like going with bounded contexts. Why do you believe this is a mystery that no one is aware of?

Re:New Grad vs. Senior Dev by JamesBarney on Sunday March 29, 2020 @05:09AM (#22717452)
I've seen a couple of projects where the original team didn't think they needed transactions, or underestimated how much harder eventually consistent distributed systems are to reason about than an acid system.
Re:New Grad vs. Senior Dev by Aeolun on Sunday March 29, 2020 @06:51AM (#22717915)
It doesn’t matter if you have transactions or not. Just make sure you execute things in the right order! Same for referential integrity, if you just make sure nothing ever goes wrong, there’s no need for it! /s
Re:New Grad vs. Senior Dev by gullyfur on Saturday March 28, 2020 @11:21PM (#22716087)
Could you elaborate what you mean by transactions?
Re:New Grad vs. Senior Dev by AlexCoventry on Sunday March 29, 2020 @12:42AM (#22716485)
Sequences of interactions with the DB which are either atomically committed to on success of the sequence, or rolled back on failure, so that the DB is in the same state it had before the interactions began.
Re:New Grad vs. Senior Dev by elbear on Sunday March 29, 2020 @03:01AM (#22716970)
Can you explain why you lose that ability? It's not obvious to me.
Re:New Grad vs. Senior Dev by NateEag on Sunday March 29, 2020 @02:17PM (#22721229)
One of the fundamental laws of microservices is that each service is responsible for storing its own state. Nothing else is allowed access to its backing store.

Given that, once you have more than one service in your architecture, you cannot coordinate transactions across the distinct storage mechanisms - they are distinct databases and are therefore subject to the CAP theorem and other complexities of distributed computing.

Of course, nothing's stopping you from putting all your features into one service to avoid this thorny problem. It's a wise approach for most of us.

When you do that you have a monolithic architecture, not a microservice one.

Re:New Grad vs. Senior Dev by dnautics on Sunday March 29, 2020 @02:58AM (#22716958)
You can have a monolith and still suffer form these problems and need these technologies, as soon as you introduce a load balancer.
Re:New Grad vs. Senior Dev by erpellan on Sunday March 29, 2020 @05:26AM (#22717526)
If the application is stateless (all state lives in the DB) you can run as many copies of the monolith as required behind a load balancer.
Re:New Grad vs. Senior Dev by rumanator on Sunday March 29, 2020 @01:00PM (#22720539)
If your application is stateless following your definition then it's trivial to break the monolith down to microservices that focus on a bounded contexts while sharing a common db. This is a very well known microservices pattern.

https://microservices.io/patterns/data/shared-database.html

Re:New Grad vs. Senior Dev by erpellan on Sunday March 29, 2020 @04:39PM (#22722504)
Yes, and what does that buy you? Instead of a single deployable unit that owns the database, there are many deployable units, none of which can own the database. That doesn't seem like an improvement.
Re:New Grad vs. Senior Dev by JamesBarney on Sunday March 29, 2020 @01:53PM (#22720997)
Martin Fowler lists the benefits of microservices as

Strong module boundaries

Independent deployment

Technology diversity

And with a single database you severely limit the benefits from strong module boundaries and independent deployments. Suddenly you have to synchronize deployments, and anyone can pull or change any data in the database which now must be enforced with discipline which gets you into the same boat as a monolith.

Re:New Grad vs. Senior Dev by bogdanu on Sunday March 29, 2020 @06:54PM (#22723526)
> which gets you into the same boat as a monolith

Only worse because you don't have tools (IDEs, linters, etc) telling you what parts of the code have to be changed.

Re:New Grad vs. Senior Dev by dnautics on Monday March 30, 2020 @12:50PM (#22729657)
You can still wind up with distributed state errors. Ex:. User requisitions a billable resource, request hits node A. User immediately terminates billable resource, hits node B. Requisition request has a long latency (and termination request does not). So in the billing system, there is a negative time associated with the resource.
Re:New Grad vs. Senior Dev by maliker on Sunday March 29, 2020 @09:27AM (#22718822)
Our initial prototype was a cluster-based approach, and once we had a better estimate of user growth and resources we moved to a monolith for all the reasons you cite.
Re:New Grad vs. Senior Dev by darkteflon on Sunday March 29, 2020 @05:53AM (#22717649)
Why is distributed logging hard? Genuinely curious.
Re:New Grad vs. Senior Dev by sokoloff on Sunday March 29, 2020 @07:01AM (#22717961)
It’s not the log writing that’s hard; it’s the log insight extraction that is. When you compare poring over logs from multiple invocations, even with request identifiers, the tooling is worse than tooling to look over stack traces/core dumps.

A calls B, C, and D. B puts an item on a queue that eventually causes a call to C. Both B and C call D. Which D call is slow/erroring? Is it the AD, the ABD, the ABqCD, or the ACD call?

Re:New Grad vs. Senior Dev by philwelch on Saturday March 28, 2020 @08:33PM (#22715393)
HN can be a very contrarian community when it comes to popular trends or common practices in the tech industry.
Re:New Grad vs. Senior Dev by wolco on Sunday March 29, 2020 @12:47AM (#22716498)
It's just mindless copying. Just because x worked for someone here in this specific situation doesn't mean we should throw out everything else.
Re:New Grad vs. Senior Dev by rumanator on Sunday March 29, 2020 @01:03PM (#22720564)
No, contrarian is a good description of the problem. We see a lot of posters complaining loudly about problems they never had or tools they never used. Some appear to simply enjoy arguing for the sake of it.
Re:New Grad vs. Senior Dev by allover on Saturday March 28, 2020 @05:45PM (#22714549)
You're assuming malice over incompetence.

Having heard mainly "nothing but guff" justifications for microservices in non-enormous orgs, I think (as usual, and some law I forget dictates) the latter is more likely.

Re:New Grad vs. Senior Dev by mandelbrotwurst on Saturday March 28, 2020 @07:17PM (#22715044)
You're thinking of Hanlon's razor.
Re:New Grad vs. Senior Dev by nikanj on Saturday March 28, 2020 @09:07PM (#22715536)
They're perfect for a startup with lots of funding and little traction. So much busywork to keep the team churning!
Re:New Grad vs. Senior Dev by Volrath89 on Sunday March 29, 2020 @01:44PM (#22720910)
Why do people always associate cqrs with microservices?

I have a project where only 3 developers work; we re designed it to be cqrs. I was sceptical at first - I especially don't like some of the boilerplate it creates - but I'm now sold on it by combining it with the mediator pattern, now I can have validation, logging and performance checks on every command and query without repeating code, works like a middleware

And ofc being only 3 devs it would be nuts to have microservices so we are happy with a cqrs monolith

Re:New Grad vs. Senior Dev by 0x8BADF00D on Saturday March 28, 2020 @07:27PM (#22715111)
They are adopting microservices for the wrong reasons. It's easy for them to scale up, they don't need to scale out.
Re:New Grad vs. Senior Dev by pc86 on Saturday March 28, 2020 @10:43PM (#22715938)
Is anyone surprised that a "half assed" implementation of anything doesn't work properly, though?
Re:New Grad vs. Senior Dev by commandlinefan on Saturday March 28, 2020 @05:03PM (#22714315)
On the other other hand, I’ve worked on system that stuck with “the old way” (like ColdFusion) for so long that it was impossible to even find documentation on the old programming environment if you could find somebody willing to maintain it. The longer you wait to upgrade, the more it’s going to hurt when you finally do.
Re:New Grad vs. Senior Dev by bogdanu on Saturday March 28, 2020 @05:30PM (#22714468)
I'm not against replacing old systems, but this has to happen in incremental steps.

This way, if an implementation path doesn't worth the effort, just drop it and don't spend dozens of months with a full rewrite and realizing that you are spending a week to implement a CRUD for a simple entity. It's even worse when devs are new to the project and have no knowledge of the domain; I've been burned by this, never again.

At the end of the day, we are not in the research field, we are payed to fix business problems, to deliver something that brings a business value. Yeah, it's nice to write some really complex software that would make the system a lot more optimized, but we have to deliver it before our bosses are getting tired of excuses and pull the plug. Learned that the hard way.

Re:New Grad vs. Senior Dev by Supermancho on Saturday March 28, 2020 @05:48PM (#22714565)
Having been in this situation, as well, I find that the aging out of technology MUST be led by a CTO who is competent enough to know that tipping point of cost-benefit. Their job immediately becomes a political choice (pass the pain to the next guy) when the point has passed and it gets worse every new CTO. Some of these systems are HUGE (hudreds of millions of lines of ColdFusion, where I worked).
Re:New Grad vs. Senior Dev by burpsnard on Saturday March 28, 2020 @07:13PM (#22715017)
in a way it's quite a testament to it's utility.

Allaire were there with a workable solution, before jsp, php, (?) asp. Iirc only perl was serious competition.

I still sometimes see lotus notes '.nsf' links

Re:New Grad vs. Senior Dev by pitay on Sunday March 29, 2020 @07:18AM (#22718047)
The reason I have been left without product document is because Oracle bought the software the organisation was using. Cannot stress enough the value of keeping an offline copy of the documentation of a product rather than relying on a companies website or similar.

Edit: Also want to add software installation files are very important to keep offline as well.

Re:New Grad vs. Senior Dev by jSully24 on Sunday March 29, 2020 @01:56AM (#22716775)
Never hire anyone who’s top priority is not to first understand the whys of the current situation and understands how to move forward from there.

If they have “the answer” but don’t understand the “why we are here today” their decisions should be, at the very least, suspect.

Re:New Grad vs. Senior Dev by Aeolun on Sunday March 29, 2020 @06:56AM (#22717944)
On the other hand, don’t hire who wants to understand everything first either. Sometimes a bad choice was just a bad choice, and it’s a waste of time to figure out if it was taken for a reason.
Re:New Grad vs. Senior Dev by majormajor on Saturday March 28, 2020 @06:02PM (#22714658)
That's a very "junior senior" type of developer. Rewrite from scratch needs external reasons to be a good idea, because you have a huge uncertainty risk of "i don't know enough about this system to rewrite it, and now i'm spending months hacking back in edge cases to the new no-longer-beautiful-design." Uncertainty risk doesn't mean never do it, but it means make sure you understand it and make sure it's gonna be worth it.
Re:New Grad vs. Senior Dev by mark-r on Saturday March 28, 2020 @08:27PM (#22715370)
Re:New Grad vs. Senior Dev by burpsnard on Saturday March 28, 2020 @07:02PM (#22714968)
> some poor guys.. still going at it

that's how you earn your thousand yard stare

Re:New Grad vs. Senior Dev by bogdanu on Saturday March 28, 2020 @07:24PM (#22715088)
I have that stare from the first few months of my career. The perks of working in outsourcing I guess.
Re:New Grad vs. Senior Dev by ido on Sunday March 29, 2020 @03:04AM (#22716983)
I've never worked in outsourcing and almost every job I had in my >15 years career as a developer included at least somewhat-gnarly & often truly-gnarly code.

It is very rare to see a codebase several years old that can be fairly describe as "in good shape".