populating database outside of applicaiton

You can use a background process that runs independently of your web
listeners. You can use something like Background DRB or some other
background daemon. From there you can call any of your methods in your
application to populate the appropriate tables.