Creating a SQL Server instance integrated with Active Directory using Google Cloud SQL

SQL Server instances in Google Cloud SQL now integrate with Microsoft Active Directory (AD) as a pre-GA feature that you can try out for yourself right now. This post describes the basic steps required to create a SQL Server instance with this new functionality. If you’re looking for complete details see the official documentation.Create a domain with Managed Service for Microsoft Active DirectoryThe first step is to create a domain with Managed Service for Microsoft AD. This can be done easily via the “Managed Microsoft Active Directory” section in the Google Cloud Console. Click the “CREATE NEW AD DOMAIN” button and enter the following information:Specify a Fully Qualified Domain NameExample: ad.mydomain.comSelect a VPC networkExample: defaultSpecify a suitable CIDR range for the AD domain Example: 10.1.0.0/24Select a Region where the AD domain should be locatedExample: us-central1Specify an admin name for the AD domain’s delegated administratorExample: mydomain-adminWith all of that information provided it should look something like this:Click “CREATE DOMAIN” to complete the process of creating the AD domain. You’ll have to be patient for a bit since it can take up 60 minutes for the domain to be available for use. Once it is ready it will look like this in the list of domains:The final step to configure the AD domain is to set the “Delegated admin” password. Click the domain name in the list of domains to go to its details page. On that page, click the “SET PASSWORD” link and make a note of the password which we’ll use in a later step of this blog post.Create a SQL Server instance with Windows AuthenticationAfter your AD domain is available for use you can start creating SQL Server instances that utilize the AD domain to enable Windows Authentication with AD-based identities. Go ahead and try out creating a new SQL Server instance by going to the Cloud SQL section of the Google Cloud Console. Click the “CREATE INSTANCE” button. Then click “Choose SQL Server” and enter the following information:Specify an Instance IDExample: sql-server-with-adEnter a password for the ‘sqlserver’ user and make a note of this for use in a later step.Select a Database version. All versions will work with Active Directory. I selected  “SQL Server 2017 Standard”.Select a Region where the instance should be located. It is recommended that you locate the SQL Server instance in the same region as the AD domain for the lowest network latency and the best performance.Example: us-central1Select whether the instance should be located in a “Single zone” or “Multiple zones”. For production instances “Multiple zones” is recommended to achieve high availability which provides automatic failover to another zone within your selected region. Select “SHOW CONFIGURATION OPTIONS”Click the “Connections” section to expand it and select both the “Private IP” and “Public IP” options. Note, if this is the first time creating a Private IP for the “Network” you select, you’ll be prompted that a “Private service connection is required”.Click “SET UP CONNECTION” and select “Use an automatically allocated IP range” in the “Enable Service Networking API” dialog that appears: Then click the “Continue” button to complete the process.Back in the instance “Configuration Options”, click the “Authentication” section to expand it.From the dropdown menu for joining a managed Active Directory domain, select the domain that you created in the first step of this blog post.Cloud SQL will automatically create a Per-Product, Per-Project Service account used for authentication to the instance. You will be prompted to grant the service account the “managedidentities.sqlintegrator” IAM role.With all of that information provided the create instance form should look something like this:Click “CREATE INSTANCE” to complete the process of creating the instance. Once the instance is created you should see the new instance’s overview page that should look something like this:Well done! You now have a SQL Server instance on Google Cloud that you can log into using Windows Authentication with an AD-based identity. Connecting to the SQL Server instance using Windows authenticationLet’s go ahead and confirm that everything works as expected. To do so I’ll create a Windows Server 2019 VM using Google Compute Engine. Using it I can add a new user to the Managed Active Directory, give that user access to the SQL Server instance in Cloud SQL and then connect to the SQL Server instance as that user with Windows Authentication.Windows Server VM’s are easy to create using Google Compute Engine’s marketplace.Searching for “Windows Server 2019″ in the marketplace returns many options to choose from.I’ll create a VM using the “Secured SQL Server 2017 Standard on Windows Server 2019″ option. After choosing the VM option, click the “Launch” button and you’ll be taken to the instance creation page. Review the settings of the VM instance to be created, especially the “Network” selection under the “Networking” section, to ensure that the selected “Network” is a network that is included in your Active Directory domain. Then scroll to the bottom of the instance creation page and click the “Create” button. Once the VM creation process is complete, you’ll be taken to the instance detail page. Click the “Set Windows password” button to set a password to use for logging into the VM. Then use the “Remote Desktop Protocol” (RDP) button to login in to the VM.Once you are logged into the VM instance you can now join the VM to the Managed Active Directory domain. Click the “Windows” icon on the bottom left of the screen, type “Control Panel”, and then press ENTER. Navigate to “System and Security”, and then click “System”. Under Computer name, domain, and workgroup settings, click “Change settings”.Then click the “Change” button in the System Properties dialog box.Enter the name of your Managed Active Directory in the “Domain” input text box and click the “OK” button.A welcome to the domain message should appear that looks something like this:Now that we have a Windows Server VM in our Managed Active Directory, we can add a User. To do so, we’ll need to install the necessary Remote Server Administration Tools (RSAT). Open “Server Manager” and click the “Manage” menu item and select “Add Roles and Features” wizard.In the wizard, advance to the Select features page. You can select Features from the sidebar or select Next until you reach it.On the Select features page, in the Features list, expand Remote Server Administration Tools, and then expand Role Administration Tools.Under Role Administration Tools, select AD DS and AD LDS Tools. This enables the following features:Active Directory module for Windows PowerShellAD LDS Snap-Ins and Command-Line ToolsActive Directory Administrative CenterAD DS Snap-Ins and Command-Line ToolsOptional: You may also want to enable the following features:Group Policy ManagementDNS Server Tools (under Role Administration Tools)Close the wizard.Excellent! Now the Windows Server VM is enabled with the tools to add Users to the Managed AD domain. Remember the “Delegated admin” that we specified when we created the AD domain at the beginning of this blog post? Well now it’s time to use it. We’ll log out of the Windows Server VM and log back in as the “Delegated admin”. Log out of the Windows VM by clicking the “Windows” icon at the bottom left of the VM instance screen, then clicking the “power” icon and selecting “Disconnect”.Back on the Google Compute Engine instances page click the “RDP” button to log back into the Window Server VM, but this time do so with the AD domain “Delegated admin” username and password.Once logged in, open “Server Manager”, click the “Tools” menu item and select  “Active Directory Users and Computers”. In the “Active Directory Users and Computers” dialog window that appears, expand the ad.mydomain.com item and click the “Cloud” sub-item. Then Click the “Create a New User in the current container” icon to create a new User.Enter a First and Last name for the User along with a logon name and click the “Next” button.Enter and confirm a Password for the User, then click the “Next” button again. Finally click the “Finish” button in the confirmation dialog box to create the User.Great! Now we’ve got a new AD domain User. But they still need to be granted access to the SQL Server instance on Cloud SQL. We can do that with Azure Data Studio. Open a browser on the Windows Server VM and go to the Azure Data Studio download page. Click the “System Installer” link to initiate the download, and click the “Run” button in the download dialog window that appearsAfter the Azure Data Studio installation wizard completes, with “Launch Azure Data Studio” checkbox selected, click the “Finish” button to open the program. In the start screen Azure Data Studio click the “New Connection” link.For “Server” enter the “Active Directory FQDN (Private)” value from the Cloud SQL – SQL Server instance details page:Example:  private.sql-server-with-ad.us-central1.your-new-project.cloudsql.ad.mydomain.comFor Authentication type select “SQL Login”For the “User name” enter “sqlserver” and for “Password” enter the password for the “sqlserver” User that you specified when you created the SQL Server instance.With all of that information specified the Connection Details should look something like this:Click the “Connect” button to connect to the SQL Server instance. Once the connection is made, click the “New query” link and enter the following query:CREATE LOGIN [ad.mydomain.comclouduser] FROM WINDOWSand click the “Run” button.Wonderful! We’re completely done with the setup and now it is time for the moment of truth.Let’s test out connecting to our SQL Server instance as our new AD domain User via Windows Authentication. Close the Azure Data Studio. Now we’ll reopen Azure Data Studio but we’ll do so as the new AD domain User. Click the “Windows” icon at the bottom left of the VM instance screen and type “Azure Data Studio”. Right-click the “Azure Data Studio” icon and select “Run as a different user”.Enter the “User name” and “Password” for the AD domain User in the dialog box that appears.On the Azure Data Studio start page, click the “New Connection” link.  For “Server” enter the “Active Directory FQDN (Private)” value from the Cloud SQL – SQL Server instance details page:Example:  private.sql-server-with-ad.us-central1.your-new-project.cloudsql.ad.mydomain.comFor Authentication type select “Windows Authentication”.Click the “Connect” button… and smile because your SQL Server on Cloud SQL is now integrated with Managed Active Directory.Getting startedWindows Authentication for Cloud SQL for SQL Server is available in preview for all customers today!  Learn more and get started.
Quelle: Google Cloud Platform

Cook up your own ML recipes with AI Platform

For anyone with a sweet tooth for confections and machine learning, I have some good news. You might remember recently my colleagues, Sara Robinson and Dale Markowitz, collaborated to create some delicious new baked inventions, including the Breakie (a fusion between cake, cookies, and bread). All of this was done through a baking ML model that they built with AutoML Tables, a no-code way to create machine learning models on tabular data.Well, it wasn’t long before legendary confectionery manufacturer Mars Wrigley approached Sara and Cloud AI for a Maltesers + AI kitchen collaboration. Sara trained a new ML model to generate recipes for cookies, cakes, scones, traybakes, and any “hy-bread” of these. After hours of model training and baking experiments, Sara combined Maltesers with her model’s AI-optimized cake and cookie recipes to create a brand new dessert, which even includes the classic British ingredient, Marmite. To break it down, Sara used a few tools to build and customize her model:AI Platform Notebooks (Jupyter lab environment for feature engineering and model development) and TensorFlow AI Platform Hyperparameter Tuning(model training)AI Platform Prediction (model deployment)You can try out Sara’s AI-powered Mars recipe yourself, but if you have an appetite to build your own ML model for other creations like pizzas, pies, milkshakes, or stir-frys, let’s boil down the objectives and steps to get you started:Objective: Create a model that takes a type of dish as input, and produces the amounts of the different ingredients needed to create it.Steps:Collect the data. You’ll want to collect a sizable dataset around the dish recipes you’re interested in (various types of pizzas, baked goods, or noodles for example). You’ll want data on the amount of each ingredient that goes into the dish. So if you’re focused on pizzas, you need data on the amounts of dough, cheese, and toppings that make up each pizza type. Prepare the data. Whittle down each of those recipes to core ingredients that span the dishes. This might be a bit arbitrary but think about which ingredients affect the fundamental makeup of all dishes like texture, flavor, or consistency. In the pizza example, I’d narrow it down to only dough ingredients, cheese type, sauce, and common toppings. Preprocess the data. Make sure all ingredient amounts are in the same measurement unit (e.g., ounces or grams). You may also need to scale the model inputs so that all ingredient amounts fall within a standard range. You can use data augmentation to create new training examples. If you’re using AutoML you can skip this step, as it handles many data preparation tasks for you, but keep in mind best practicesfor creating training data. Build your model. AI Platform lets you develop, train, and deploy your model using notebooks, a built-in Data Labeling Service, and the ability to store datasets in Cloud Storage or BigQuery. You can also use AutoML Tables and import data directly from CSV files, Google Sheets, or a BigQuery database. Train your model. You can use AI Platform Hyperparameter Tuning, a service for running multiple training job trials to optimize a model’s hyperparameters. Additionally,  AutoML Tables provides automated feature engineering. With either tool, you can determine which ingredients are important predictors of each dish type, such as basil  being an important predictor of a Margherita pizza (this can be more easily done using AutoML). Deploy your model and predict. Once you have tuned your hyperparameters and trained your model, you can use AI Platform Prediction to create custom recipes (amounts of ingredients to create a dish or combo-dish). With both AI Platform and AutoML you can also discover feature importance scores (how heavily weighted ingredients are for a dish). AI-powered recipes delivered! Now before you run off to grab your apron, let me share some sweet resources to help you get started.AI resources to give you a tasteAI Platform QuickstartThis tutorial shows how to train a neural network on AI Platform using the Keras sequential API and how to serve predictions from that model. You can also run the tutorial as a notebook in Colab. You’ll learn how to:Train a model on AI Platform using prewritten Keras codeDeploy the trained model to AI PlatformServe online predictions from the deployed modelPlus learn how to dig into the training code used for this model and ensure it’s compatible with AI Platform. Even though the dataset is around US Census income, you can use the tutorial as a framework for understanding how to train, deploy, and serve models on AI Platform for cooking-inspired (or other) datasets of your choosing. Build your first AI Platform NotebookIn this tutorial, Sara walks you through tools in AI Platform Notebooks for exploring your data and prototyping ML models. You’ll learn how to: Create and customize an AI Platform Notebooks instanceTrack your notebook code with git, directly integrated into AI Platform NotebooksUse the What-If Tool within your notebookAutoML TablesI’d be remiss if I didn’t emphasize that you can also create custom ML models without code. I mentioned that when Sara and Dale teamed up to create their Breakie recipe, they used AutoML Tables, which relieves much of the heavy burden by automating feature engineering so you can easily build and deploy state-of-the-art machine learning models on structured data. The codeless interface guides you through the full end-to-end ML workflow, making it easy for anyone to build models and reliably incorporate them into broader applications. There are a ton of quickstarts, samples, and videos to help you get started on AutoML Tables. Use them to learn how to:Create a dataset and modelImport data into a datasetDeploy a modelEvaluate your modelUse AutoML Tables from a Jupyter notebookAI Adventures video playlistCheck out coverage from Yufeng Guo and Priyanka Vergadia on AI Platform. In this featured video, Yufeng covers how you can use AI Platform built-in algorithms to train and deploy machine learning models without writing any training code. Plus check out other videos in the playlist to learn about:Training models with custom containers on AI PlatformAI Platform Pipelines for improving the reliability of your ML workflowsUsing AI Prediction service to get explanations of your models and better understand their outputsMaking the most of the AI Data Labeling service on AI PlatformIf you’ve made it to this point, you’re probably getting hungry and eager to put this in action. You can explore more AI on Google Cloud, and share your recipes with Sara, Dale, and me online. We’ve tried this with baking, but we’d love to hear if you have success with models for other types of recipes! – StephanieRelated ArticleHow sweet it is: Using Cloud AI to whip up new treats with Mars MaltesersMars uses Google Cloud AI to invent a tasty new cake that includes maltesers and marmite!Read Article
Quelle: Google Cloud Platform

Google Cloud and AVEVA’s OSIsoft serve the industrial sector a new flavor of PI

Across the industrial sector, many digital enablers and disruptive technologies are transforming businesses to be more efficient, profitable, nimble, and secure: smart factories with connected machines, the rise of the industrial internet of things (IIoT), proliferation of sensors and data, and new cloud strategies, to name a few.Our work with the PI System is designed to help industrial companies modernize their data and take it beyond the operational space to Google Cloud, deriving more insights and business value. Thanks to our partnership with AMD and OSIsoft, now part of AVEVA, customers can effectively, safely, and easily deploy a fully functioning PI System to Google Cloud. Together, we assist customers along that transformational journey through the launch of GCP deployment scripts for PI Core.The PI System is the market-leading data management platform for industrial operations in essential industries such as energy, mining, oil and gas, utilities, pharmaceutical, facilities, manufacturing, and more. The PI System automatically captures sensor data from every relevant source, refines and contextualizes the data, and delivers it to a broad ecosystem of people, tools, and applications for analysis and strategic planning. It also serves as a single source of truth for consistent decision making.With the PI System, industrial companies can generate insights from their data, including:Analyzing seasonal trends  Determining if utilities are meeting the demands of production  Comparing the performance of different lots of raw material  Determining when maintenance is required on equipment  Optimizing the utilization or performance of a production line  The new deployment scripts are a natural addition to PI Integrator for Business Analytics, which integrates Google Cloud with PI Core, the on-premises portion of the PI System. PI Integrator for Business Analytics can deliver critical operational data directly to Google Cloud destinations like Cloud Storage, BigQuery, and Pub/Sub. It can also be deployed either on-prem or on Google Cloud.The solution allows customers to take time-series data from one or many of their PI Core deployments and move it onto BigQuery, Google Cloud’s enterprise data warehouse for analytics. Customers can take advantage of exabyte-scale storage and petabyte-scale SQL queries in this high-speed, in-memory BI engine, enabling cloud-based artificial intelligence (AI) and machine learning (ML) tools that provide deep insights like anomaly detection and predictive maintenance from that data.Through our partnership, PI Core-based solutions for industrial customers are further protected by Google Cloud’s robust security features, like encrypting cloud data at rest by default, that keep data safe and more secure. What’s more, PI Core is aligned with real-time mission-critical industrial applications, avoiding delays in time-sensitive process automation or discrete manufacturing processes. Serving a new slice of PI (System) on Google CloudGCP deployment scripts for PI Core are the latest achievement in our partnership. We developed these deployment scripts for PI Core on Google Cloud using Infrastructure as Code (IaC) with PowerShell and Terraform technologies. With PI Core on Google Cloud, customers can generate business insights through the power of Google Cloud’s Smart Data Platform with AI/ML combined with other contextualized data. The scripts accelerate an industrial customer’s digital transformation and support quick and iterative testing and prototyping. They’re also designed for customers who are considering moving their on-prem system to Google Cloud, or customers who would like to deploy PI Core as an aggregation system to bring diverse on-prem data from multiple PI Systems into one place.Click to enlargeThese deployment scripts automate the provision of the PI Core components running on Google Cloud N2D VM instances powered by hardware such as 2nd Gen AMD EPYC™ processors. GCP deployment scripts for PI Core include recommended practices for both platforms by delivering automation to deploy test and development environments.  The scripts are offered in non-high availability (non-HA) configuration, with an HA version providing failover capabilities for PI Core coming soon. These scripts are open-sourced, and the non-HA version is now available on Google’s GitHub.By running PI Core on Google Cloud, the industrial sector has an easy and efficient path to business insights, generating more value from their collected data in a safe and managed environment. Enabling PI Core deployment on Google Cloud through scripts is just one of the solutions that we’re building together. Stay tuned for more updates.Learn more about PI Core and the overall PI System for the industrial sector. Learn more about Google Cloud instances powered by AMD. Ready to get started with our deployment scripts? Visit the GCP deployment scripts for PI Core on our Github.Related ArticleCOVID-19 reshapes manufacturing landscape, new Google Cloud findings showAccording to our new research released today, manufacturers around the world have started to revamp their operating models and supply cha…Read Article
Quelle: Google Cloud Platform

New flexibility: Run your Dataprep jobs with BigQuery or Dataflow

Cloud Dataprep by Trifacta is Google Cloud’s intelligent data service for visually exploring, cleaning, and preparing structured and unstructured data for analytics and machine learning. Due to its serverless architecture, Dataprep does not need any infrastructure to deploy or manage, and is fully scalable.Designed and built through a partnership between Google and Trifacta – the data engineering  platform, Dataprep allows users of all skill levels to prepare data.  Dataprep has a graphical user interface so there is no need to write code to create a pipeline. Additionally, each UI input automatically predicts and suggests the next step for data transformation, making it easy and flexible for the end user. After making all desired transformations, Dataprep users can build repeatable data pipelines that can be executed at scale using the processing power of Google Cloud.Introducing Dataprep BigQuery pushdownSpeaking of processing power, today we’re excited to announce a new addition to Dataprep – BigQuery pushdown.  BigQuery pushdown gives you the flexibility to run jobs using either BigQuery or Dataflow.  If you select BigQuery  then Dataprep can automatically determine if data pipelines can be partially or fully translated in a BigQuery SQL statement.  Any portions of the pipeline that cannot be run in BigQuery are executed in Dataflow.  Utilizing the power of BigQuery results in highly efficient data transformations, especially for manipulations such as filters, joins, unions, and aggregations. Dataprep BigQuery pushdown leads to better performance, optimized costs, and increased security with IAM and OAuth support.Dataprep leverages BigQuery or Dataflow to wrangle data (click to enlarge)In today’s data focused world, the modern equivalent to ETL (Extract, Transform, Load) is ELT (Extract, Load, Transform). The ELT framework enables data savvy business users to transform data rather than relying on IT teams to both transform and load data. With ELT, technical teams can handle the logistics of moving and managing data in BigQuery, while business users can leverage the power of SQL for intermediate transformations. This reduces cycles between the technical and business teams for finalizing data transformation requirements, and reduces the burden on the technical teams. Dataprep BigQuery pushdown complements the ELT framework helping data savvy business users and the technically focused IT teams with data transformation and data preparation tasks.In summary, the new BigQuery pushdown on Dataprep enables faster data transformations, optimized costs, and increased flexibility. You can learn more about Dataprep BigQuery pushdown and get started today by trying Dataprep on the Google Cloud Marketplace.
Quelle: Google Cloud Platform

Creating a serverless pipeline for real-time market data

Editor’s note: This is the second part in our special series on working with market data in Google Cloud. This post highlights how we leveraged serverless components to build a flexible data ingestion pipeline. Check out the first post on visualizing real-time market data in the cloud.Capital markets firms must rapidly extract insights from unbounded real-time datasets. A firm’s market data pipelines should weigh the end user’s data access requirements as a central design consideration, but oftentimes the rigidity of delivery mechanisms and analytical tools block this goal. Serverless data offerings can solve this problem by removing operational friction when introducing a new, well-suited tool. This makes it simple for one data pipeline to serve separate user goals—say, one for training a real-time machine learning model and another for analyzing historical data. With a serverless data pipeline, capital markets firms can focus on insights, not infrastructure, and stay ahead in a fast-moving industry. In this post, you’ll see best practices for real-time data ingestion using CME Group’s Smart Stream top-of-book (ToB) JSON feed. The reference architecture considers data usage patterns and schema when selecting storage and transport options. It also encapsulates business logic in Cloud Functions to increase the speed of development and to offload operational complexities. These patterns and designs can be applied to a wide variety of use cases.Figure 1 depicts the ingestion pipeline’s reference architecture.Figure 1: Reference architectureHow we set up real-time data ingestionThe source of the real-time data we used is Smart Stream, a service available on Google Cloud from CME Group. The data originates with the CME Globex trading platform as a multicast stream running over UDP. The instrument price data is forwarded over an interconnect to different Pub/Sub topics, each corresponding to a single product, like silver or orange juice concentrate futures.Pub/Sub is serverless and tightly integrated with other Google Cloud services. It’s also fully managed by Google, alleviating users from many scaling, planning, and reliability concerns. Google provides open-source Dataflow templates to ingest data from Pub/Sub to various sinks such as BigQuery and Cloud Storage. Bigtable was leveraged as a real-time data store, serving most recent data and features to a prediction endpoint. (The endpoint passes this data to machine learning models hosted on Google Cloud’s AI Platform). In parallel, we use BigQuery as a scalable analytics warehouse. Pub/Sub data was streamed to both sinks with separate Dataflow jobs.Figure 2 is a shell snippet launches a Dataflow job with a Google-provided template for PubSub-to-BigQuery pipelines:Figure 2: Launching a Dataflow template to ingest messages from Pub/Sub to BigQueryFigure 3 depicts a Dataflow pipeline with three input Pub/Sub topics (one per trading instrument) and Bigtable as a sink:Figure 3: Dataflow job graphThe class in Figure 4 defines an Apache Beam pipeline to ingest data from a single topic (i.e., product code) and write to Bigtable:Figure 4: Apache Beam ingestion pipeline to BigtableAt first glance, the app’s predictive models and web front-end charts are similar in their demand for data freshness. On further inspection, however, a difference emerges—the charts can use the Smart Stream price data directly without an intervening data store. So for front-end delivery, we settled on Pub/Sub via websockets.Using Pub/Sub with serverless ingestion components offered architectural flexibility and removed operational complexity as a constraint. Data coming from one Pub/Sub topic can be stored in Bigtable for machine learning or in BigQuery for analytics, in addition to being sent directly over websockets to power rapidly changing visualizations.Storage and schema considerationsIdeally, the time spent managing data is minimal compared to the time spent using data. If schema design and storage architecture is executed properly, users will feel that the data is working for them, rather than them working for the data.Row key design is critical to any Bigtable pipeline. Our key concatenates a product symbol with a reverse timestamp, which is optimized for our access pattern (“fetch N most recent records”) while avoiding hotspotting. In order to reverse the timestamp, we subtract it from the programming language’s maximum value for long integers (such as Java’s java.lang.Long.MAX_VALUE). This forms the key: <SYMBOL>#<INVERTED_TIMESTAMP>. A product code’s most recent events appear at the start of the table, speeding up the query response time. This approach accommodates our primary access pattern (which queries multiple recent product symbols)—but may yield poor performance for others. A post on Bigtable schema design for time series data has additional concepts, patterns and examples.Figure 5 shows a sample data point ingested into Bigtable:Figure 5: Representation of a market data record within BigtableWhile Bigtable is well-suited to deliver low-latency data to machine learning models, we also needed a more analytically tuned query engine for longer-lookback insights. BigQuery was a natural fit because of its serverless and scalable nature, as well as its integration with tools such as AutoML. When designing, we considered three options for preparing the BigQuery data for visualization as classic OHLC “candlesticks.” First, we could store the nested Pub/Sub JSON into BigQuery and write a complex SQL query to unnest and aggregate. Second, we could write a view that unnests, and then write a simpler SQL query that aggregates (without unnesting). Third, we could develop and run a Dataflow job to unnest Pub/Sub records into a “flat” format for storage in BigQuery, and could then aggregate with a simple SQL query. Though the third option may represent a superior design longer term, time constraints steered us towards the second option. The BigQuery view was simple to set up, and the team got productive quickly when querying against the flattened schema. Thanks to a DATE partition filter, the SQL view definition scans only the most recent day from the underlying table storing the quotes. This dramatically improves performance of the queries against the view.   A sample of the data transformation and views for this specific chart using the second methodology are shown in Figures 6 and 7.Figure 6: SQL view definition to flatten original source recordsFigure 7: SQL view definition that generates OHLC bars (“candlesticks”)Because both Bigtable and BigQuery are serverless, the maintenance of each storage solution is minimal, and more time can be spent deriving and delivering value from the data, rather than capacity planning around procurement of storage arrays and operational complexities.Market data microservicesCloud Functions offer developers two primary benefits. First, they provide the ability to bypass non-differentiating low-level implementation details in favor of business-specific code. Second, they support flexible use of data by encapsulating business logic outside of the database. In our pipeline, we accordingly used Cloud Functions for isolated, task-specific code chunks. One example is our pipeline’s Fetch Predictionfunction, which retrieves trade records from Bigtable and extracts first-order features (mean, sum, max, etc) for input to the machine learning model. This enables rapid predictions that are used by the bots to make algorithmic trading decisions in near real-time. This is demonstrated in Figure 8.Figure 8: Python routine to fetch predictions at runtimeFetch Candles is a Cloud Function that fetches a recent price summary from BigQuery detailing the opening, closing, highest and lowest price observed for each minute. To improve the request-response performance, we enabled HTTP(s) load balancing with a serverless network endpoint group for our app, and then optimized delivery with Cloud CDN. Configured this way, Fetch Candles will query BigQuery only for the first request for a given minute and product code. Subsequent requests will be delivered from the Cloud CDN cache, until the maximum cache TTL of one minute is reached. This can significantly reduce the overall volume of query executions as web client traffic scales up. Since the data is in a lookback window, there’s no functional necessity for BigQuery to calculate the aggregates more than once per individual duration.Figure 9: OHLC “candlestick” chart visualizationBy enabling a microservices architecture, Cloud Functions allowed each developer to develop in their preferred language, and to develop, test, and debug individual functions in isolation.Figure 10 shows an inventory of the principal functions used in our market data pipelines.Figure 10: Sample inventory of Cloud FunctionsMany of these functions provide input to a machine learning model, while others fetch data from  BigQuery for visualizations of trader performance in a real-time Profit/Loss ledger.ConclusionA data pipeline built from serverless components allows capital markets firms to focus on developing valuable insights and offerings, and not on managing infrastructure. In a serverless environment, the end users’ data access patterns can strongly influence the data pipeline architecture and schema design. This, in conjunction with a microservices architecture, minimizes code complexity and reduced coupling. As organizations continue to add data sources and information tools to their operations, using serverless computing models enable them to focus on value-added tasks of using data to make better decisions.Learn more about Google Cloud for financial services.Related ArticleNew white paper: Strengthening operational resilience in financial services by migrating to Google CloudLearn how migrating to Google Cloud can play a critical role in strengthening operational resilience in the financial services sector.Read Article
Quelle: Google Cloud Platform

IDC: A multicloud strategy can mitigate regulatory, business risks

In recent years, cloud has become an important driver for innovation, enhancing security and operational resilience, and the COVID-19 pandemic has only accelerated the trend. But cloud adoption has been slower in regulated sectors including government agencies and financial institutions, due to the complexity of their legacy systems, cultural perceptions, and certain compliance challenges. In particular, the industry is focused on reducing vendor lock-in, concentration risk and over-reliance on third-party providers. To address these concerns, many regulated organizations are looking to implement innovative multi-vendor strategies. A multicloud approach lets them pick and choose cloud services from multiple cloud providers, helping to address commercial risks while providing more flexibility and choice. At Google Cloud, we are strong advocates of portability, interoperability and customer choice. To better understand the benefits as well as the challenges associated with a multicloud approach, we supported IDC in their work to produce a whitepaper that investigates how multicloud can help regulated organizations mitigate risks of using a single cloud vendor. The whitepaper looks at different approaches to multi-vendor and hybrid clouds taken by European organizations and how these strategies can help organizations address concentration risk and vendor-lock in, improve their compliance posture and demonstrate an exit strategy. Here’s a glimpse into the whitepaper’s findings:. Open source and technologies such as containers, open APIs, and open source databases are enablers of multicloud. Containers and container orchestration services such as Kubernetes are the runaway favorites—at least 50% of organizations prefer to run databases on a container platform. A container-based multicloud architectural approach gives organizations the portability to build once and deploy across multiple cloud environments.One in three financial services organizations are increasing their public cloud spend to accelerate feature delivery for their end customers. Choosing a multicloud strategy enables them to address cloud concentration risk for critical financial technology while still prioritizing innovation.In the public sector, multicloud has become a preferred way to address regulatory concerns and leverage the best services from different providers. Unfortunately, many governments have grown their multicloud adoption organically, rather than strategically.The whitepaper also offers recommendations for the regulated industries as well as policymakers to accelerate adoption of cloud and multi-vendor strategies in a secure and resilient way. To learn more about how regulated enterprises are adopting multicloud, you can download the IDC whitepaper or visit our multicloud solutions website.Related ArticleHow computing has evolved, and why you need a multi-cloud strategyA multi-cloud strategy gives companies the freedom to use the best possible cloud for each workload. Here’s why we’re all in.Read Article
Quelle: Google Cloud Platform

Introducing request priorities for Cloud Spanner APIs

Today we’re happy to announce that you can now specify request priorities for some Cloud Spanner APIs. By assigning a HIGH, MEDIUM, or LOW priority to a specific request, you can now convey the relative importance of workloads, to better align resource usage with performance objectives. Internally, Cloud Spanner uses priorities to differentiate which workloads to schedule first in situations where many tasks contend for limited resources.Customers can take advantage of this feature if they are running mixed workloads on their Cloud Spanner instances. For example, if you want to run an analytical workload while processing DML statements, and you are okay with your analytical workload taking longer to run. In that case, you’d run your analytical queries at a LOW priority, signaling to Spanner that it can reorder more urgent work ahead if it needs to make tradeoffs.When there are ample resources available, all requests, regardless of priority, will be served promptly. Given two requests, one with HIGH priority and the other with LOW priority, but otherwise identical, there will not be noticeable differences in latency between the two when there is no resource contention. As a distributed system, Spanner is designed to run multiple tasks in parallel, regardless of their priority. However, in situations where there aren’t enough resources to go around, such as a sudden burst of traffic or a large batch process, the scheduler will try to run high-priority tasks first. This means that lower priority tasks may take longer than in a similar system that wasn’t resource constrained. It is important to note that priorities are a hint to the scheduler rather than a guarantee. There are situations where a lower priority request will be served ahead of a higher priority request, or example, when a lower priority request is holding a transaction lock that a higher priority request needs access to.Using Request PrioritiesThe Priority parameter is part of a new optional RequestOptions you can specify in the following APIs:ReadStreamingReadExecuteSqlExecuteStreamingSqlCommitExecuteBatchDmlYou can access this newly added parameter if you are directly issuing requests to our RPC API, REST APIor via the Java or Go Client libraries, with the rest of the client libraries implementing support for this parameter soon.The following sample code demonstrates how to specify the priority of a Read request using the Java Client LibraryQueryOption queryOption = new PriorityOption(RpcPriority.LOW);ResultSet resultSet = dbClient.singleUse().executeQuery(Statement.of(“SELECT * FROM TABLE”), queryOption);Note: Even though you can specify a priority for each request, it is recommended that requests that are part of the same transaction all have the same priority. MonitoringCloud Console reflects these new priorities in the CPU utilization, grouping metrics into HIGH and LOW/MEDIUM buckets.In the screenshot above, at 5:08 there was a low priority workload that was running with no other competing workloads. The low priority workload was allocated 100% of the available CPU. However, when a high priority workload started at ~5:09, the high priority workload was served immediately and the low priority workload CPU utilization dropped to 60%. When the high priority workload completed, the low priority workload resumed using 100% of the available CPU,Access this newly added parameter by issuing requests to our RPC API, REST APIor via the Java or Go Client libraries.Related ArticleIntroducing Django ORM support for Cloud SpannerToday we’re happy to announce beta support for Google Cloud Spanner in the Django ORM. The django-google-spanner package is a third-party…Read Article
Quelle: Google Cloud Platform

OpenX is serving over 150 billion ad requests per day with cloud databases

Editor’s note: When ad tech provider OpenX was migrating to Google Cloud, they found a scalable, dependable and cost-effective solution in Bigtable and Memorystore for Memcached. Here’s how—and why—they made the move.Running one of the industry’s largest independent ad exchanges, OpenX developed an integrated platform that combines ad server data and a real-time bidding exchange with a standard supply-side platform to help ad buyers get the highest real-time value for any trade. OpenX serves more than 30,000 brands, more than 1,200 websites, and more than 2,000 premium mobile apps.We migrated to Google Cloud to save time, increase scalability, and be available in more regions in the world. As we were migrating to Google Cloud, we also sought to replace our existing open-source database because it was not supported anymore, which led us to search for a cloud-based solution. The combination of Cloud Bigtable and Memorystore for Memcached from Google Cloud gave us the performance, scalability, and cost-effectiveness we required. Leaving behind an unsupported databaseWhen OpenX was hosted on-premises, our infrastructure included a main open source key value database at the back end that offered low latency and high performance. However, the vendor eventually left the market, which meant we had the technology but no commercial support. This opened up the opportunity for us to take the important step of migrating to the cloud and get a more convenient, stable, and predictable data cloud solution.Performance was a huge consideration for us. We used the legacy key value database to understand the usage patterns of our active web users. We have a higher percentage of get requests than update requests, and our main requirement was, and remains, low latency. We need the database requests to be handled in less than 10 milliseconds at P99 (99th percentile). The expected median is less than five milliseconds, and if the time is shorter, it’s better for our revenue.  Scalability was another consideration and, unfortunately, our legacy database wasn’t able to keep up. To handle traffic, our clusters were maxed out and external sharding between two relatively large clusters was required. It wasn’t possible to handle the traffic in a single region by a single instance of this database because we’d reached the maximum number of nodes. In search of a cloud-based solutionChoosing our next solution was a crucial decision, as our database is mission-critical for OpenX. Cloud Bigtable, a fully managed, scalable NoSQL database service, appealed to us because it’s hosted and available on Google Cloud, which is now our native infrastructure. Post migration  we had also made it a policy to leverage managed services when possible. In this case we didn’t see the value in operating (installing, updating, optimizing etc) a key value store on top of Google Kubernetes Engine (GKE) – work that doesn’t directly add value to our products.We needed a new key value store and we needed to move quickly because our cloud migration was happening on a very compressed timeline. We were impressed with the foundation paper written about Bigtable, one of the most-cited articles in computer science, so it wasn’t a complete unknown. We also knew that Google itself used Bigtable for its own solutions like Search and Maps, so it held a lot of promise for OpenX. OpenX processes more than 150B ad requests per day and on average 1M such requests per second, so response time and scalability are both business-critical factors for us. To start, we created a solid proof of concept and tested Bigtable from different aspects and saw that the P99s and the P50s met our requirements. And with Bigtable, scalability is not a concern. Where is the data coming from?In each of our regions, we have a Bigtable instance for our service with at least two clusters replicated and with independent autoscalers because we write to both clusters. Data gets into Bigtable in two very different flows. Our first flow handles event-based updates like user-based activity, page views, or cookie syncing, and these events are connected to the currently active rows. We update Bigtable with the updated cookie. It’s a process focused on updating and during this event processing, we usually don’t need to read any data from Bigtable. Events are published to Pub/Sub and processed on GKE.The second flow manages massive uploads of billions of rows from Cloud Storage, which include batch processing results from other OpenX teams and some external sources.We perform reads when we get an ad request. We’ll look at the different numbers that Memorystore for Memcached provided us later in this blog, but here, before we used Memcached, the reads were 15 to 20 times more than the writes.  The following chart shows the current architecture today for the flows described above:Click to enlargeThings just happen automaticallyEach of our tables contains at least one billion rows. The column families available to us through Bigtable are incredibly useful and flexible because we are able to set up different retention policies for each, what should be read, and how they should be managed. For some families, we have defined strict retention based on time and version numbers, so the old data is set to disappear automatically when the values are updated. Our traffic pattern is common to the industry; there’s a gradual increase during the day and a decrease at night, and we are using autoscaling to handle that. Autoscaling is challenging in our use case. First of all, our business priority is to serve requests that read from the database because we have to retrieve data quickly for the ads broker. We have the GKE components that write to Bigtable and we have Bigtable itself. If we scale GKE too quickly, it might send too many writes to Bigtable and affect our read performance. We solved this by gradually and slowly scaling up the GKE components , and essentially throttling the rate in which we consume messages from Pub/Sub, an asynchronous message service. This allows the open-source autoscaler we are using for Bigtable to kick in and work its magic, a process which takes a bit longer than GKE scaling, naturally. It’s like a waterfall of autoscaling.At this point, our median response time was about five milliseconds. The 95 percentile was below 10 millisecond and the 99 percentile was generally between 10 and 20 milliseconds. This was good, but after working with the Bigtable team and the GCP Professional Services Organization team we felt like we could do better by leveraging another tool in the Google Cloud toolbox.Memorystore for Memcached saved us 50% in costsCloud Memorystore is Google’s in-memory datastore service, a solution we turned to when we wanted to improve performance, reduce response time and optimize overall costs. Our approach was to add a caching layer in front of Bigtable. So we created another POC with Memorystore for Memcached to investigate and experiment with the caching times, and the results were very fruitful. By using Memorystore as a caching layer we reduced the median and P75 to a value close to the Memcached response times and which is lower than one millisecond. P95 and P99 also decreased. Of course, response times vary by region and workload, but they have been significantly improved across the board. With Memorystore, we were also able to optimize the number of requests to Bigtable. Now, over 80% of get requests are fetching data from Memorystore, and less than 20% from Bigtable. As we reduced the traffic to the database, we reduced the size of our Bigtable instances as well. With Memorystore, we were able to reduce our Bigtable node count by over 50%. As a result of this, we are paying for Bigtable and Memorystore together 50% less than what we paid for Bigtable alone before that. With Bigtable and Memorystore, we could leave the problems of our legacy database behind and position ourselves for growth with solutions that provided low latency and high performance in a scalable, managed solution.To learn more about OpenX, visit our site. To explore Memorystore for Memcached, read how it powers up caching.Thank you: None of this would have been possible without the hard work of Grzegorz Łyczba, Mateusz Tapa, Dominik Walter, Jarosław Stropa, Maciej Wolny, Damian Majewski, Bartłomiej Szysz, Michał Ślusarczyk, along with the rest of the OpenX Engineering Teams. We’re also grateful for the support of Google strategic cloud engineer Radosław Stankiewicz.Related ArticleHow Memorystore cut costs in half for Quizlet’s Memcached workloadsSee how online learning platform Quizlet uses managed database service Memorystore for Memcached to cut costs, improve reliability for SRE.Read Article
Quelle: Google Cloud Platform

AI in Retail: Google Cloud transforms Cartier's product search technology

Ever since jeweler Louis-Francois Cartier opened his first workshop in Paris in 1847, the name “Cartier” has been synonymous with exceptional quality. Almost two centuries later, the luxury Maison has popularized wristwatches for men, been dubbed the “jeweler of kings and king of jewelers” by King Edward VII, and continues to design, manufacture, and sell jewelry and watchmaking creations globally renowned for timeless design. While Maison Cartier prides itself on the vastness of its collection, manually browsing its catalog to find specific models, or comparing several models at once, could sometimes take quite some time for a sales associate at one of the Maison’s 265 boutiques. This was not ideal for a brand that is known for its swift and efficient client service. Thus, in 2020, Cartier turned to Google Cloud and its advanced AI and machine learning capabilities for a solution.Thomas Meyer, Data Officer at Cartier: “We aim to build a global data & digital platform for our Maison, providing our teams with at scale analytics, versatile applications and artificial intelligence capabilities. Google Cloud is to be the core component of this data & digital platform.”No time to spare: Overcoming product search challenges with AICartier’s goal was to develop an application which, when shown an image of any Cartier watch ever designed in its 174-year history, could retrieve detailed information about its specific model and suggest similar-looking watches (with possibly different characteristics such as price) in under two seconds. Using the app, sales associates would be able to find specific products swiftly within a catalogue of more than a thousand watches—even some with only very slight variations between them.But creating this app meant Cartier’s data team had to overcome some unique challenges. Training machine learning models requires huge volumes of training data—in this case, images of Cartier wristwatches—but Cartier has always been driven by exclusive design and its prestigious collections had very few in-store product images available, with variations in backgrounds, lighting, quality, and styling, making it difficult to categorize images. As a result, Cartier had to find a way to develop an image recognition system that was performing above the required benchmarks, as the Maison has very high standards for its client service. For the app to be successfully adopted in its stores, Cartier required at least a 90% accuracy rate, with the entire pipeline running within five seconds end-to-end when integrated. That’s when, leveraging their existing partnership with Google Cloud, Cartier’s data team reached out to us for support looking for more advanced machine learning capabilities to bring their vision to life. Move beyond customer experienceWorking together with Cartier’s data team, we were able to help them solve their data and visual search challenge through trying out a number of machine learning experiments with Google Cloud AI Platform services, such as AutoML Vision, and Vision API, before rewriting custom code. In the end we built a data model specifically designed for Cartier’s use case: a combination of classifiers that run in parallel that first recognize a watch’s colors and materials, and then identifies which watch collection it belongs to. In the end, it provides a top three list of possible identities (visually similar watches) for the image, which users can click on to get more information, with up to 96.5% accuracy within three seconds.GCP project architecture & processNow, when customers are in need of a specific Cartier watch, the boutique team can help by taking a picture of the desired model (or use any existing photo of it as reference), and use the app to find its equivalent product page online. This solution also locates visually similar designed products in the catalog, displaying each with their own image, similarity score, and detailed description (if the boutique team clicks on it) for customers to explore. Meanwhile, an automatic tracked feedback mechanism enables users to evaluate how relevant the recommendations were so that the Cartier data team can continually improve the app. Served with style, thanks to the cloudToday, Cartier’s image recognition app has been rolled out across the Maison’s 200+ global stores and is available to sales associates in need of quickly calling up catalogue data on Cartier’s vast watchmaking creations. It now takes a sales associate seconds to answer a question that used to take them several minutes. And over time the Maison hopes to further expand the app’s functionality. “The performance of cutting edge machine learning and easy handling makes Google Cloud Vision API a fantastic tool to quickly prototype most classification projects” explains Alexandre Poussard, Data Scientist at Cartier. “We look forward to deepening our collaboration with Google Cloud in the future.”With AI and machine learning, the future looks bright for Cartier, just in the nick of time. Even beyond the boutiques, the success of this pioneering project is also opening doors to more innovation as it attracts the interest of other retail brands looking to tackle similar challenges. Learn more aboutGoogle Cloud AI and machine learning and retail solutions.Related ArticleGoogle Cloud Retail & Consumer Goods Summit: The Future of RetailJoin us at the Google Cloud Retail & Consumer Goods Summit and learn how combining technology and business insights can solve retail chal…Read Article
Quelle: Google Cloud Platform

Google Cloud Retail & Consumer Goods Summit: The Future of Retail

The way consumers make their everyday decisions is evolving, as digital ways of working, shopping and communicating have become the new normal. So now it’s more important than ever for companies in the retail sector to prioritise an insights-driven technology strategy and understand what’s truly important for their customers.  Through its partnerships with some of the world’s leading retailers and brands, Google Cloud provides solutions that address the retail sector’s most challenging problems, whether it’s creating flexible demand forecasting models to optimize inventory or transforming e-commerce using AI-powered apps. Over the past few years, we’ve been observing and analyzing the many facets of changing consumer behaviour. We are here to support retailers and brands as they transform their businesses to adapt to this new landscape.  Featuring consumer research and insights from your peers, Google Cloud’s Retail & Consumer Goods Summit will offer candid conversations to help you solve your challenges. We’ll be joined by industry innovators, including Carrefour Belgium and L’Oréal, who’ll discuss the future of retail and consumer goods. Bringing together technology and businessThe Google Cloud Retail & Consumer Goods Summit brings together technology and business insights, the key ingredients for any transformation. Whether you’re responsible for IT, data analytics, supply chains, or marketing, please join! Building connections and sharing perspectives cross-functionally is important to reimagining yourself, your organization, or the world. Capturing consumers with an insights-driven approach At the Google Cloud Retail & Consumer Goods Summit, you can choose from sessions that are tailored specifically to retail or to consumer goods, as well as the following:  Keynote: Our Human Truths team will kick off the summit by sharing insights into consumers’ hearts and minds to help inform your transformation strategy. Learn what consumer behaviors they think will be around for the long-term as we move into a post-pandemic world. “Hey Google, Show Me the Future of Retail” (featuring Carrefour Belgium): The Retail landscape is challenging, changing and full of possibilities. Join us for a transparent conversation about transformation roadmaps and how retailers should be planning for the future.How to Grow Brands in Times of Rapid Change (featuring L’Oréal): For consumer brands, this past year has been a catalyst of digital transformation that was already under way for several years. At Google, we’ve been closely studying a rapidly evolving landscape and will share with you our findings on where the high growth opportunities are for your brands so you can drive innovation across your organization.You’ll also be able to learn from experts who are leading transformations in their own sectors. These include German wholesaler METRO Digital, which is transforming the hospitality industry by making its digital solutions available to customers, and French retailer Maisons du Monde, which is taking a data-driven approach to personalize its customer experience.   Developing your transformation strategy To round off the day, you are invited to join MasterChef 2020 winner Thomas Frake. While retailers are using cloud technology to forecast the hottest products on the shelves and avoid shortages, Thomas will demonstrate how to cook like a chef using ingredients that you should already have at home. The Google Cloud Retail & Consumer Goods Summit will take place on Thursday, 22 April from 9:30am GMT+1. Please join us and register today by visiting our event landing page. You’ll leave the day inspired and ready to start your transformation journey. Related ArticleMeet the EMEA startups and scaleups redefining their industries with cloud technologyIndustries across EMEA are being disrupted and redefined by startups and scaleups, and we’re proud that many are Google Cloud customers. …Read Article
Quelle: Google Cloud Platform