Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The article above, and most if not all the comments I read right before posting this, seem to be very quiet about what I thought was one of the main "distinctive elements" of Microservices.

I.e. the idea that each microservice has direct access to its own, dedicated, maybe duplicated storage schema/instance (or if it needs to know, for example, the country name for ISO code "UK" it is supposed to ... invoke another microservice that will provide the answer for this).

I always worked in pretty boring stuff like managing reservations for cruise ships, or planning production for the next six weeks in an automotive plant.

The idea of having a federation of services/modules constantly cross-calling each other in order to just write "Your cruise departs from Genova (Italy) at 12:15 on May 24th, 2023" is not really a good fit for this kind of problems.

Maybe it is time to accept that not everyone has to work on the next version of Instagram and that Microservices are probably a good strategy... for a not really big subset of the problems we use computers for?



Country codes, and other lookup tables, could easily be handled by a repository of config files. Or, if your company uses a single programming language, a library.

One strategy I've used is to designate one system as a source of truth (usually an ERP system) and periodically query its database directly to reload a cache. Every system works off their own periodically refreshed cache. Ideally, having all the apps query a read replica would prevent mistakes from taking down the source of truth.

I haven't done this, but I think using Postgres with a combination of read-only foreign tables and materialized views could neatly solve this problem without writing any extra code.

I don't know how far this would scale. I do know that coordination and procedures for using/changing the source of truth will fall apart long before technical limitations.


Fair enough. The catch, though is that ... I am the guy working on the ERP, in your example ¯\_(ツ)_/¯


You can make spaghetti from anything.

A micro service implementation of that would be CQRS, where the services to write updates, backend process (eg, notifying the crew to buy appropriate food), and query existing records are separated.

You might even have it further divided, eg the “prepare cruise” backend calls out to several APIs, eg one related to filing the sailing plans, one related to ensuring maintenance signs off, and one related to logistics.


They solve specific problems. If they don't solve a problem you have, then using them is probably a mistake.

The thing is that the framing of "the problems we use computers for" misses the entire domain of problems that microservices solve. They solve organisational problems, not computational ones.


I have exactly the opposite problem though: the kind of problems I have worked on so far would not be "solved" by leveraging "large number of developers that can independently work on an equally large number of small, modular programs with a very well defined, concise interface".

And this is not because "my stuff is complicated and your stuff is a toy", either. It's more like "ERP or Banking Systems" were deployed decades ago, started as monoliths and nobody can really afford to rewrite these from scratch to leverage Microservices (or whatever the next fad will be). (I am also not sure it is a good idea in general for transactions that have to handle/persist lots of state, but this could be debated).

The problem, in fact, is that "new guys" think that Microservices will magically solve that problem, too, want to use these because they are cool and popular (this year), and waste (and make me waste) lots of time before admitting something that was clear from day 1: Microservices are not a good fit for these scenarios.

(I still think that "these scenarios" are prevalent in any company which existed before the 90s, but I might be wrong or biased on this).


Microservices as a named architectural pattern are over a decade old at this point. Anyone jumping on them because they're the new hotness is more than a little behind the times.

> I have exactly the opposite problem though: the kind of problems I have worked on so far would not be "solved" by leveraging "large number of developers that can independently work on an equally large number of small, modular programs with a very well defined, concise interface".

If you don't have multiple teams working on it, and you don't have specific chunks of functionality that you need to scale orthogonally, then you don't have the problems microservices solve. So don't use them. That seems uncontroversial to me.

> I still think that "these scenarios" are prevalent in any company which existed before the 90s, but I might be wrong or biased on this

This is survivorship bias, in a sense. Microservices only make sense where access to CPU and network is cheap and on-demand (largely). That's only started to be an assumption you could really make since Amazon's EC2 convinced the world's CIOs that fungible tin was better than their own racks.

That means you don't see microservice architectures in older companies, and you don't see problems being solved with them even where it might have made sense retrospectively because IT Ops would never have been set up to enable it.

Today you don't need a big rewrite to justify introducing microservices where they're needed. That's a straw man. All you need is a team that will be able to move faster if their deployment is decoupled from everyone else's.

But fundamentally if your problem area smells like "bunch of business rules and a database" then, again: if you don't have the problem that the architecture solves, don't use it.


> Anyone jumping on them because they're the new hotness is more than a little behind the times.

cough Aging directors in Health and Finance cough


> Instagram

Does anyone have a microservice "map" of Instagram? I feel that would be helpful here.


Instagram, Dropbox, many of the major tech companies still use a monolith.

Or you can think of it as trunk/branch architecture. One main "trunk" service and other branch services augmenting it, which is a simpler thing to reason about.

Now imagine a small shop of 20 devs deciding to build something more complicated.


They actually use a python monolith unless it's changed recently. See e.g. https://instagram-engineering.com/static-analysis-at-scale-a...


Meta deploys as "microservices" with multiple monorepos...

Binaries are deployed and scaled independently as thrift services.

Tons of rpc.


The distinct elements are they compile separately and have versioning on their API calls.

No, you don't use separate microservices for writing out that text message.

The idea is pretty simple instead of writing one big program, you write many smaller programs.

It's useful around the 3 to 4 separate developers mark.

It avoids you having to recompile for any minor change, allows you run the tests for just the part you changed and allows you to test the microservices in isolation.

If you a production issue, the exception will be in a log file that corresponds to a single microservice or part of your codebase.

Microservices are a hard form of encapsulation and gives a lot of benefits when the underlying language lacks that encapsulation. e.g. Python.


No, you don't use separate microservices for writing out that text message.

But in order to find out that Genua is the name of the port from where the cruise is departing, the appropriate time (converted to the timezone of the port, or the timezone of the client who will see this message, depending on what business rule you want to apply) and that Genua is in IT=Italy... how many microservices do I have to query, considering that port data, timezones, ISO country codes and dep.date/time of the cruise are presumably managed on at least four different "data stores"?


1 microservice. It's up to the software engineer to scope out the microservices properly.


ive never seen that in practice. you dont have a database for each individual lambda. thats insanity. you can have multiple microservices point to a shared datasource, its not illegal.


I agree, and yet most microservice zealots seem to have a different opinion on this.

e.g.: https://www.baeldung.com/cs/microservices-db-design

"2.1. Fundamentals By definition, microservices should be loosely coupled, scalable, and independent in terms of development and deployment. Therefore, the database per service is a preferred approach as it perfectly meets those requirements. Let’s see how it looks:"

Please understand that I have worked only on monoliths and will probably retire while still working on monoliths. This kind of absurd positions only come up when someone comes to my office with some grand plan to convert the application I work on to something "more microservice oriented".


Whilst I don't know much about cruises. Let me make up an example for you.

Let's suppose we are Acme Cruise Lines running a Cruiseliner:

Microservice - National Coastguard Ship Arrival System Feed Handler

Database - Logs incoming messages on the feed

Microservice - Asian and Australian Joint Ship Monitoring System

Database - Logs incoming messages on the feed

Microservice - Cruiser Arrival and Departure Times

Database - Cruiser Arrival and Departures Times in a Standard Format

Microservice - Customer Bookings and Payments

Database - Customer Bookings and Payments

Microservice - Fuel Management System

Database - Ship Fuel Levels & Costs of fuel at Various Ports.

It's that high level of split up.

(AWS Lambdas aren't quite the same thing as microservices.)


You are absolutely right: you do not know much about cruises.

The things you listed are ... 4-5 different applications, mostly running directly on the ship(s) and what is conspicuously missing are the parts that are managed shoreside, like:

Itinerary planning (your product is one or more cruises: therefore you need to preplan the itineraries, which ships to use, when you will enter each port and when you will leave it, and so on... try to imagine this like a mix between hotel management and flight company management) Inventory management (i.e. Reservation).

You mention "bookings" like a microservice. This could work for ferry line, where you are basically selling a ticket for a single trip, most of the time with no personal accommodation (except maybe for the car).

A Cruise booking usually comes with a ton of ancillary services (e.g. I live in Berlin and I want to take a cruise in the Caribbeans... therefore I need a flight to get there and back. This could be provided by a charter flight or a normal airline ... in either cases the ticket will be part of the booking itself) - take in account that cruise customers are mostly middle-aged or older and relatively affluent, therefore the last thing they would like to do is to create their own itinerary by booking services on 4-5 different websites.

(But I suppose it is better to stop there, we are really OT now)


"4-5 different websites" No, no, no. Those are internal APIs. You still only present one website to the end user.


Sorry, you misunderstood.

When you book a cruise, your expectation is to get everything (including hotel stays before or after the cruise, along with flights to and from it) as a single package provided by the cruise vendor (or a travel agency). So the "reservation system" must take care of all of that.

When I said "4-5 different websites" I was trying to explain the point that a 60 yo high-income guy is usually not interested in getting the cruise itself on Carnival.com, then go look for excursions on CarribeansExcursion.net and to book flights on Lufthansa.de or AirFrance.fr.

It was a remark on the way the Cruise business works, and why it is so, not about architecture.

(But, once again, I really believe that we are way off topic... personally I do not really feel like creating a "Ask HN: are microservices a good choice for the cruise industry?" but if someone feels like submitting one I will try to contribute).




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: