# Artsy Deprecates the KAWS Collections Service by Moving Its Functionality into Gravity

DevFeed: [Artsy Deprecates the KAWS Collections Service by Moving Its Functionality into Gravity](<https://devfeed.tech/articles/third-time-s-the-charm-deprecating-kaws-19160.md>)

Original publisher: [Read original article](<https://artsy.github.io/blog/2022/05/09/deprecating-kaws/>)

Published: 2022-05-09T00:00:00Z

Content type: article

Language: en

Sources: [Artsy](<https://devfeed.tech/sources/artsy.md>)

Topics: [API](<https://devfeed.tech/topics/api.md>), [Node.js](<https://devfeed.tech/topics/node-js.md>), [Database](<https://devfeed.tech/topics/database.md>), [GraphQL](<https://devfeed.tech/topics/graphql.md>), [elasticsearch](<https://devfeed.tech/topics/elasticsearch.md>), [TypeScript](<https://devfeed.tech/topics/typescript.md>), [Rails](<https://devfeed.tech/topics/rails.md>), [Ruby](<https://devfeed.tech/topics/ruby.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [database](<https://devfeed.tech/tags/database.md>), [elasticsearch](<https://devfeed.tech/tags/elasticsearch.md>), [graphql](<https://devfeed.tech/tags/graphql.md>), [kaws-refactoring-gravity](<https://devfeed.tech/tags/kaws-refactoring-gravity.md>), [node-js](<https://devfeed.tech/tags/node-js.md>), [rails](<https://devfeed.tech/tags/rails.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [typescript](<https://devfeed.tech/tags/typescript.md>)

## AI overview

Artsy explains why it deprecated KAWS, a service for defining artwork collections, and moved its functionality into the main Gravity database and API. The article describes KAWS's Node.js, MongoDB, GraphQL, TypeScript, and Elasticsearch-based design and the lessons from retiring it.

## Source excerpt

How do you tell when it's time to deprecate a system? If something mostly works OK, is it worth spending time and effort replacing its functionality? At Artsy, we realized several years ago that we needed to be able to group a bunch of artworks together. If we wanted to have a page with all of the ceramics by Lucio Fontana, or contemporary prints from the IFPDA Fair Sprint 2022, or a gift guide curated by Antwaun Sargent, we needed to have a way to make that happen. We decided to call these things "collections," a reasonable name for a collection of artworks. In order to create them, we developed a service called KAWS, named after the artist (whose works we wanted to put in several of these collections). Now, 4 years later, we've taken down the service and folded its functionality into Artsy's main database and API, Gravity. Let's talk about why and what we learned along the way. A little context KAWS has a somewhat unusual design. It's a server, a Node.js app with its own Mongo database, and it serves up a GraphQL API. It also relies on TypeORM to map TypeScript models to database records and TypeGraphQL to keep TS and GraphQL types in sync. This makes it a bit different from most services Artsy maintains. Most of our APIs are Ruby on Rails apps, and we don't have any other uses of TypeORM and TypeGraphQL. When it was created, it was a cool experiment with a possible direction for future APIs - one we decided not to pursue for the time being. KAWS doesn't store any artworks - or even any artwork IDs. Instead, it just stores a "query", a set of Elasticsearch criteria. This could be a list of artist IDs or gene IDs, a tag ID, a keyword, or any combination of those things. In other words, a KAWS artwork collection could be defined in human-readable terms as something like "artworks with the 'Black and White' gene by the artist Bridget Riley" or "artworks by Auguste Rodin with the keyword 'bronze' and the gene 'Sculpture'." This approach results in a somewhat odd flow