Skip to content

wix/velo-external-db

Repository files navigation

CI

Wix Velo External Database Adaptor

Overview

Velo by Wix is a development platform built on top of Wix, adding a built-in database and node.js backend. The built-in database is a document based database optimized for websites and content. Depending on the specific workload, it can support 10K - 100K records, and for some workloads even more. It is globally replicated, has native support for PII encryption, GDPR, and other non-functional features. It runs on shared infrastructure and is fully managed by Wix.

However, requirements for data locality, regulations, data ownership, dedicated infrastructure, or workloads that demand specific engines may require an external database. This adaptor enables connecting external database engines to your site.

Velo lets you connect an “external database” and map the structures of the underlying tables as wix-data collections. Once connected, you can work with the database and it’s collections in your site just as you would with the built-in database.

You can use wix-data APIs, display data from an external database collection in Wix Editor elements, use the data to create dynamic pages, and connect it to user input elements.

This project is a reference implementation of the wix-data SPI, allowing the development or extension of alternative external database adaptors, to connect Velo with external databases.

For a detailed guide to installing and integrating this adaptor on Google Cloud Platform, see the Integrate Your Google Cloud MySQL or Postgres Database with Your Velo Site article. If you are deploying to AWS, please follow the Integrate Your AWS RDS Database with Your Velo Site tutorial.

Architecture

The external database adaptor is a Node.js server that implements the wix-data SPI. The server communicates with the database using the database's native protocol. It then translates the data into wix-data format and communicates with the Wix site via the wix-data SPI. Architecture diagram

The Wix-Data SPI is a REST over HTTPS protocol in which the Wix site forwards database operations to the adaptor (1), which translates them to native DB operations (2). The adaptor calls the external database (3), gets the response (4), translates the response back to the wix-data protocol (5), and responds to the SPI request (6).

Deployment Considerations

Wix maintains a pre-built Docker container image that is ready to be deployed. Your should run the container as close as possible to a database to minimize the latency of the native DB protocol traffic between the adaptor and the database. Additionally, some databases require persistent connections and are not suited to HTTP. Security and firewall configurations between the adaptor and database should also be considered.

It is important to note the location of the deployed environment. The Wix infrastructure has a global presence, and site data is replicated worldwide to give your site visitors the best performance. Where the database is managed externally, it is important to set up the adaptor and the database in the correct region for optimal performance.

Supported Databases and Limitations

The following lists the databases supported by the adaptor:

Public Cloud Platforms

The adaptor is a Docker container image, It is supported by any cloud environment that supports Docker containers. This includes: