I’ve been working on the UI at a place that deals with “big data” and we came to a point of contention today. The API I was using didn’t have the data I needed in it, so I had two options: use the search API or fire off a bunch of times to get every single entity I need. The search API was out of the question, it takes 15-30 seconds and for a detail page that’s unacceptable. Firing off an unknown amount of API calls wasn’t exactly reasonable, so I asked for a “bulk” API. I’ll give you a list of ids and you give me what I need back. Nope.

I guess we are using Cassandra, so an in() is out of the question, because it’s really inefficient. But here’s the thing: I don’t care. The UX and DX shouldn’t suffer due to poor technology choices. Passing down the problem to the client is lazy and an asshole move.

It’s a pain the ass, but I got it working. It’s not that complicated, but why? Don’t pass your problems on to me. Now every time we need any sort of batch API the customer has to suffer? That’s unacceptable. And every time we need a batch API my code has to be over complicated, when it could have been solved in one place, for all to enjoy.

The database choice isn’t new. The limitations were well known when choosing to deprecate our falcor API (what a joke of a piece of software, this why you need to not buy into hype) and move to REST. But instead of choosing something appropriate for the size of the company and complexity of the data, we went with straight up express. First of all, using vanilla express for a project this mature is madness, it offers no creature comforts that something like Nest.js would, but worse, it offers nothing like a data-driven company needs like GraphQL can offer.

It’s literally the point of GraphQL to take a bunch of data from various sources and mash it together. You use data loaders to make it reasonably performant and call it a day. It even has the added benefit of solving over-fetching, which has downstream effects, reducing the amount of calls you need to make to other data sources when you aren’t requesting said data. I’m not even a fan of GraphQL, it’s kind of annoying, but it was the appropriate choice.

Regardless, some people have never learned what a good abstraction is or why separating concerns are important. The data team needs to make the data reasonable, the backend team needs to make the data accessible, and the front end team needs to make the data intractable – it’s not rocket science.

I wouldn’t ask the back end team to make me an endpoint for every view I have, no. I’m expected to make use of a well thought out REST API and compose the view. It’s not my fault you picked bad tech, so why make everyone, including the customer suffer? Keep your back end problems to yourself and I’ll keep the UI problems to myself.