• Loading Your Data
  • Collections
  • Collection Aliases

Collection Aliases

A collection alias references a collection. By using collection aliases, you can use the alias name in your queries in place of the actual collection name. Additionally, you can switch the alias to a different collection at any time without any downtime for your queries.

#Why Collection Aliases?

Collection aliases are useful for versioning your data during bulk refresh of a collection without any unavailability. For instance, you can create a new collection for every bulk refresh, and then switch the alias to reference the latest collection without any downtime for your queries. In case of any issues during bulk refresh, you can always switch the alias back to the previous collection.

#Creating Collection Aliases

You can create an alias using the Rockset API or in the Collections tab of the Rockset Console.

Aliases

Once created, you can select the alias to view and manage its details. From there, you can view the status of the referenced collection and Query Lambdas, update the collection referenced by this alias, or delete the alias.

Alias Details

Note that after you update the collection referenced by an alias, there will be a minor delay before the switch is completed. However, there will be no downtime for your queries at any point during the switch, and your queries will automatically begin executing on the new collection once the switch is completed.

#Using Collection Aliases

Collection aliases should be treated just like any normal collection in your SQL queries. Like collections, each collection alias exists in a workspace, and can be queried by joining its workspace and name using a . in your SQL queries.

For instance, you might write the following query for a collection alias named tweets in the workspace social:

SELECT
    *
FROM
    social.tweets;

For additional details on how to write and execute queries on collections, seeing the Querying Collections documentation.

Join us on Slack!
Building on Rockset? Come chat with us!