Wednesday, October 27, 2021

[SOLVED] How to periodically update a database programmatically

Issue

I'm a noobie working on a project for learning, and I am stuck at figuring out how to move forward.

The idea is that I want to write something that I can run on say an AWS EC2, or Elastic Beanstalk, or something -- that will periodically do some calculations (let's say daily), and then add those results into a database.

Which technologies should I use? Are there good examples anybody could link that I could look at, or resources I could read

I know this is a really abstract question but I am just having trouble getting started. With my current knowledge, I was going to just run a python script on my current EC2 (that will just run forever) that will just have a timer that will call the function to do the calculations and then insert into the database; however I don't know much so I fear there are better ways of implementing this.

I also didn't know which tags to use, could anybody recommend what I'm looking for?


Solution

Look into AWS Pipeline. Instead of running your server 24x7, they can spin it up for you, run your script, then shut it down. Pipeline will be a bit harder to debug, so you should test your script on a regular EC2 instance first.

(In fact, you should develop it with local Python and a local DB if you want to save money during development time. Ec2 boxes are just regular Linux boxes.)

Which technologies should I use?

This is the wrong site for those types of questions, there are literally 1000's of answers, and there is no "best" technology. Find someone to tutor you, buy some books, or just keep reading up and playing with stuff until you understand.



Answered By - BraveNewCurrency