# DIY NoSQL part deux: interchangeable parts

DevFeed: [DIY NoSQL part deux: interchangeable parts](<https://devfeed.tech/articles/diy-nosql-part-deux-interchangeable-parts-32117.md>)

Original publisher: [Read original article](<https://adambard.com/blog/diy-nosql-revisited/>)

Published: 2014-06-30T00:00:00Z

Content type: tutorial

Language: en

Sources: [Adam Bard](<https://devfeed.tech/sources/adam-bard.md>)

Topics: [Clojure](<https://devfeed.tech/topics/clojure.md>), [NoSQL](<https://devfeed.tech/topics/nosql.md>), [Refactoring](<https://devfeed.tech/topics/refactoring.md>), [API](<https://devfeed.tech/topics/api.md>), [Development](<https://devfeed.tech/topics/development.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [clojure](<https://devfeed.tech/tags/clojure.md>), [development](<https://devfeed.tech/tags/development.md>), [nosql](<https://devfeed.tech/tags/nosql.md>), [refactoring](<https://devfeed.tech/tags/refactoring.md>)

## AI overview

A follow-up tutorial on building a more modular in-memory NoSQL datastore in Clojure. It refactors the original design to avoid a static global, separates storage implementations, and introduces records and protocols to support interchangeable AtomStore and database-backed implementations.

## Source excerpt

After my last post on using Clojure's STM as a quick-and-dirty in-memory datastore, I had an interesting discussion in the comments about the wiseness of implementing my example with a static global. Coincidentally, I attended a talk by Stuart Sierra at EuroClojure about this very thing, and started getting some ideas about how to make things better, which I want to share today.