winglang / wing

A programming language for the cloud ☁️ A unified programming model, combining infrastructure and runtime code into one language ⚡
https://winglang.io
Other
5.07k stars 198 forks source link

@winglibs/postgres enhancements to support RDS, RDS Proxy and expose connection string for consumption outside wing #5978

Closed ekeren closed 6 months ago

ekeren commented 8 months ago

Use Case

You can now use @winglibs/postgress for your RDS deployments on AWS, this release also include:

This is a breaking change, while previous versions of tf-aws where creating a neon based DB, from now on the default if RDS, in order to override this, please use platform parameters

Proposed Solution

No response

Implementation Notes

No response

Component

Libraries

Community Notes

MarkMcCulloh commented 8 months ago

What about an @winglibs/rds instead? RDS is nice but a lot of wing usage is serverless and AWS's serverless postgres offering is pretty bad. Not to mention the inclusion of a RDS Proxy abstraction will likely make this useful in AWS only.

ekeren commented 8 months ago

What about an @winglibs/rds instead? RDS is nice but a lot of wing usage is serverless and AWS's serverless postgres offering is pretty bad. Not to mention the inclusion of a RDS Proxy abstraction will likely make this useful in AWS only.

I don't have any strong opinion here, questions/issues:

  1. I feels like bring sql; is the right namespace for all these models

    new sql.Postgress(); 
    new sql.MySql();
    new sql.SqlLite();
  2. Isn't RDS proxy a non functional concern?

  3. We will probably need to support both RDS and Aurora

eladb commented 8 months ago

I think this should be bring postgres, because that's the intent of the developer. RDS is a specific implementation of postgres on AWS and theoretically, any Postgres installation should work if that's the surface area we expose.

I don't think we should put all of the SQL databases in the same library...

MarkMcCulloh commented 8 months ago

specific implementation

We have several winglibs that are intentionally (and named with) specific implementations even though they could technically fit as part of a broader abstraction

eladb commented 8 months ago

I think the best way to think about this is what is the surface area we want to expose to the application, and to my understanding the surface area is Postgress (the app uses the postgress client).

So from a developer standpoint, they are saying "I want a postgress database". The platform team can then decide how this postgres database is going to be deployed, and RDS is one of the options.

Chriscbr commented 8 months ago

Are there RDS-specific APIs that the user would want to be able to use in preflight or inflight code? Here's a list I found on AWS's website: https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_Operations.html

If there are any in this list that seem useful for application code, and there are ways to model them in the simulator, then a separate winglib makes more sense. If not, then I'd lean towards packaging it as part of the postgres winglib.

In the latter case, maybe the postgres winglib could add a platform parameter for tf-aws that lets you decide whether you want the implementation to use RDS or Neon.

ekeren commented 8 months ago

Are there RDS-specific APIs that the user would want to be able to use in preflight or inflight code? Here's a list I found on AWS's website: https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_Operations.html

I've asked the designated customer, and they said that they don't use any non postgress API

ekeren commented 8 months ago

In the latter case, maybe the postgres winglib could add a platform parameter for tf-aws that lets you decide whether you want the implementation to use RDS or Neon.

@Chriscbr, this is quite similar to my original proposal beside the fact that I think that RDS should be the default.

Chriscbr commented 8 months ago

Sounds good to me 👍 PRs welcome

staycoolcall911 commented 6 months ago

Completed in https://github.com/winglang/winglibs/pull/219