Discover how CloudKit Console can help you better interact with your containers. We'll show you how to put the database app to work and define, modify, and deploy schema changes with confidence. You'll learn how to craft queries in the query builder and filter your records with ease. And we'll explore how to use telemetry and log data to gain new insights into your app behavior over time.
To get the most out of this session, we recommend being familiar with CloudKit and its development and production environments, as well as a basic understanding of record and data types.
♪ Bass music playing ♪ ♪ Nikhil Palekar: Hi, I’m Nikhil, and I’m an engineer on the CloudKit team. Today, I’m excited to introduce you to CloudKit Console. iCloud is an incredibly powerful service for expanding the capability of your users’ devices to the cloud. Millions of people use iCloud to store their photos, files, and data securely. CloudKit, the database behind iCloud, can efficiently and seamlessly synchronize content across devices for a magical experience. And being cloud-based, CloudKit services are managed online through developer.apple.com. Today, I’m excited to show you CloudKit Console, a redesigned set of dashboard tools that help you manage how your applications interact with CloudKit services. In the Console, you can access and manage CloudKit database and view telemetry and logs in a fresh new interface that makes it easier than ever to get things done. Throughout the Console, the content follows the same familiar structure that you're used to with other Apple applications: context and account information on the top, navigation and properties on the left, and details in the middle. From this new layout, you can easily select a feature, then dive deeper into the details. Let’s start by looking at a few features in the new Database app. In case you're new to CloudKit database, the short story is that CloudKit databases exist within a container defined for your use case, and developers use two database environments: development and production. Database schemas are promoted from development to production once the app developer is comfortable with the changes they made during development. As you’re getting started, you can iterate quickly on development databases using just-in-time schema creation or by defining your data model in the Console. When you're ready, you can deploy the schema to production and CloudKit will verify the integrity of the updates to avoid breaking older clients of your database. As I launch the Database app, I can see a list of containers owned by my developer team. The next time I launch the Console, it will bring me straight to the last container I visited. I’ve selected the Development environment in the dropdown, and now let’s look at the Schema section to explore how record types are defined. Record types are used to define data structures in CloudKit database. I can quickly view the list of existing record types, and then click to see details on the fields and indexes. Adding a field is simple. I just provide a name for my new field, and choose its corresponding type.
Managing indexes in the Console is also straightforward. From this page, I can easily view the existing indexes, or click to create a new index by selecting a field and choosing one of the three index types. Here, I’m adding a sortable index to alphabetically sort the author field. And while I’m managing the schema, let's take a quick look at how security roles are managed for the public database. If you've used CloudKit before, you may already be using security roles to manage access to records in your public database. And now there's a new UI that makes them easier than ever to define and manage.
Now that I have a schema defined for my app, let’s use the Console to explore some data that I’ve stored during development. From this view, I can either create or view records. The new UI presents a left-to-right flow for selecting context of how I want to retrieve records for display, starting with the database, then the zone, and finally the record type.
Once I set the context, I can see records in the list view and see their details in the detail view. If I need to refine the request, I can use the new query builder to apply filters so I can get to the exact records I want. So let’s say that I’m building a feature for my app that writes a new record type into CloudKit, and I want to verify what CloudKit actually receives in the development environment. With the new UI, I can simply set up the query once, save it... ...and then come back to it again as my development moves forward.
The URLs used throughout the Console are also structured to point directly to specific features. So for example, if I want to have fast access to the record view, I can just add that direct link to my Safari bookmarks. With the new Console, managing your data and schema is quick and intuitive, with a familiar user experience across each feature. Now that I’ve created a schema and confirmed that I have the right data stored in development, I’m ready to deploy the schema to the production environment. Earlier, I mentioned the difference between development and production, so let me show you how the Console makes it easier and safer to deploy a schema to production. Clicking "Deploy Schema Changes" brings me to a clean, actionable view of the changes that will be applied to my production deployment. Here, I can see everything that’s changed between my previous production schema and the changes that would be applied from the development environment. Since production changes cannot be reversed, this diff view gives me a quick way to confirm that only my intended changes end up in the production environment. That’s it for the features in the new Database app, so now let’s take a look at Telemetry. After setting up the database and promoting my schema to production, I’m moving to the next part of the developer lifecycle where I can observe and investigate how my app is interacting with CloudKit. The Telemetry app within the Console gives me a number of charts that show key metrics about how my app is interacting with the database. Request rate, server latency, error count, and average request size are all shown in filterable charts that help me find the data I need. These charts can help me identify when my app behavior changes over time and give me a signal about whether a new version of my app is behaving in unexpected ways. Now let’s take a look at the Logs app. The Logs app within the Console lets me dive even deeper. It shows detailed logging output from CloudKit Database so I can see how my app requests have actually been processed. This app is a great tool for debugging and investigations, both during development and in production. We think you’re going to love using CloudKit Console as you’re developing and shipping your apps. I hope you’ll spend some time trying the new schema management and querying capabilities in the Database app and review the new instrumentation in the Logs and Telemetry apps that give you actionable information about how you’re using CloudKit. We’re also excited to have brand-new documentation at developer.apple.com as well as helpful sample projects on GitHub. Finally, if you’re interested in learning about new CloudKit features, please review the "Explore CloudKit" collection. Thanks for your time today. I hope you enjoyed meeting CloudKit Console. ♪
Looking for something specific? Enter a topic above and jump straight to the good stuff.
An error occurred when submitting your query. Please check your Internet connection and try again.