Hacker News new | ask | show | jobs
by windows2020 1607 days ago
Best Practices

The requirement was to ingest a CSV, transform it, and put it in a database somewhere. The solution was three microservices.

The first read the data piece by piece (unit of work) and passed it to the second via HTTP. This was slow so it was threaded.

The second provided an abstract class which was extended to facilitate string transformations. Each was accompanied by a unit test. Similarly, the result was passed along to the third service via HTTP. This was also threaded.

The third put the data into a third-party queue which wrote into a database.

It took nearly a half of a day for the process to complete. I rewrote it as an SQL script which read the CSV into the database directly, used SQL functions for the transformations and then stored its result. It took a few minutes to complete. But, this wasn't a best practice or popular, and what would the team work on?

1 comments

That sounds like a nightmare, but I would not consider micro-services to be "best practice". It's a design decision.
Step 2: there are no "best practices" at all. These are just design decisions made by other people for their own reasons.