Using Amazon’s Web Services SDK Inside SQL Anywhere
One of my colleagues, Joyce Liu, recently posted a document that explains how to create a stored procedure that automatically copies a database backup to Amazon S3. If you haven’t seen this document, here’s its URL: http://scn.sap.com/docs/DOC-55978.
Cloud computing is a hot topic these days and that was part of the motivation into writing the document. You can always write a batch file that uploads any file to Amazon S3, but our approach allowed us to write that logic inside the database, as well as taking advantage of Maintenance Plans to simplify the entire backup process.
The other reason behind writing that document is to highlight SQL Anywhere’s external runtime environment. It allows developers to execute code outside the database server, provided that code is written in a supported external environment programming language (.NET, Java, PHP, Perl or C/C++). That code is executed by a SQL stored procedure or function, providing a lot of versatility in the type of applications you can implement. In Joyce’s backup document, she was able to re-use an existing Amazon Web Services SDK assembly to create a small C# library that SQL Anywhere can call.
Take a look at that document and see if you can come up with other examples that take advantage of this feature. Feel free to post your ideas in the comments section below!