1

I've been looking into Spring-Cloud-Function and Spring-Cloud-AWS recently and all of the capabilities that the Spring modules provide, however, one thing I'm not too clear on is really whether the two properly go together.

I can see Spring Cloud function and maybe S3 being used together but there is no support for AWS' serverless DB, DynamoDB.

Would it be good or bad practice to use Spring Cloud Function (AWS Lambda) with RDS? Is the fact that DynamoDB is a non-blocking DBS a better fit for Lambda's and their billing structure?

asked Apr 11, 2018 at 17:27

2 Answers 2

1

I have created a sample Spring Cloud Function for AWS Lambda on my github. It uses AWS Java SDK to request for S3 objects. I have also written another sample with integration with AWS SQS.

So, I think it will be easy to integrate with DynamoDB as there is also Java sdk available for DynamoDb (although I have not personally used it before)

IMHO, I think because AWS Lambda charges by execution time, and initiating the connection to the RDS might also take up some time (same for shutting down).

Besides that, for scaling purposes, if your Lambda function was triggered in high frequency within a short period. Each of the lambda function will try to establish sql connection to the RDS and might eventually cause an overhead to the RDS.

What I did for my project is that I exposed an API endpoint on the web application and direct the traffic from lambda to the endpoint. Since SQL connection can be reused within the web app, I guess it is more efficient.

Ps. I have yet to use DynamoDB. So I cant comment much on that.

answered Apr 27, 2018 at 17:37
Sign up to request clarification or add additional context in comments.

Comments

1

I would say Spring Cloud Function with the Spring eco system behind is a good basis for accessing DynamoDB from a Lambda function.

There is a community-supported Spring Data module for DynamoDB.

You might have a look at my article, where I'm using Spring Cloud Function with Spring Data DynamoDB.

answered Jan 13, 2019 at 19:44

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.