AMI or otherwise

I am new to Asterisk and looking to develop a web/telephony application.

I would like to setup and inbound IVR type service where users can securely log into a website and update their individual IVR responses.

I can see that this could be implemented by having the website store the user prefs in a db then have the dialplan access the db via AGI or similar and perform a custom handling of the call.

I would expect for performance reasons to located the db on the asterisk box and not the webserver?

Is this the best way to achieve integration between a website and an asterisk box or should I somehow be integrating the AMI ?

Thanks in advanceā€¦

Using an AGI script that reads from a database is totally fine. If you wanted to keep all business logic on one server (read: web app + phone app) you could use FastAGI scripting which would allow you to host your AGI application on the web server.

If your database, webserver, and FastAGI server were all on one machine, you would free up a lot of resources for asterisk.