-
Notifications
You must be signed in to change notification settings - Fork 7
Support PostgreSQL #10
Comments
This is very interesting. Currently the docs for the RDS Proxy preview include the points:
Meaning, RDS Proxy is not really a viable option for people who won't/can't convert from PostgreSQL (or won't be for some time). Right now, this gem is the closest thing I have come across for Rails -> RDS Serverless PSQL ... |
So for "RDS Proxy" this gem would be moot right? My understanding is that it uses the same mysql/pg clients and protocols. Is that incorrect? I've not dug too deep on it quite yet. |
I believe that is their plan, but there is no timeline up yet that I could find.
It let us use the default postgresql AR adapter at the cost of slightly more AWS moving parts. For those who find their way here before RDS Proxy is available for their use case... So, this approach to connect from an external ActiveRecord AbstractAdapter is to make an EC2 instance (or autoscaling group of them) and a security group that opens only one TCP port and has best practice keys/certs. Then use that bastion/jump-box to tunnel through. It takes some fiddling with the dashboards so I'm thinking to write up a gist when I get the time... |
Whoa, that's some absolute, next level, righteous hacks! |
Hey @Genkilabs I started using RDS Serverless PostgreSQL from Lambda and ran into an issue where some queries would hang. I thought it was Sequel (stripped down our Lambda function from using Rails), but it might seem it's the I had hoped to try the RDS proxy or Data API, but your research above was informative about the former... leaving the latter as an alternative to Did you ever run into behavior where queries hung? If not, maybe it's related to Lambda and maybe how it access RDS Serverless over the network. I haven't found others reporting this issue, so I'm hoping to narrow it down to a configuration issue. Thanks. |
@joelvh Sorry for the radio silence. In our case we needed to be able to browse and modify the DB with existing, 3rd party tools as well as our code. The Data API is all well and good if you are ok with writing software to connect to it, but if you have a need for an existing toolkit to also touch your DB then it is (or was at the time we reviewed it) a non-starter. As far as Lambda goes, our end user connections (the high traffic ones) to Serverless all go through AppSync. This lets us scale and connect to the serverless data source directly, as a first class citizen, rather than proxied through a runtime. Between the Resolvers and Functions, we were able to create individual graph queries composed form a highly relational DB design including self-referential tables, and polymorphic models, and thereby avoid Lambda altogether. If you can figure out how to limit Lambda usage to only data/queries that you absolutely must have complicated runtime operations on, it's a good move IMO. ie the pattern we chose for this project was: |
I'd like to point out that now Lambda Containers is out, the use of this gem is really only driven by how small of a DB you need. If you are using Aurora proper, you can connect to MySQL or PG using gems (and libs) bundled in a container. If you use MySQL, I make that easy by avoid sys deps (https://github.com/customink/mysql2-lambda) but this is not required. You can always |
FORWARD: I'm not sure this work is worth it given RDS proxy is in preview. https://aws.amazon.com/about-aws/whats-new/2019/12/amazon-rds-proxy-available-in-preview/ However, if someone does want to push on this work, here are some thoughts since Aurora Serverless does support PostgreSQL.
During our initial work (#6) we did leave a good module & client structure in place so that we could mixing PostgreSQL client hacks as needed. My biggest question is, how would we handle loading, move the requires to the core ConnectionHandler?
The text was updated successfully, but these errors were encountered: