Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show role when choosing database #54

Open
slootjes opened this issue Apr 9, 2024 · 3 comments
Open

Show role when choosing database #54

slootjes opened this issue Apr 9, 2024 · 3 comments

Comments

@slootjes
Copy link
Contributor

slootjes commented Apr 9, 2024

When using Port 7777 on an RDS cluster with multiple instances the output looks something like this:

Listing databases.
Which database would you like to connect to?

[1] some-service-databaseinstance1-azznqqajdhkm
[2] some-service-databaseinstance2-cqtwprntcl09

but based on this names I don't know which of the 2 is a reader or a writer. When making changes I obviously need a writer and while just doing some queries I prefer using a reader instance. Currently I always need to login to AWS to see which one I need. It would be very nice to see the role of the instance in this selection, perhaps like this:

Listing databases.
Which database would you like to connect to?

[1] some-service-databaseinstance1-azznoqajd0km (Writer instance)
[2] some-service-databaseinstance2-cqtwprbtdl09 (Reader instance)

While writing this, maybe also add the instance size to it as well:

Listing databases.
Which database would you like to connect to?

[1] some-service-databaseinstance1-azznoqajd0km (Writer instance / Serverless v2 (0.5 - 16 ACUs))
[2] some-service-databaseinstance2-cqtwprbtdl09 (Reader instance / tg4.medium)

What do you think?

@mnapoli
Copy link
Member

mnapoli commented Apr 9, 2024

Sounds like a great improvement idea, thanks for opening this. Naive question: is the reader/writer status exposed via the RDS API?

In any case I'm taking note of the idea (no promise on an implementation date ^^)

@slootjes
Copy link
Contributor Author

The information is returned in the describe db clusters API endpoint which is already used as far as I know by this app, this is the relevant output for my cluster:

<DBClusterMembers>
	<DBClusterMember>
		<DBInstanceIdentifier>some-service-databaseinstance1-azznoqajd0km</DBInstanceIdentifier>
		<DBClusterParameterGroupStatus>in-sync</DBClusterParameterGroupStatus>
		<PromotionTier>1</PromotionTier>
		<IsClusterWriter>true</IsClusterWriter>
	</DBClusterMember>
	<DBClusterMember>
		<DBInstanceIdentifier>some-service-databaseinstance2-cqtwprbtdl09</DBInstanceIdentifier>
		<DBClusterParameterGroupStatus>in-sync</DBClusterParameterGroupStatus>
		<PromotionTier>1</PromotionTier>
		<IsClusterWriter>false</IsClusterWriter>
	</DBClusterMember>
</DBClusterMembers>

The "IsClusterWriter" returns the relevant information if it's read/write or read only.

The instance type is available in the Describe Db Instances API call:

<DBInstanceClass>db.serverless</DBInstanceClass>

Maybe returning it as a table would be prettier even when adding more information.

@slootjes
Copy link
Contributor Author

slootjes commented Sep 4, 2024

Any update on this by any chance? The same thing applies for Elasticache:

Which Elasticache instance would you like to connect to?

[1] blr12bzer1fbecf1-001
[2] blr12bzer1fbecf1-002
[3] blrhen961d1ou3l-001
[4] blrhen961d1ou3l-002

Here it doesn't even show the name, only the identifier given by AWS. The same information would be useful here, especially the description and role (primary/replica).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants