Skip to content

Comment on Write libraries, not servicesparent

Comments

Libraries don't encapsulate data or operations.

For example, say we're on a team at Netflix responsible for handling recommendations. We could provide this to other teams a library they call: get_movie_recommendations(user, genre, ...)

However, that call will need to hit a datastore. Which datastore does it use ? Which servers is that datastore running on ? When we make changes to the schema and need to migrate, which groups do we need to involve ?

If it's a service, the recommendations team can own everything: the code, the data, and the servers. The other teams can be treated like customers of the service.

Um. Encapsulating data and operations is exactly what libraries do. It's kinda what they're for.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.