Discover how Directus Realtime keeps your application data up-to-date instantly, enabling realtime features like multi-user chat, live updates, and time-sensitive data transfers through WebSocket connections and flexible subscription options.
Speaker 0: Directus real time can be used anytime you need to ensure data is always up to date in your application. Common use cases include building multi user chat, audience participation, and any time sensitive data transfer like auction value, stock prices and sports scores. Unlike many real time platform providers, directus emits events once changes happen in your collections. This means that you can always trust that the latest version of your data is persisted and retrievable without needing to implement your own storage logic. You can connect using a standard WebSocket connection, using GraphQL subscriptions or by using the directives Javascript SDK.
You can begin any number of subscriptions over your real time connection with directives. Subscriptions are made on a collection level and will by default receive messages whenever an item is created, updated, or deleted. You can specify a subscription to only receive events on specific operations and optionally provide a unique identifier, which will be returned in all messages related to the subscription, which is really useful if you have multiple of them and need to track where data needs to be processed in your application. You can also execute actions over a real time connection, so you can create, read, update, and delete data without needing to make a separate HTTP request. This can be useful when for example, building a chat where the current user must both subscribe to new messages and be able to submit their own.
With directors real time, you can do that all over a single authenticated connection. Check out our documentation for tutorials on implementing directus real time in your applications. Or check out our directus tv show, make it real time for a set of project based tutorials, which actually have you building real projects with real time. As always, hope you found this interesting, and we'll see you in the next video.