News for hackers. Stuff that matters.
Re:How to Design Software Architecture for Startups by jedberg on Monday May 08, 2023 @12:01PM (#35863172)
The ideal way this works is the Galactus team publishes a library that consumes their API. They build their service, you then use their library to access it.

But the key here is that their own library still goes through their API, not directly to their database. So that if you don't want to use their library you don't have to.

Re:How to Design Software Architecture for Startups by BoppreH on Monday May 08, 2023 @12:12PM (#35863302)
Ah, that's exactly what I've been doing, and unconsciously assumed here. I can attest it works very well, hence my confusion.
Re:How to Design Software Architecture for Startups by zten on Monday May 08, 2023 @02:13PM (#35865062)
The way to do this wrong (by forcing the use of the "blessed" client or common platform dependencies, instead of leaving it open to the consumer as you suggest) is discussed in this talk: https://www.microservices.com/talks/dont-build-a-distributed...
Re:How to Design Software Architecture for Startups by cogman10 on Monday May 08, 2023 @07:35PM (#35868351)
The thing to watch out for with the client is that the dependencies of the client aren't shared with the server dependencies. Client libraries should be minimal and optional when working with an API.

The failing pattern we've seen at my company is a client library, a server library, and a shared "model" library.

The issue that has happened time and time again is the model library ends up including classes and dependencies that either the server or client needs. This in turn leads to a frustrating experience of dependency wrangling when someone decides to throw in lombok, or kafka, or JavaFx into the model library for that 1 sweat `Pair` class the server is using internally. Or worse, they depend on a different model library because they need that one sweat enum. (Which in turn depends on other model classes, or server classes, or whatever).

If you do a client library, it should depend on practically nothing. The transport library (http client), authentication, and the data marshalling library. Nothing more. It should also be viewed as an example of how to work with your API and not the only way to work with the API. (Don't reinvent graphql... please!)

Re:How to Design Software Architecture for Startups by preseinger on Thursday May 11, 2023 @02:50PM (#35906568)
the whole point of an API is to define an interface in terms of a runtime protocol, invariant to any specific language, code, library, SDK, etc.

in fact the galactus team should actively _not_ publish a library for their API

doing so introduces a source-level coupling between consumers and producer, which the API was (presumably) created specifically to avoid

Re:How to Design Software Architecture for Startups by jedberg on Thursday May 11, 2023 @04:27PM (#35907936)
It's basically a reference implementation. Their library should not do any work other than marshal data. Kind of like how Amazon produces a command line tool to interact with their API, but you don't have to use it. It's just a lot easier.
Re:How to Design Software Architecture for Startups by preseinger on Thursday May 11, 2023 @06:41PM (#35909331)
the problem is that when an producer publishes a library like this, it's very tempting for them to assume that all access will go thru that library, and maybe even that all access will go thru the most recent version of that library

it takes an enormous amount of discipline to ensure that this kind of software is treated as "a reference implementation" rather than the canonical path

if an internal service API is too difficult to use without an API library, then this is a pretty good signal that something is wrong and needs to be fixed, imo