Vishesh Duggar bio photo

Vishesh Duggar

CTO Software @vamstar. 15 years in tech. Entrepreneurial with a keen interest in product development and usability. Interested in working on high impact ideas.

Subscribe to my mailing list

Are you looking for a tech advisor or a CTO?

Contact on LinkedIn

Vamstar LinkedIn Twitter Github

Selecting an ORM is a tough call because it cuts through pretty much your entire application. You want to make sure that what you end up picking something that is not only easy to use but also allows you to go native if and when needed.

The three that were serious contenders included

  1. AWS data mapper , I was really surprised at their release rate
  2. dynamoose, the syntax is too verbose
  3. dyngoose

Others simply were not well typed. Dyngoose beats them hands down in almost all aspects. And is pretty well maintained by Ben who is pretty responsive.

Typed models

Dyngoose allows you to define your models as a typescript class and you can annotate your attributes using decorators. I really like this approach because I can then use something like type-graphql to specify my graphql schema and everything is nicely packaged as a single source of truth.


import { Dyngoose } from 'dyngoose';
import { GqlField, GqlType } from '@common/types/typegraphql-aliases';

import { Status, Type } from './enums';

@Dyngoose.$Table({
  name: `${process.env.STAGE}_message`,
  encrypted: false,
  stream: true,
})
@GqlType()
export class TypedModel extends Dyngoose.Table {
  @GqlField()
  @Dyngoose.Attribute.String({ default: () => 'Missing Hash' })
  hash: string;

  @GqlField()
  @Dyngoose.Attribute.Number({ default: () => Status.IDLE })
  status: Status;

  @GqlField()
  @Dyngoose.Attribute.String()
  type: Type;
}

Note: GqlField and GqlType are aliases for classes from type-graphql

There other features like batch optimizations, selective updates to prevent wasteful uploading of unchanged values and DynamoDB Accelerator (DAX) and Amazon X-Ray support make it a very obvious choice.

It allows you flexibility to go native with methods toDynamo and fromDynamo to hook into.

What is your choice of DynamoDB ORM and why?

Close to 15 years in tech; I've served as a CTO and advisor to multiple organizations. Brought close to 20 products to market. As a founding member of multiple organizations I've done everything from tech to stratgey, sales, marketing, hiring, accounting and more. Experience in a variety of technologies including but not limited to AWS, Node, React, Serverless, ElasticSearch, Groovy, Java, Typescript, Angular, Grails, PHP, Drupal, Wordpress.

Always interested in looking at new tech, strategy and ways I can add value to organizations.

[Contact me.](https://www.linkedin.com/in/experienced-cto/).