Develoraptor Blog

Login

What's The Deal With Abstract API Libraries?

Today I came across the NPM module abstract-blob-store. It's a lovely little idea to publish a de-facto interface standard by defining an API and publishing its test suite as a module.

abstract-blob-store defines a standard for storing files and arbitrary blobs but doesn't mandate the implementation details. Library developers can then use that test suite to create data storage modules for different storage systems that are guaranteed to conform to the spec.

Furthermore, now that there are a range of modules with the same API, application developers can add data storage to their software without requiring the use of any particular storage framework; they just select a blob store implementation, construct it and pass it in as an argument when constructing their application.

It really frustrates me when I want to run a piece of software that says "you need an S3 bucket" or "you need to run this specific docker container". Not everyone has the same infrastructure requirements and you're just making it harder for people to use.

Abstract libraries are a way to avoid this pattern, and one of the necessary tools we need to embrace if we're really serious about the sustainable, social, specific web.