Reputation: 231
I do have a requirement where I need to copy data from one table of Oracle to another table on daily basis. Currently, I am fetching data from the database and writing them to Excel file through java code. So I have a list of POJO
ready with me to insert. But I am open to an approach where I can directly dump data from my Oracle
table to the second table(again I am open to the appropriate database for this like Oracle
or Amazon dynamoDB
etc). Below are the approaches I could think of. I still am searching for different approaches, I will update the post accordingly.
1) The naive approach is to just fire insert queries from java code it self. Yeah, I am using hibernate
so it I can do it little easier.
2) Second I thought about using Amazon Lambda
. I have not read about it completely, I just have a basic idea of it. But I am opening this question because I am novice and I want to select an efficient approach for this.
Will you please throw some light on my approaches or suggest a completely different one?
Upvotes: 0
Views: 1244
Reputation: 1201
Best approach is to trigger a lambda function using cloudwatch on daily basis which can copy the data from one table to another in oracle or from oracle to dynamodb. No need of S3 or API gateway which is more complex and will cost you more.
Upvotes: 0
Reputation: 8541
As Lambda has different triggers you can use one of those to load the excel. One solution would be setup an API through API gateway which triggers Lambda. Call API gateway with serialised data of excel, which in turn call Lambda and deserialise data in Lambda and save it to DynamoDB. Another solution is S3 which you have mentioned in comments
Upvotes: 1