An early look at SQL in Meteor

Sashko Stubailo
Meteor Blog
Published in
2 min readAug 21, 2015

--

Meteor has made great strides in making it easy to build a modern ‘Connected Client’ app with full-stack JavaScript. One of the design decisions we made to build Meteor was initially only supporting MongoDB as the backing database. This decision has affected all parts of the stack, for example the use of Minimongo on the client.

So while it was obvious that Meteor would eventually need support for other databases, as mentioned in the Meteor roadmap blog post, it was very unclear what that support would look like. We had a lot of internal design discussions and considered many approaches, but at the end of the day there was only one way to find out: build a prototype and try using it.

And that’s what we’ve done: we have a first prototype of support for using PostgreSQL as the database for a Meteor app, while maintaining all of the features that make Meteor so great to use:

  1. Live-updating database queries
  2. The ability to use similar code on the client and the server
  3. Automatic optimistic UI
  4. Synchronous-style APIs enabled by Fibers

We have written down our thoughts and directions for getting started with this preview in a guide, available here: http://meteor-postgres.readthedocs.org/en/latest/

Get Involved

We’d love to hear from you:

  • Give the guide a read through to see what we came up with, and try it out by running the example apps!
  • Then, join the discussion on the forums, and file any issues you encounter on GitHub.

Here is a screenshot of what it looks like to publish some relational queries:

A Shoutout to Slava

It was a joy to work on this project with my amazing coworker Slava Kim, who is moving on from his career at Meteor this fall to study at MIT. Good luck in your adventures, Slava!

--

--

engineer at @stripe. previously open source eng manager at @apollographql and @meteorjs, https://github.com/stubailo