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

Feature request a smaller version of this library (no dynamo DB) #897

Open
NikolayMetchev opened this issue Oct 23, 2024 · 3 comments
Open
Labels
enhancement New feature or request

Comments

@NikolayMetchev
Copy link

Right now this library depends on dynamoDb and probably some other items that are not necessary in all cases.
If somebody wishes to use the Java Encryption SDK com.amazonaws:aws-encryption-sdk-java they will automatically bring in a dynamoDb dep along for the ride.
It seems to me that you shouldn't need dynamoDb to use the Encryption SDK.
Any chance we can have a leaner profile for the Java Encryption SDK?

@texastony
Copy link
Contributor

Howdy @NikolayMetchev,

We have entertained such a refactor,
but we are somewhat constrained by our Dafny development
tooling.

Thus, it would be a somewhat expensive refactor on our end,
and probably a breaking change.

The modern AWS SDKs are fairly modular.
Thus, pulling in the DDB dependency should not be significantly more expensive than only depending on the KMS dependency.

Or is your issue that the AWS SDK is required dependency,
regardless if it is KMS or DDB that brings it in?

Is there any more information you can share with us about your use case
that would help us prioritize this feature request?

Right now, the Java release of this library has a "hard", direct, dependency on:

  • KMS (KMS Keyrings) 1.5M
  • DDB (Hierarchy Keyring) 2.7M
  • Bouncy Castle (ASN1 and Epileptic Curve serialization) 7.9M
  • Dafny Runtime 155K
  • Dafny Conversion Library 9.3K

So... for a pretty comprehensive refactor,
we would save you 2.7M.

Is your use case highly sensitive to 2.7M?
Making the KMS dependency optional would directly save you 4.2M,
plus whatever additional dependencies the SDK brings in
(i.e: HTTP client).

@texastony texastony added enhancement New feature or request question Further information is requested labels Oct 24, 2024
@NikolayMetchev
Copy link
Author

Hi @texastony ,
Thank you for the detailed answer.
Our use case is as follows. We are writing AWS Lambda functions using Kotlin and so really want to use the Kotlin AWS SDK as much as possible. Once we realised that we needed the Java Encryption SDK in addition this really bloated the Lambda. Ideally there will be a Kotlin version of the Encryption SDK which I have asked for in addition to this issue.
Right now this isn't a show stopper and as part of the investigating on how I can reduce the bloat I cam across this issue.
I really want to keep our lambda size down because there is a hard limit of 250MB and we already using a lot of that as 3rd party layers.

I failed to appreciate that it might require a large refactor and thought it is worth the ask in case it wasn't too hard to achieve.

@texastony
Copy link
Contributor

@NikolayMetchev ,

This is a very reasonable ask;
the cost of implementing it is abstracted/hidden from you.

Knowing that this is for Kotlin Lambdas is very helpful;
I am grateful for that detail.

ESDK Kotlin Support GHI:
awslabs/aws-sdk-kotlin#1447

It is probably a lower lift to refactor this library to make
DDB (and possibly KMS) optional
than create the tooling to compile the Dafny source code into Kotlin.

Also,
once we do this refactor,
the benefits would be enjoyed by the .NET, Python, and Java ESDKs.

I am leaving this open as feature request.

@texastony texastony removed the question Further information is requested label Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants