Customizing the storage
When you use the Forms Portal submit action or enable the Store data in forms portal option in adaptive form, the form data is stored in AEM repository. In a production environment, it is recommended not to store draft or submitted form data in AEM repository. Instead, you must integrate the drafts and submission component with a secure storage like enterprise database to store drafts and submitted forms data.
Forms portal allows you to store data at local AEM repository, remote AEM repository, or to a database. AEM Forms allows you to customize the implementation of storing user data for drafts and submissions. You can override default methods to specify how draft and submissions data is stored at a storage of your choice. For example, you can store the data in a data store currently implemented in your organization.
Forms portal provides out of the box services (APIs) to store data on crx-repository of local and remote AEM Forms publish instances. You can replace the default implementations, described in Configuring storage services for drafts and submissions article, with custom implementations to replace default functionality. For detailed information about the methods required in a custom implementation to store content at a secured location, see Customizing Draft and Submission data services and Custom storage for drafts and submissions component.
AEM Forms documentation provides a Sample for integrating drafts & submissions component with database. You can use the sample implementation to develop your own custom implementation.