What is mince dynamo db?
Light weight ORM to persist data to an Amazon DynamoDB database.
Provides a very light weight interface for storing and retreiving information to DynamoDB.
The motivation behind this is so your application is not tightly tied to a specific database. As your application grows you may need to upgrade to a different database or pull specific models to a different persistence strategy.
How to use
view the example mince rails app to see how to use this.
# Add a book to the books collection MinceDynamoDb::DataStore.instance.add 'books', title: 'The World In Photographs', publisher: 'National Geographic' # Retrieve all records from the books collection MinceDynamoDb::DataStore.instance.find_all 'books' # Replace a specific book MinceDynamoDb::DataStore.instance.replace 'books', id: 1, title: 'A World In Photographs', publisher: 'National Geographic'
View the docs for MinceDynamoDb::DataStore for all methods available.
Why would you want this?
- To defer choosing your database until you know most about your application.
- Provides assitance in designing a database agnostic architecture.
- When used along with Hashy Db it offers very little technical dependencies. Use Hashy Db in development mode so that you can clone the repo and develop, and run tests, cucumbers without databases, migrations, etc. Then in production mode, switch to Mince Dynamo DB.
If you are able to switch between Hashy Db and Mince Dynamo Db, your application will be more open to new and improved database in the future, or as your application evolves you aren't tied to a database.
- Write integration specs
- Do not use singleton for data store
- Refactor data store
- Remove dependency on Active Support
- fork into a topic branch, write specs, make a pull request.
Matt Simpson - @railsgrammer
- Your name here!