MongoDB vs DynamoDB for your (side) project

MongoDB vs DynamoDB for your (side) project

·

3 min read

Play this article

So here I'm wanting to create an MVP for a side project of mine and look for the cheapest DB aka cheapest data provider to use and let my baby see the daylight with the possibility of scaling and paying less money of course, but before boring you with the comparison I need to tell you more about my use case.

Data access layer (Functional)

I need to list my data accessing pattern first which were:

  • Insert schemaless data (obviously)

  • Update the last seen of a record

  • Query the last 5 elements

In the future queries:

  • How many updated records per week, month, year

Going to ignore the non-functional, come on it's a side project don't judge me

Data ETA

Assuming that most of the data types going to be text/string with a maximum size of 100KB per record.

How many records going to store per week or month?

10 in the day, 70 in the week, 300 records per month per user

Assuming that we want to support 100 users as a start

100 users * 300 records => 30K per month with the size of 30k * 100KB => 3GB per month

DynamoDB vs MongoDB

DynamoDBMongoDB
storage free tierFree 25 GB of storage AWS Free Tier512MB to 5GB of storage Shared RAM Upgrade to dedicated clusters for full functionality No credit card required to start
vendor lock-inamazon specific svccould use it on your side or Atlas's side
monitoringprovisioning, monitoring, and keeping servers running (not to mention making backups).none unless you are using Atlas and would have limited feat compared to a dynamo
securitybettermeh
record size400kb16 MB.
querybasic key-value lookup without the elastic map reducebetter querying framework
data typesnumber, string, and binaryint, long, date, timestamp, geospatial, floating-point, and decimal128
consistencyeventual data consistency No data validation - must be handled in application ACID transactions apply to table data only, not to indexes or backups Maximum of 25 writes per transactionstrong data consistency Native schema governance and data validation ACID transactions apply to documents, indexes, and backups 1,000 operations per transaction (executing within 60 seconds by default)
connectionsHTTPS - kinda unlimitedTCP - M0/M2 cluster tier is 500 per node
indexingLimited / Complex to manage Indexes are sized, billed & provisioned separately from dataRobust / Easy to develop against No extra cost to index your data

For my use case dynamo fail on the querying side which is important for me compared to the storage and scale for now at least.

Someday will have a use case to abuse dynamodb with but for now, my rational mind says no, for now, how about you would you do the same?