Project: YugabyteDB (App Definition and Development / Database)
File: chapter5-going-cloud-native.md

title: Offloading operations headerTitle: "Chapter 5: Offloading operations with YugabyteDB Managed" linkTitle: Offloading operations description: Offloading management and maintenance of the database clusters with YugabyteDB Managed, fully managed databases-as-a-service menu: preview_tutorials: identifier: chapter5-offloading-operations parent: tutorials-build-and-learn weight: 6 type: docs YugaPlus - Offloading Operations YugaPlus has become one of the top streaming platforms, with hundreds of millions of people around the world spending countless hours watching their favorite movies, series, and live events. The YugaPlus team has mastered the art of scaling in the cloud, building a service that handles user traffic with low latency across multiple regions and tolerates all sorts of possible outages. However, maintaining such a platform was not a trivial task. The engineering and infrastructure teams were spending a significant portion of their time just to keep the streaming platform running, secure, and up-to-date. Eventually, the YugaPlus team found a way to spend more time on innovation. They transitioned to YugabyteDB Managed, a DBaaS (Database-as-a-Service) that allowed them to offload the management, maintenance, and operations of their database cluster... In this chapter, you'll learn how to do the following: Deploy a free YugabyteDB Managed instance. Connect the application to the YugabyteDB Managed cluster. Prerequisites You need to complete of the tutorial before proceeding to this one. is a fully managed YugabyteDB-as-a-Service that allows you to run YugabyteDB clusters on Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform (GCP). The service offers a free sandbox cluster for everyone wishing to use YugabyteDB in a real cloud environment. Follow these steps to deploy a free YugabyteDB Managed instance: Create a YugabyteDB Managed account: <https://cloud.yugabyte.com/signup> Begin creating the free cluster by clicking on the Create a Free cluster button. Choose the Sandbox cluster option: Select a preferred cloud provider and region (note, Microsoft Azure is available only for paid clusters): Click on the Add Current IP Address button to add the address of your machine (where you run the YugaPlus application) to the IP Allow list: Make sure to download the file with your cluster credentials: Wait while the cluster is being created: Spinning up and configuring your sandbox instance can take up to 5 minutes. During this time, the system is preparing everything you need to get started with your YugabyteDB Managed instance. After the YugabyteDB Managed cluster is started, go ahead and connect the YugaPlus movie recommendations application to it. First, rebuild the YugaPlus backend image to remove one of the database migration files created in the previous chapter: Use `Ctrl+C` or run `{yugaplus-project-dir}/docker-compose stop` to stop the YugaPlus application containers. Rename the `V2creategeopartitioneduserlibrary.sql` file to `skipcreategeopartitioneduser_library.sql` making sure it's not applied during the database migration

The YugabyteDB Managed sandbox instance can't be used for the geo-partitioning use case that explored in chapter 4. ```shell cd {yugaplus-project-dir}/backend/src/main/resources/db/migration/ mv V2creategeopartitioneduserlibrary.sql skipcreategeopartitioneduser_library.sql ``` Navigate to the YugaPlus project dir: ```shell cd {yugaplus-project-dir} ``` Rebuild the Docker images: ```shell docker-compose build ``` Next, start the application connecting to your YugabyteDB Managed cluster: Go to the YugabyteDB Managed Settings tab and copy the public address of your cluster instance: Open the`{yugaplus-project-dir}/docker-compose.yaml` file and update the following settings: ```yaml DBURL=jdbc:yugabytedb://${YOURYBMPUBLICADDRESS}:5433/yugabyte?sslmode=require DBUSER=${YOURYBM_USER} DBPASSWORD=${YOURYBM_PASSWORD} ``` `${YOURYBMPUBLIC_ADDRESS}` - is the public address (host) of your YugabyteDB Managed instance. `${YOURYBMUSER}` and `${YOURYBMPASSWORD}` - your database credentials from the file that you downloaded during the cluster configuration. Start the application: ```shell docker-compose up ``` As soon as the `yugaplus-backend` container starts, it applies the database migration files to your cloud database instance. You can view the created tables in the Tables tab of the YugabyteDB Managed dashboard. {{< note title="Can't connect to YugabyteDB Managed?" >}} If the application fails to connect to YugabyteDB Managed, ensure you've added your IP address to the . {{< /note >}} With the YugaPlus backend operational and successfully connected to your YugabyteDB Managed cluster, do one final search for movie recommendations. Go to the . Ask for movie recommendations: <ul class="nav nav-tabs-alt nav-tabs-yb"> <li> <a href="#full-text-search" class="nav-link active" id="full-text-search-tab" data-toggle="tab" role="tab" aria-controls="full-text-search" aria-selected="true"> <img src="/icons/search.svg" alt="full-text search"> Full-Text Search </a> </li> <li > <a href="#similarity-search" class="nav-link" id="similarity-search-tab" data-toggle="tab" role="tab" aria-controls="similarity-search" aria-selected="false"> <img src="/icons/openai-logomark.svg" alt="vector similarity search"> Vector Similarity Search </a> </li> </ul> <div class="tab-content"> <div id="full-text-search" class="tab-pane fade show active" role="tabpanel" aria-labelledby="full-text-search-tab"> {{% includeMarkdown "includes/chapter5-full-text-search.md" %}} </div> <div id="similarity-search" class="tab-pane fade" role="tabpanel" aria-labelledby="similarity-search-tab"> {{% includeMarkdown "includes/chapter5-similarity-search.md" %}} </div> </div> {{< tip title="Need to troubleshoot slow queries?" >}} And, as one last hint, if it seems that some queries are running slow, navigate to the Performance -> Slow Queries dashboard of YugabyteDB Managed to check if any require optimization. {{< /tip >}} Congratulations! You've completed Chapter 5, the final chapter of the tutorial. Throughout this tutorial, you've learned essential capabilities of YugabyteDB that set you up for the next stage of your development journey. Let's recap! You started with PostgreSQL and then leveraged YugabyteDB's with PostgreSQL by migrating to a distributed YugabyteDB cluster. You learned how to by deploying a multi-region YugabyteDB cluster and using the . You used the latency-optimized to scale both reads and writes across various locations. You learned how to offload the management and operations of your database cluster by migrating to . With that said, good luck building applications that scale and never fail! And don't forget to , where you can get your questions answered and learn about the latest updates from the world of YugabyteDB.