Google Cloud Computing Foundation Course - Week 6 Lecture Notes Summary
1. SQL Managed Services (Lecture 29)
• Definition of Database: • A database is a collection of organized information for easy access and management, often used in software applications for business purposes (e.g., ticket purchases, storing records). • Relational Database Management Systems (RDBMS): • SQL databases (e.g., MySQL, PostgreSQL) are widely used for structured data models, transactional needs, and complex data retrieval. • Common SQL databases allow easy joining of data across tables to create complex queries. • Cloud SQL (GCP's Managed Service): • GCP offers managed SQL databases with automated backups, replication, maintenance, and scalability. • Cloud SQL handles horizontal scaling for reading, while larger databases for writing may require rebuilding. • Cloud Spanner: • A horizontally scalable and strongly consistent relational database with automatic replication across multiple nodes and regions. • It supports ANSI SQL 2011 with extensions and enables the scaling of large, complex databases.
2. Exploring Cloud SQL (Lecture 30)
• Overview of Cloud SQL: • A fully-managed relational database for MySQL, PostgreSQL, and SQL Server. • Ideal for applications like WordPress, CRM, geospatial, and e-commerce. • Performance and Scalability: • Supports scaling up to 64 processor cores and over 400 GB of RAM. • Offers high availability with continuous health checks and automatic failovers. • Data encryption and compliance with global standards are built-in. • Accessibility and Migration: • Cloud SQL instances can be accessed globally and easily integrated with App Engine, Compute Engine, and MySQL Workbench. • Migration tools simplify moving data from on-premise systems to Cloud SQL.
3. Cloud Spanner as a Managed Service (Lecture 31)
• Key Features: • Combines relational database structures with horizontal scalability, eliminating the trade- offs between consistency and scale. • Strong external consistency across regions with minimal downtime (five-nines availability). • Operational Benefits: • Reduces the complexity of database management and operational overhead. • Supports synchronous replication, providing consistent results regardless of geographic location. • Enterprise-Grade Security: • Provides encryption by default (both in-transit and at-rest), granular access management, and audit logging.
4. NoSQL Managed Services (Lecture 32)
• Google’s NoSQL Options: • Cloud Datastore: A document store supporting ACID transactions for fully managed NoSQL solutions. • Cloud Bigtable: A wide-column, petabyte-scale NoSQL database optimized for low- latency writes and high throughput
Questions with Answers
1. Q: What is a database, and how is it typically used in business applications? A: A database is an organized collection of information for easy access and management, used in business applications for tasks like purchasing tickets or storing records. 2. Q: What are the key characteristics of a relational database? A: Relational databases are structured based on the relational model, support SQL, and are ideal for transactional applications requiring complex data retrieval across tables. 3. Q: How does Google Cloud SQL handle horizontal and vertical scaling? A: Cloud SQL scales horizontally using replicas for read operations and vertically by adding resources for write operations, though large-scale writes might require rebuilding. 4. Q: What is Cloud Spanner, and how is it different from other relational databases? A: Cloud Spanner is a managed relational database that combines relational structure with horizontal scalability, offering strong consistency and availability across multiple regions. 5. Q: What are the advantages of using Cloud SQL for database management? A: Cloud SQL automates administrative tasks like backups, replication, patches, and provides high availability, encryption, and scalability. 6. Q: In what types of applications is Cloud SQL most beneficial? A: Cloud SQL is suited for WordPress, CRM, e-commerce, and geospatial applications compatible with MySQL, PostgreSQL, or SQL Server. 7. Q: What security measures are provided by Cloud Spanner? A: Cloud Spanner provides encryption at-rest and in-transit, identity management, and audit logging to ensure enterprise- grade security. 8. Q: Explain how Cloud SQL maintains high availability. A: Cloud SQL continuously checks instance health and automatically fails over to another instance if needed, ensuring high availability (99.95%). 9. Q: How does Cloud Spanner achieve strong consistency across regions? A: Cloud Spanner uses synchronous replication, ensuring data consistency and immediate availability across multiple regions. 10.Q: What are the benefits of using Cloud Spanner over traditional MySQL databases? A: Cloud Spanner scales horizontally, offers strong consistency, and minimizes operational overhead compared to traditional MySQL. 11.Q: Describe the use case for NoSQL databases in Google Cloud. A: NoSQL databases like Cloud Datastore and Cloud Bigtable are ideal for applications requiring scalability, ACID transactions, and low-latency writes. 12.Q: What is Cloud Bigtable, and what type of database model does it use? A: Cloud Bigtable is a petabyte-scale NoSQL wide-column database designed for high throughput and low-latency applications. 13.Q: How does Cloud SQL ensure data security and compliance? A: Cloud SQL encrypts data by default, meets global compliance requirements, and provides features like backup, failover, and health checks. 14.Q: What is the difference between vertical and horizontal scaling in databases? A: Vertical scaling involves increasing resources in a single instance, while horizontal scaling adds multiple instances or servers. 15.Q: How does Google Cloud handle database backups and replication? A: Cloud SQL and Cloud Spanner automatically handle backups and replication, ensuring data redundancy and disaster recovery. 16.Q: What is the significance of ANSI SQL compliance in Cloud Spanner? A: ANSI SQL compliance ensures that Cloud Spanner supports industry-standard SQL queries, enabling developers to use familiar syntax. 17.Q: Why is Cloud Spanner preferred for mission-critical applications? A: Cloud Spanner offers five-nines availability, strong consistency, and the ability to scale globally, making it ideal for mission-critical applications. 18.Q: How does Cloud Datastore differ from Cloud SQL? A: Cloud Datastore is a NoSQL document store designed for unstructured data and scalability, while Cloud SQL is a relational database service. 19.Q: What are ACID transactions, and which Google Cloud services support them? A: ACID (Atomicity, Consistency, Isolation, Durability) transactions are supported by Cloud Datastore and Cloud Spanner, ensuring reliable transaction processing. 20.Q: Explain the role of replication in Google Cloud’s managed databases. A: Replication ensures data is copied across regions or nodes, enhancing availability, fault tolerance, and data redundancy. 21.Q: What is the maximum storage capacity supported by Cloud SQL? A: Cloud SQL supports up to 10 terabytes of storage capacity. 22.Q: How does Cloud SQL handle encryption? A: Cloud SQL automatically encrypts data both at-rest and in-transit. 23.Q: What industries commonly use Cloud Spanner, and why? A: Industries like advertising, finance, and marketing use Cloud Spanner for managing end-user metadata and ensuring global scalability. 24.Q: What performance optimizations are provided by Cloud Bigtable? A: Cloud Bigtable optimizes for extremely low write latency and high throughput, suitable for large-scale analytical workloads. 25.Q: How does Google Cloud ensure disaster recovery for Cloud SQL? A: Disaster recovery is ensured through continuous backups, replication, and automatic failovers. 26.Q: Describe a scenario where Cloud Spanner would be the best solution. A: Cloud Spanner is ideal for globally distributed applications requiring consistent, real-time data access across multiple regions. 27.Q: What is synchronous replication, and which Google Cloud service uses it? A: Synchronous replication ensures real-time data consistency across regions, used by Cloud Spanner. 28.Q: How can Cloud SQL be accessed by external applications? A: Cloud SQL can be accessed globally from applications via standard connection drivers or built-in migration tools. 29.Q: Why is Cloud Spanner's strong external consistency important for global applications? A: Strong external consistency ensures that any updates or queries to the database provide real- time, accurate data, regardless of user location. 30.Q: How does Cloud Bigtable scale to support petabyte-scale datasets? A: Cloud Bigtable scales horizontally, handling vast amounts of data with low-latency operations.