How to build a database integration for your SaaS app and why you need one
While SaaS integrations (like Salesforce, HubSpot, and QuickBooks) are extremely important for any modern B2B SaaS app, many products targeting mid to large enterprises will find that supporting database integrations is not only important, but can give your product a competitive edge.
Why would I need a database integration?
Allowing your customers to connect their databases and data warehouses to your product allows for the ultimate flexibility that customers may need when dealing with large amounts of (usually custom) data. Often, database integrations are used as a way to circumvent the need for a direct integration to whatever legacy or custom CRM, ERP, etc. an enterprise customer may be using.
Typically, enterprise customers have data teams that maintain an internal source of truth of their data in some sort of data warehouse or database – which is why it becomes incredibly important for B2B products that target this segment to connect to databases and data warehouses natively.
How does a database integration work?
A database integration that allows customers to easily connect their database and configure the relevant data can make your onboarding experience a smooth and delightful one. Let’s go through an example of a MySQL integration, though this type of integration flow would work for any database or data warehouse like PostgreSQL, Microsoft SQL, Redshift, Snowflake, and more!
Note: this example is powered by hotglue, an embedded iPaaS that enables you to speed up development of native integrations
Breaking It Down
Let’s break down what we walked through in the demo of the MySQL integration powered by hotglue.
Collect and validate database credentials from the customer
Just like we described in the video, you will need to ask your users to provide their MySQL server details. You can do this out of the box with hotglue using our embeddable widget, as pictured below.
The hotglue widget even has credential validation built in, so users will be notified if they incorrectly entered their credentials in real time. You can learn more about how to embed and customize the widget in the docs.
Select tables and fields to import
Once the user enters their database credentials, hotglue automatically discovers the available tables and fields in their database and prompts the user to select the data they would like to import to your product.
Read the data from the database
hotglue handles syncing data directly from integrations (in this case, MySQL) via sync jobs. Jobs can be scheduled using CRON expressions or triggered ad-hoc via the hotglue API or hotglue widget. With the hotglue widget in the demo above, the data is cloned as soon as the customer clicks “Confirm.”
Pre-process the data (optional)
hotglue includes a preprocessing layer based on Python. You can configure a transformation script that processes the raw data from your users database and customize it on an integration or user level before sending the data to your backend.
This enables you to ensure that the process of ingesting the data your customers provide via your database integration will be a simple, repeatable process! You can learn more about how transformation scripts work in hotglue in the docs.
Save the data to your backend
The last piece to finish off the integration is sending the data to your product. In the above case, hotglue writes the MySQL data we imported into a CSV in an AWS S3 bucket.
hotglue can also move the data into another relational database, like PostgreSQL or even post directly to your API based on your needs.
Conclusion
In conclusion, database integrations like MySQL, PostgreSQL, and Microsoft SQL are an important type of integration to offer for many B2B SaaS apps, especially if targeting the mid-large enterprise market.
Since database integrations are more open-ended than a typical SaaS integration, it’s important to give your customers control and visibility from authenticating with the database to choosing the relevant tables and columns they want to bring into your product.
hotglue makes setting up these types of integrations easy, ensuring your customer has a streamlined and neat workflow to get authenticated, select their data, and see it in your product without tons of engineering work. Additionally, hotglue can support writing data back to your customers’ databases and data warehouses.
If you’re interested in an out-of-the-box database integration that can handle everything from connecting to the database, allowing users to select relevant data, and syncing that data to your backend you can book a demo here to learn more: https://hotglue.com/demo