DynamoDB

User avatar
Cakedaddy
Posts: 9278
Joined: Thu May 20, 2004 6:52 pm

DynamoDB

Post by Cakedaddy »

Anyone familiar with DynamoDB, or noSQL databases? So far, it looks like that's the only free DB available on AWS. I have questions, but if no one knows about it. . .no point in typing. . .
TheCatt
Site Admin
Posts: 57511
Joined: Thu May 20, 2004 11:15 pm
Location: Cary, NC

DynamoDB

Post by TheCatt »

Kinda. I've messed around with it, written some prod stuff in it, but only lightly. It's best if you can access items directly via a known key. Less good with relational data. Typically you would denormalize your data so that it fits better into a noSQL system.
It's not me, it's someone else.
User avatar
Cakedaddy
Posts: 9278
Joined: Thu May 20, 2004 6:52 pm

DynamoDB

Post by Cakedaddy »

I briefly looked at it and got a big "oh fuck this" vibe from it. It goes against everything I know (limited) about databases.
Leisher
Site Admin
Posts: 70286
Joined: Thu May 20, 2004 9:17 pm
Contact:

DynamoDB

Post by Leisher »

SQL Express is free.
"Happy slaves are the worst enemies of freedom." - Marie Von Ebner
"It was always the women, and above all the young ones, who were the most bigoted adherents of the Party, the swallowers of slogans, the amateur spies..." - Orwell
TheCatt
Site Admin
Posts: 57511
Joined: Thu May 20, 2004 11:15 pm
Location: Cary, NC

DynamoDB

Post by TheCatt »

And SQLLite.
It's not me, it's someone else.
GORDON
Site Admin
Posts: 56735
Joined: Sun Jun 06, 2004 10:43 pm
Location: DTManistan
Contact:

DynamoDB

Post by GORDON »

ur face is free
"Be bold, and mighty forces will come to your aid."
TheCatt
Site Admin
Posts: 57511
Joined: Thu May 20, 2004 11:15 pm
Location: Cary, NC

DynamoDB

Post by TheCatt »

GORDON wrote: Tue Oct 29, 2024 10:07 amur face is free
for the right lady to sit on, yes.
It's not me, it's someone else.
Leisher
Site Admin
Posts: 70286
Joined: Thu May 20, 2004 9:17 pm
Contact:

DynamoDB

Post by Leisher »

TheCatt wrote: Tue Oct 29, 2024 10:17 am
GORDON wrote: Tue Oct 29, 2024 10:07 amur face is free
for the right lady to sit on, yes.
Ditto.
"Happy slaves are the worst enemies of freedom." - Marie Von Ebner
"It was always the women, and above all the young ones, who were the most bigoted adherents of the Party, the swallowers of slogans, the amateur spies..." - Orwell
User avatar
Cakedaddy
Posts: 9278
Joined: Thu May 20, 2004 6:52 pm

DynamoDB

Post by Cakedaddy »

Ya, but they aren't free on AWS. They have hosting fees. I can get an SQL based DB free for a year, but the cheapest I've configured is about $120/month. I read about $10-20/month options, but I don't understand AWS enough to find them. I don't want to host my own server.
TheCatt
Site Admin
Posts: 57511
Joined: Thu May 20, 2004 11:15 pm
Location: Cary, NC

DynamoDB

Post by TheCatt »

Cakedaddy wrote: Tue Oct 29, 2024 12:34 pm Ya, but they aren't free on AWS. They have hosting fees. I can get an SQL based DB free for a year, but the cheapest I've configured is about $120/month. I read about $10-20/month options, but I don't understand AWS enough to find them. I don't want to host my own server.
You can run SQLLite on EC2, but yeah, that means your own server.
It's not me, it's someone else.
thibodeaux
Posts: 8120
Joined: Thu May 20, 2004 7:32 pm

DynamoDB

Post by thibodeaux »

Cakedaddy wrote: Tue Oct 29, 2024 1:17 am I briefly looked at it and got a big "oh fuck this" vibe from it. It goes against everything I know (limited) about databases.
I know a little bit. What are you trying to do? Are you writing your own app and just need a storage layer?
User avatar
Cakedaddy
Posts: 9278
Joined: Thu May 20, 2004 6:52 pm

DynamoDB

Post by Cakedaddy »

I'm writing my own app and it's currently using postgresql. I'm looking at DynamoDB because there's a free option on AWS (all of the SQL based options cost an unknown amount of money per month). But what little bit I've picked up, it would be a HUGE rewrite and a pretty big learning curve. I get the impression it's more like using a big spreadsheet to store all of your data, as apposed to tables and records.

For the small scale stuff I'm doing, I'm sure it would work fine (small bursts of data amounting to 5-50 records at a time, occasionally some reports might request a couple hundred records) and total record count would be measured in the thousands, not millions (unless it's running for 10+ years).

My free database host is buggy. Doesn't always answer a query. Will 'ignore' it and I have to wait a minute before trying again (something about pooling requests and waiting for things to time out or something). I was looking at moving the DB server to AWS hoping for better reliability. But when I do the cost estimator thing, it estimates about $180 per month which is not feasible. I've read about cheaper SQL based options, but can't find them, or figure out how to configure the cost estimator to estimate those costs.
thibodeaux
Posts: 8120
Joined: Thu May 20, 2004 7:32 pm

DynamoDB

Post by thibodeaux »

I get the impression it's more like using a big spreadsheet to store all of your data, as apposed to tables and records
Pretty much.
it would be a HUGE rewrite and a pretty big learning curve.
Maybe not, if you're using a data abstraction layer, maybe via Spring for example. But...probably yeah.
cheaper SQL based options
The AWS service for SQL is called "RDS" and they basically charge you the price of the underlying EC2 instances (running 24/7) plus a markup. SO yeah probably expensive, but if you used a db.t4g.micro instance (designed for bursty loads) its ~$25/month. But you probably could even go with Aurora serverless:
https://aws.amazon.com/rds/aurora/serverless/

https://aws.amazon.com/rds/aurora/pricing/

Aurora is their custom PostGres or MySQL compatible RDBMS.
TheCatt
Site Admin
Posts: 57511
Joined: Thu May 20, 2004 11:15 pm
Location: Cary, NC

DynamoDB

Post by TheCatt »

(Also, Aurora isn't truly serverless, and only scales down to 0.5 units, iirc, for Aurora 2)
It's not me, it's someone else.
User avatar
Cakedaddy
Posts: 9278
Joined: Thu May 20, 2004 6:52 pm

DynamoDB

Post by Cakedaddy »

Going through their price calculator:

serverless v2 I can get down to .5 ACUs (What's an ACU?)
No RDS Proxy - What is it, and do I need it?
Storage - IO rate - Measured in units per second. What is the IO, and how is it measured?
Guessing that 80GB is how much drive space my DB needs. Current DB is about 300MB (mostly PDF documents), so 80GB would be HUGE.
Guessing IO rate is the number of DB query requests being made per second. Any given page could have between 1 and 5 queries being ran returning 1-50 records.
I have it set to 3 per second baseline and 9 peak.

With this configuration, it's estimating my costs to be $53.80 per month. This being acceptable depends on what I can do with this.

If I drop my storage down to a more realistic 2GB (still 6 times more than I'm currently using), I save $6. The DB instance comes in at $44 and is the cheapest combo I can come up with.
thibodeaux
Posts: 8120
Joined: Thu May 20, 2004 7:32 pm

DynamoDB

Post by thibodeaux »

https://www.amazonaws.cn/en/rds/proxy/faqs/
"enables your applications to: 1) improve scalability by pooling and sharing database connections; 2) improve availability by reducing database failover times by up to 66% and preserving application connections during failovers; and 3) improve security by optionally enforcing Amazon IAM authentication to databases and securely storing credentials in Amazon Secrets Manager."

Prob don't need for now.

ACU is a "capacity unit" which is of course not obvious what it really means. But it's basically how "big" is the underlying server.

TBH if you are using postgresql, maybe try out the t4 micro like I mentioned and see if that will do the job.
User avatar
Cakedaddy
Posts: 9278
Joined: Thu May 20, 2004 6:52 pm

DynamoDB

Post by Cakedaddy »

thibodeaux wrote: Thu Nov 14, 2024 5:55 pm TBH if you are using postgresql, maybe try out the t4 micro like I mentioned and see if that will do the job.
Now you're talkin'. Guessing my way through the options:

Single DB instance
Self managing password
Burstable classes (includes t classes)
db.t4g.micro
General Purpose SSD (gp2)
20GiB Allocated Storage (smallest option)
Storage Autoscaling is off
Don't connect to an EC2 compute resource (I thought I might connect it to my current EC2 instance, but it didn't list it as an option)
Default VPC (vpc-xxxxxxxxxxxxxxx) - Or I could create one, but no idea what it is. . .
Public Access - No (don't need a public IP address, I wouldn't think. I'm assuming AWS pieces will be able to talk to each other)
VPC Security group - Default
Availability Zone - No preference
RDS Proxy - No
Certificate authority - Default
Performance insights Off

Monthly cost - $14
Estimate does not include costs for backup storage, IOs (if applicable), or data transfer.

I don't need backup storage yet, do I need IOs? How is data transfer measured/billed? However, based on the previous price estimates, the storage IO was a pretty small portion of the overall bill, assuming my IO estimate were accurate.
I can get 1 year free. So I could go bigger for no additional cost. But at the same time, I'd like to try to find out what my minimum is, so I'm not over buying after the free year.

Based on what little you know about my project, does it look like I'm answering the config questions correctly?
TheCatt
Site Admin
Posts: 57511
Joined: Thu May 20, 2004 11:15 pm
Location: Cary, NC

DynamoDB

Post by TheCatt »

Cakedaddy wrote: Thu Nov 14, 2024 7:52 pm General Purpose SSD (gp2)
Never use gp2 for anything. Use gp3.
You should stick it in the same AZ as your existing EC2 instance, there is no reason to go across AZs for your deployment.
Cakedaddy wrote: Thu Nov 14, 2024 7:52 pmdo I need IOs?
If you use GP3, you will have enough IO.
It's not me, it's someone else.
thibodeaux
Posts: 8120
Joined: Thu May 20, 2004 7:32 pm

DynamoDB

Post by thibodeaux »

Don't connect to an EC2 compute resource: not 100% sure what this means unfortunately
Default VPC (vpc-xxxxxxxxxxxxxxx) - yeah
Public Access - No (don't need a public IP address, I wouldn't think. I'm assuming AWS pieces will be able to talk to each other)
Mostly true; you do not need a public ip but you will need to make sure the security group for the db and the security group for your ec2 instance have rules that let them talk (basically: allow traffic on the correct port, inbound on db, outbound on ec2)
VPC Security group - Default: probably but might need edits, see above
thibodeaux
Posts: 8120
Joined: Thu May 20, 2004 7:32 pm

DynamoDB

Post by thibodeaux »

"How is data transfer measured/billed": data transfer within an AZ is free (see Catt's note above). Data INTO AWS is usually free. You're gonna pay for a monthly fee for storage built into the price of the DB. So data out from your web server (the ec2 instance) will be your concern, and you can see that as a metric in cloudwatch (also in the ec2 console when you click on the instance).

There's a lot you can do with billing reports and analytics and even alerts, which is probably worth getting familiar with.
Post Reply