Aiven for Wix as an external database

Hi, I was wondering if it would be possible to use Aiven as a cloud MySQL hosting platform to connect to a Wix site. Wix has a feature which allows users to connect to an “external database”. Aiven is not one of the defaults listed, and requires a custom adapter. Does Aiven allow this?

Anyone have any info on this possibility?

Hi there, Simon! Here’s what I managed to figure out:

Wix offers a feature called Velo which, among other developer-y things, allows you to integrate data from external databases into your Wix site. The getting started tutorial shows both how to turn on Velo and how to do a simple “hello world” example.

However, note that the “External database integration” feature is only available on Business or Business Elite plans. As a result, I wasn’t able to get this working myself, but here a few pointers:

  • Velo: Adding and Deleting an External Database Collection has instructions on adding an external database to Wix. One of the options there is “Custom” and that’s what you’d use for a provider like Aiven.
  • One of the settings in the following form is “endpoint URL”. This is asking for a URL to an implementation of their external-database-collections SPI. GitHub - wix/velo-external-db is their reference implementation, which is a Docker container that can be deployed to a Cloud host, and supports MySQL + PostgreSQL, among others.
  • You’ll also need to supply a secret key, so you’re not passing along sensitive info like your DB admin username and password over the wire. They have detailed instructions on setting this up for three major Cloud providers: Google Cloud, AWS, and Azure. The part of those instructions you’d need to change is instead of creating the databases directly on the Cloud providers, you’d be pointing them at the MySQL/PostgreSQL/etc. settings from your Aiven.io project.
  • Note that speed is going to be key in a REST-y setup like this, so you’ll want to ensure that your endpoint URL and your Aiven database are hosted in the same Cloud provider + region.
  • Once all of things are wired up properly, you can work with Aiven’s data as a CMS Collection in Wix, and wire it up to, for example, table elements or drop-downs using the Wix Data API.

Since that sounds like… a lot… :sweat_smile: another thing you could do is propose Aiven <> Wix integration to Aiven Ideas. If there are enough other folks out there who are calling for it, it increases the chances our Product team picks it up as a feature to work on, and hopefully take some of the manual work out of this process.

Hope that helps!

1 Like

Thanks! I’ll take a look at this when I get the database issue fixed :sweat_smile: