1 00:00:00,000 --> 00:00:05,450 (Music) 2 00:00:05,450 --> 00:00:07,995 Hello and welcome. 3 00:00:07,995 --> 00:00:09,480 This video will cover 4 00:00:09,480 --> 00:00:12,570 the key concepts around databases in the Cloud. 5 00:00:12,570 --> 00:00:14,175 In order to learn SQL, 6 00:00:14,175 --> 00:00:15,870 you first need to have a database 7 00:00:15,870 --> 00:00:18,359 available to practice your SQL queries. 8 00:00:18,359 --> 00:00:21,570 An easy way to do so is to create an instance of 9 00:00:21,570 --> 00:00:23,370 a database in the Cloud and 10 00:00:23,370 --> 00:00:26,265 use it to execute your SQL queries. 11 00:00:26,265 --> 00:00:28,335 After completing this lesson, 12 00:00:28,335 --> 00:00:29,880 you will be able to understand 13 00:00:29,880 --> 00:00:32,715 basic concepts related to Cloud databases, 14 00:00:32,715 --> 00:00:34,800 list a few Cloud databases, 15 00:00:34,800 --> 00:00:37,340 describe database service instances, 16 00:00:37,340 --> 00:00:39,785 as well as demonstrate how to create 17 00:00:39,785 --> 00:00:44,660 a service instance on an IBM Db2 on Cloud. 18 00:00:44,660 --> 00:00:48,020 A Cloud database is a database service 19 00:00:48,020 --> 00:00:51,275 built and accessed through a Cloud platform. 20 00:00:51,275 --> 00:00:53,540 It serves many of the same functions as 21 00:00:53,540 --> 00:00:55,340 traditional databases with 22 00:00:55,340 --> 00:00:58,195 the added flexibility of Cloud computing. 23 00:00:58,195 --> 00:01:00,120 Some advantages of using 24 00:01:00,120 --> 00:01:03,195 Cloud databases include; ease of use, 25 00:01:03,195 --> 00:01:06,380 users can access Cloud databases from virtually 26 00:01:06,380 --> 00:01:09,844 anywhere using a vendor's API or web interface, 27 00:01:09,844 --> 00:01:13,760 or your own applications whether on Cloud or Remote. 28 00:01:13,760 --> 00:01:15,670 Scalability. 29 00:01:15,670 --> 00:01:18,070 Cloud databases can expand 30 00:01:18,070 --> 00:01:20,080 and shrink their storage and compute 31 00:01:20,080 --> 00:01:21,910 capacities during runtime to 32 00:01:21,910 --> 00:01:24,955 accommodate changing needs and usage demands, 33 00:01:24,955 --> 00:01:29,110 so organizations only pay for what they actually use. 34 00:01:29,110 --> 00:01:30,810 Disaster recovery. 35 00:01:30,810 --> 00:01:32,880 In the event of a natural disaster 36 00:01:32,880 --> 00:01:35,275 or equipment failure or power outage, 37 00:01:35,275 --> 00:01:38,590 data is kept secure through backups on Remote Servers 38 00:01:38,590 --> 00:01:42,830 on Cloud in geographically distributed regions. 39 00:01:42,830 --> 00:01:48,490 A few examples of relational databases on Cloud include, 40 00:01:48,490 --> 00:01:50,845 IBM Db2 on Cloud, 41 00:01:50,845 --> 00:01:55,045 databases for PostgreSQL on IBM Cloud, 42 00:01:55,045 --> 00:01:57,500 Oracle Database Cloud Service, 43 00:01:57,500 --> 00:02:00,120 Microsoft Azure SQL Database, 44 00:02:00,120 --> 00:02:03,270 and Amazon Relational Database Services. 45 00:02:03,270 --> 00:02:05,550 These Cloud databases can run in 46 00:02:05,550 --> 00:02:07,945 the Cloud either as a Virtual Machine, 47 00:02:07,945 --> 00:02:09,110 which you can manage, 48 00:02:09,110 --> 00:02:11,360 or delivered as a Managed Service 49 00:02:11,360 --> 00:02:12,910 depending on the vendor. 50 00:02:12,910 --> 00:02:15,665 The database services can either be single 51 00:02:15,665 --> 00:02:19,620 or multi-tenant depending on the service plan. 52 00:02:19,620 --> 00:02:22,715 To run a database in Cloud, 53 00:02:22,715 --> 00:02:25,040 you must first provision an instance of 54 00:02:25,040 --> 00:02:26,390 the database service on 55 00:02:26,390 --> 00:02:28,655 the Cloud platform of your choice. 56 00:02:28,655 --> 00:02:31,655 An instance of a Database-as-a-Service or 57 00:02:31,655 --> 00:02:34,580 DBaaS provides users with 58 00:02:34,580 --> 00:02:37,460 access to database resources in Cloud 59 00:02:37,460 --> 00:02:38,990 without the need for setting 60 00:02:38,990 --> 00:02:40,895 up of the underlying hardware, 61 00:02:40,895 --> 00:02:43,055 installing the database software, 62 00:02:43,055 --> 00:02:45,520 and administering the database. 63 00:02:45,520 --> 00:02:47,570 The database service instance will 64 00:02:47,570 --> 00:02:49,865 hold your data in related tables. 65 00:02:49,865 --> 00:02:53,045 Once your data is loaded into the database instance, 66 00:02:53,045 --> 00:02:55,595 you can connect to the database instance using 67 00:02:55,595 --> 00:02:59,350 a web interface or APIs in your applications. 68 00:02:59,350 --> 00:03:02,090 Once connected, your application can send 69 00:03:02,090 --> 00:03:05,145 SQL queries across to the database instance. 70 00:03:05,145 --> 00:03:06,790 The database instance then 71 00:03:06,790 --> 00:03:09,040 resolves the SQL statements into 72 00:03:09,040 --> 00:03:13,255 operations against the data and objects in the database. 73 00:03:13,255 --> 00:03:15,505 Any data retrieved is returned 74 00:03:15,505 --> 00:03:19,070 to the application as a result set. 75 00:03:19,130 --> 00:03:22,120 Now let's see how a database instance 76 00:03:22,120 --> 00:03:24,805 is created for Db2 on Cloud. 77 00:03:24,805 --> 00:03:27,160 IBM Db2 on Cloud is 78 00:03:27,160 --> 00:03:31,070 a SQL database provisioned for you in the Cloud. 79 00:03:31,070 --> 00:03:33,835 You can use Db2 on Cloud 80 00:03:33,835 --> 00:03:36,595 just as you would use any database software, 81 00:03:36,595 --> 00:03:38,140 but without the overhead and 82 00:03:38,140 --> 00:03:40,240 expensive hardware setup or 83 00:03:40,240 --> 00:03:42,965 software installation and maintenance. 84 00:03:42,965 --> 00:03:45,040 Now let's see how we can set up 85 00:03:45,040 --> 00:03:47,360 a service instance of Bb2. 86 00:03:47,360 --> 00:03:52,160 Navigate to IBM Cloud catalog and select the Db2 service. 87 00:03:52,160 --> 00:03:55,670 Note there are several variations of the Db2 service, 88 00:03:55,670 --> 00:03:59,620 including Db2 Hosted and Db2 Warehouse. 89 00:03:59,620 --> 00:04:01,790 For our purposes, we will choose 90 00:04:01,790 --> 00:04:06,055 the Db2 service which comes with a free lite plan. 91 00:04:06,055 --> 00:04:08,490 Select the lite plan. 92 00:04:08,490 --> 00:04:10,830 If need to, change the defaults. 93 00:04:10,830 --> 00:04:12,965 You can type a service instance name, 94 00:04:12,965 --> 00:04:14,975 choose the region to deploy to, 95 00:04:14,975 --> 00:04:17,150 as well as an org and space for 96 00:04:17,150 --> 00:04:20,195 the service, then click "Create". 97 00:04:20,195 --> 00:04:23,900 You can view the IBM Db2 service that you created by 98 00:04:23,900 --> 00:04:27,830 selecting services from your IBM Cloud dashboard. 99 00:04:27,830 --> 00:04:29,570 From this dashboard, you can 100 00:04:29,570 --> 00:04:31,460 manage your database instance. 101 00:04:31,460 --> 00:04:33,230 For example, you can click on 102 00:04:33,230 --> 00:04:35,480 the "Open Console" button to launch 103 00:04:35,480 --> 00:04:38,045 the Web Console for your database instance. 104 00:04:38,045 --> 00:04:42,170 The Web Console allows you to create tables, load data, 105 00:04:42,170 --> 00:04:44,015 explore data in your tables, 106 00:04:44,015 --> 00:04:46,625 and issue SQL queries. 107 00:04:46,625 --> 00:04:49,070 In order to access your database instance 108 00:04:49,070 --> 00:04:50,495 from your applications, 109 00:04:50,495 --> 00:04:52,825 you will need the service credentials. 110 00:04:52,825 --> 00:04:54,315 For the first time around, 111 00:04:54,315 --> 00:04:57,170 you'll need to create a set of new credentials. 112 00:04:57,170 --> 00:04:59,660 You can also choose to create multiple sets of 113 00:04:59,660 --> 00:05:03,635 credentials for different applications and users. 114 00:05:03,635 --> 00:05:07,055 Once a set of service credentials is created, 115 00:05:07,055 --> 00:05:09,415 you can view it as adjacent snippet. 116 00:05:09,415 --> 00:05:12,020 The credentials include the necessary details 117 00:05:12,020 --> 00:05:14,570 to establish a connection to the database, 118 00:05:14,570 --> 00:05:16,250 and includes the following; 119 00:05:16,250 --> 00:05:18,785 a database name and port number, 120 00:05:18,785 --> 00:05:21,800 a host name, which is the name of the server on 121 00:05:21,800 --> 00:05:24,935 the Cloud on which your database instance resides, 122 00:05:24,935 --> 00:05:27,230 a username, which is the user 123 00:05:27,230 --> 00:05:30,460 ID you'll use to connect along with the password. 124 00:05:30,460 --> 00:05:33,785 Note that your username is also the schema name 125 00:05:33,785 --> 00:05:37,220 in which your tables will be created by default. 126 00:05:37,220 --> 00:05:38,960 Now that you know how to 127 00:05:38,960 --> 00:05:40,970 create a database instance on Cloud, 128 00:05:40,970 --> 00:05:44,360 the next step is to actually go and create one. 129 00:05:44,360 --> 00:05:47,130 Thank you for watching this video. 130 00:05:47,130 --> 00:05:51,000 (Music)