Modern database workflows with GitHub, Vercel, Netlify, and Xata

alexfrancoeur

AlexF

Posted on May 17, 2023

Modern database workflows with GitHub, Vercel, Netlify, and Xata

We’re excited to announce a brand new workflow for developing with databases and preview deployments! With todays announcement, Xata is releasing an application for GitHub, an integration for Vercel, an integration for Netlify, git-like commands for our CLI and preview branches. The combination of these features create the ideal workflow for modern application development.

The X is for extended

Before we dive in, let’s quickly recap what Xata is. The X in Xata stands for extended, as in an extended database. Xata was founded with the goal to go beyond a serverless database offering and provide a single service that handles all of your data needs. We know management of multiple services and data synchronization between them is hard. Xata takes care of all of that for you.

In support of that goal, it is our mission to radically simplify how developers work with data. The Xata platform includes a relational database, a search and analytics engine, a vector database, and AI capabilities. All of these features are built on industry best practices, ensuring a reliable and scalable solution that can be accessed through a RESTful API and type-safe SDKs.

While we plan to continue to invest in new types of data stores for our multi-model data platform, today’s announcement is focused on our new workflow and improvements to the developer experience when working with your data.

Previews will replace pre-production environments

There is one thing that every engineering team, in companies big or small, has in common: pre-production environments. Dev, QA, staging, or whatever code name you’ve landed on — there typically is an environment for daily builds and another with all the feature flagged turned on. This is a great way to build and collaborate with your team, but comes with its own set of downsides. Not only are these environments another piece of infrastructure to manage, if they go down, they impact tens, hundreds, or even thousands of developers shipping code.

In the last few years with innovations from companies like Vercel and Netlify, preview deployments of your application have empowered the individual developer to ship fast and collaborate with their team before pushing to production. Over time, we expect this workflow to negate the need for pre-production environments entirely. Until very recently, there has been a gap in this workflow at the data layer.

Introducing preview branches

As scalability and availability in the cloud become solved problems, focus is now turning towards user and developer experience. A number of solutions (Xata included) have began introducing git-like branching to your database. Making it easy to diverge from your main database and merge any changes back in. This workflow is very similar to the git, a version control system nearly every developer is familiar with.

With preview branches now available in Xata, every pull request will be paired with a preview-{owner}-{branch_name} branch of your database. The data from your main database will be copied over. This unlocks a new way to work and has a number of benefits:

  • Safely iterate on your application with production data knowing you won’t impact your production environment and end users.
  • Freely modify schema and code changes alongside your application in an isolated preview environment.
  • Obfuscate sensitive data and PII for individual developers who do not have the appropriate permissions (this is coming soon).

While these advantages are great, they are only useful if you can actually use them. Which is why the team at Xata focused heavily on a developer experience optimized for efficiency and security.

A database that meets you where you are, in git and GitHub

A diagram representing the end-to-end developer workflow

With this release, Xata is the first solution to complete the end-to-end developer workflow for a database.

  • Schema and migrations exist as code in git, where they are stored as files in your repository and can be reviewed like any other code change.
  • A new preview database branch is created automatically for each pull request and copies the data from the main branch.
  • When a pull request is opened and on every push to the branch, a comment in GitHub provides the current status and any failures that occur are shared in a new comment.
  • When the pull request is merged in GitHub, Xata simultaneously merges the database branch to the main database branch.
  • If there are migration failures detected, Xata will block the promotion of the build to avoid breaking the application until the failures are resolved.

In order to take advantage of this new workflow, you’ll need to install the Xata App for GitHub.

A screenshot of the in-app Xata integrations view

Once you have successfully installed the GitHub app, you can connect your database to a GitHub repository.

A screenshot of a list of GitHub repositories in Xata

After you’ve paired your GitHub repository with your Xata database, working with preview branches is only a few commands away.

git checkout -b review_stars
xata branch create review_stars
xata pull review_stars
git add .
git commit -m 'add rating column to db and stars'
git push --set-upstream origin review_stars
Enter fullscreen mode Exit fullscreen mode

xata branch, xata pull , git commit and git push will automatically create a preview branch with data from your production database for your new pull request.

A screenshot of GitHub and Xata representing preview branches

Each pull request will have a comment with the latest status of your preview branch. If you’re not making changes to the database, you can confidently build without impacting your end users. If you are making changes to the database, the pull request will be blocked from merging until all checks have passed ensuring a seamless migration.

Completing the preview deployment with Vercel and Netlify

Similar to GitHub, Xata is also releasing an integration for both Vercel and Netlify. Integrating with either of these platforms will result in a Xata preview branch paired with each preview deployment.

For more details on how to get these set up, check out our documentation.

A screenshot of Vercel & Netlify integrations in GitHub

While we’ve decided to focus on these two platforms first, we have all the foundational pieces in place to create integrations for other preview deployment platforms. Have one in mind? Drop a feature request here.

A new way to build

At Xata, we are empowering a new age of developers to build more advanced applications without needing to think about the data layer. We are excited about what this new workflow unlocks and the capabilities we plan to build on top of it. You can view our publicly available roadmap to see what’s on the horizon and come chat with us on Discord if you have any questions.

If you’re interested in using this new workflow for your next project, sign up today to take advantage of our production ready-free tier (no credit card required). For those that are already using Xata, simply update your SDK and CLI to the latest version to take advantage of this new workflow. Our documentation is the best place to get set up.

We can’t wait to see what you build 🦋

💖 💪 🙅 🚩
alexfrancoeur
AlexF

Posted on May 17, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related