$30 off During Our Annual Pro Sale. View Details »

Build modern cloud native applications with Kubernetes and OSS databases on Azure | Data Platform Summit 2020 | Sunitha Muthukrishna

Build modern cloud native applications with Kubernetes and OSS databases on Azure | Data Platform Summit 2020 | Sunitha Muthukrishna

With changing customer requirements, you need to think about modernizing your approach to application development to be cloud-ready. In this session, we will show you how to modernize your application with Azure Kubernetes Service (AKS) and MySQL on Azure. We will walk through on how to migrate an application that uses PostgreSQL or MySQL to Kubernetes using AKS and Azure Database for MySQL. In additional to the migration, you will also learn how to optimize AKS to work best with Postgres or MySQL on Azure and to simplify migration and operational efficiency resulting in increased scalability, improved performance, and reduced costs.

Azure Database for PostgreSQL

December 04, 2020
Tweet

More Decks by Azure Database for PostgreSQL

Other Decks in Technology

Transcript

  1. Build modern cloud native
    applications with Kubernetes
    and OSS databases on Azure
    Sunitha Muthukrishna
    Senior Program Manager
    Microsoft

    View Slide

  2. Speaker
    Sunitha Muthukrishna,
    Senior Program Manager
    Azure Database for PostgreSQL, MySQL & MariaDB
    @mksuni

    View Slide

  3. Agenda
    What’s new with
    Open Source DBs
    on Azure
    • What’s is AKS
    • Top scenarios for
    AKS
    • Best practices
    with using AKS
    • Deploy a cloud native WordPress
    application with MySQL
    • Simple Postgres Deployment
    • Github Action for Postgres and
    MySQL
    • Scale and Manage the cluster
    and database
    • Diagnose and Solve experiences

    View Slide

  4. Azure builds upon
    the core benefits
    of PostgreSQL and
    MySQL
    Global reach
    Security
    Scale up
    Built-in
    HA
    Compliance
    Easy ecosystem
    integration

    View Slide

  5. Existing deployment options for Postgres and MySQL
    Hyperscale (Citus)
    Worry-free PostgreSQL in the
    cloud with an architecture
    built to scale out
    Single Server
    Enterprise-ready, fully
    managed community OSS
    engines

    View Slide

  6. Looking back
    Security
    § Azure AD authentication
    § Customer-managed key encryption
    § Infrastructure double encryption
    § Minimum TLS version requirements
    Performance
    § Read replicas
    § Intelligent Performance
    Manageability
    § RI for all GA services
    § Storage auto grow
    Trusted by companies
    of all sizes
    50
    regions

    View Slide

  7. New deployment option : Flexible Server
    Hyperscale (Citus)
    Worry-free PostgreSQL in the
    cloud with an architecture
    built to scale out
    Single Server
    Enterprise-ready, fully
    managed community OSS
    engines
    Azure Arc enabled Postgres Hyperscale NEW
    Scale out PostgreSQL in
    environment of your choice
    Flexible Server (Preview) NEW
    Maximum control with a
    simplified developer experience

    View Slide

  8. Introducing Flexible Server (Preview) for
    Build resilient apps
    across availability
    zones
    Maximum control
    for your databases
    Simplified developer
    experience

    View Slide

  9. When to use
    Single Server
    vs.
    Flexible Server
    (Preview)
    Single Server Flexible Server
    (Preview)
    Database Version § MySQL 5.7, 8
    § Postgres 9.5, 9.6, 10, 11
    § MySQL 5.7
    § MySQL 8.0 (planned)
    § Postgres 11, 12
    § Postgres 13 (planned)
    High Availability Built-in HA (Single-AZ) Zone Redundant HA
    Scheduled Maintenance System scheduled System or custom scheduled
    Stop/Start P P
    PITR P P
    Network Isolation P Private Link
    P VNET Integration
    Customer managed keys
    for Encryption
    P O (planned)
    Reserved Instances (RI) P O (planned)
    Cross region replicas P O (planned)
    Uptime SLA 99.99% O (planned)

    View Slide

  10. Data Platform Virtual Summit 2020 is a community initiative by DataPlatformGeeks
    AZURE KUBERNETES SERVICE

    View Slide

  11. Kubernetes on its own is not enough
    Save time from infrastructure management and roll out updates faster without compromising security
    Unlock the agility for containerized
    applications using:
    • Infrastructure automation that simplifies
    provisioning, patching, and upgrading
    • Tools for containerized app development
    and CI/CD workflows
    • Services that support security, governance,
    and identity and access management
    IDE container
    support
    Registry
    supporting
    Helm
    CI/CD
    Monitoring
    Microservice
    debugging
    Networking
    Virtual machines
    Security Governance Identity
    Source code
    repository
    <\>
    Kubernetes
    Storage Data
    Infrastructure automation

    View Slide

  12. Azure Kubernetes Service
    Enterprise-grade by design
    Unified management
    Multi-layer security
    Hardened security and
    layers of isolation across
    compute resources, data,
    and networking
    Enterprise support
    Support from certified
    Kubernetes experts or an
    interactive portal experience
    for faster diagnostics and
    troubleshooting
    Consistent
    configuration and
    governance across
    environments
    Built-in best practices
    Proactive and actionable
    recommendations, based
    on knowledge from
    thousands of enterprise
    engagements

    View Slide

  13. Top Scenarios for Kubernetes on Azure with OSS
    databases

    View Slide

  14. Data Platform Virtual Summit 2020 is a community initiative by DataPlatformGeeks
    DEPLOY WORDPRESS APP IN AKS +
    MYSQL FLEXIBLE SERVER

    View Slide

  15. Command to create mysql flexible server
    Create MySQL flexible database server using these command which uses public access
    connectivity. Provide an IP address for your client machine to give access.
    az mysql flexible-server create --public-access

    View Slide

  16. Command to create aks cluster with 4 node count
    Create an AKS cluster
    az aks create --name MyAKSCluster --resourcegroup MyResourcegroup –node-count 4
    Install Kubectl to connect and manage cluster
    az aks install-cli
    Set PATH
    set PATH=%PATH%;C:\Users\\.azure-kubectl
    Get Credentials to connect to the cluster
    az aks get-credentials --name MyAKSCluster --resourcegroup MyResourcegroup

    View Slide

  17. Install Kubernetes manifest file
    Use the sample WordPress Kubernetes yaml file
    Docker image used in the demo php-sample-app:wordpress
    This docker image has custom WordPress installation with custom wp-config.php.

    View Slide

  18. Data Platform Virtual Summit 2020 is a community initiative by DataPlatformGeeks
    OPTIMIZED WORDPRESS APP ON AKS
    AND MYSQL FLEXIBLE SERVER

    View Slide

  19. View Slide

  20. Data Platform Virtual Summit 2020 is a community initiative by DataPlatformGeeks
    CREATE A POSTGRES FLEXIBLE SERVER

    View Slide

  21. Command to create postgres flexible server
    Create Postgres flexible database server using these command
    • az postgres flexible-server create [OPTIONS]

    View Slide

  22. Data Platform Virtual Summit 2020 is a community initiative by DataPlatformGeeks
    BEST PRACTICES FOR CLOUD NATIVE
    APPS WITH OSS DATABASES

    View Slide

  23. View Slide

  24. Retry logic for transient faults
    • An error occurs when you try to open a connection.
    • An idle connection is dropped on the server side. When you try to issue
    a command, it can't be executed.
    • An active connection that currently is executing a command is dropped.
    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
    => optionsBuilder.UseNpgsql(
    "",
    options => options.EnableRetryOnFailure(maxRetryCount, maxRetryDelay,
    errorNumbersToAdd));

    View Slide

  25. Connection pooling
    PostgreSQL or MySQL
    pod
    Main
    app
    Main
    app
    Pgbouncer
    Connect
    Connect

    View Slide

  26. Optimize container sizing
    • Some containers may require large
    amount of memory
    • Cron runs memory heavy jobs such as
    indexer which allocates a few GB of
    memory
    • Redis may allocate 4 – 8 GB of
    memory
    Resource requests

    View Slide

  27. Data Platform Virtual Summit 2020 is a community initiative by DataPlatformGeeks
    SCALE AND MANAGE
    AKS CLUSTER AND FLEXIBLE SERVER

    View Slide

  28. Commands to scale up your cluster and database server
    Scale the AKS cluster
    • az aks scale --resource-group myResourcegroup --name myAKSCluster --node-count 1 --
    nodepool-name MyPoolname
    Scale the MySQL database server using these commands. The example below will convert storage
    size to 512 GB and update the pricing tier to Burstable 2vCore
    • az mysql flexible-server update --sku-name Standard_B2s --resource-group
    myResourcegroup –name servername --storage-size 512
    Example for PostgreSQL flexible server
    • az postgres flexible-server update --sku-name Standard_B2s --resource-group
    myResourcegroup –name servername --storage-size 512

    View Slide

  29. Commands to manage your cluster (Start/Stop)
    This is in preview (documentation)
    Install AKS preview CLI
    # Install the aks-preview extension
    az extension add --name aks-preview
    # Update the extension to make sure you have the latest version installed
    az extension update --name aks-preview
    Register Start/Stop preview feature
    az feature register --namespace "Microsoft.ContainerService" --name "StartStopPreview“
    Refresh registration Microsoft.ContainerService resource provider
    az provider register --namespace Microsoft.ContainerService
    Start and Stop the AKS cluster
    az aks stop --name myAKSCLuster –resource-group MyResourcegroup
    az aks start --name myAKSCLuster –resource-group MyResourcegroup

    View Slide

  30. Commands to manage your database server (Start/Stop)
    Start and Stop the MySQL database server
    az mysql flexible-server stop --name servername –resource-group MyResourcegroup
    az mysql flexible-server start --name servername –resource-group MyResourcegroup
    Start and Stop the PostgreSQL database server
    az postgres flexible-server stop --name servername –resource-group MyResourcegroup
    az postgres flexible-server start --name servername –resource-group MyResourcegroup

    View Slide

  31. Data Platform Virtual Summit 2020 is a community initiative by DataPlatformGeeks
    DIAGNOSE APPLICATION ISSUES

    View Slide

  32. Diagnose and Solve experience for AKS

    View Slide

  33. Database Server metrics like CPU usage %

    View Slide

  34. Database Server metrics like Queries
    executed and many more

    View Slide

  35. aka.ms/postgres-flexible-server-docs
    [email protected] [email protected]
    MySQL
    aka.ms/postgres-cloud9
    aka.ms/mysql-flexible-server-docs
    aka.ms/postgres-flexible-blog
    aka.ms/mysql-flexible-blog
    aka.ms/mysql-tenthline

    View Slide

  36. Data Platform Virtual Summit 2020 is a community initiative by DataPlatformGeeks
    QUESTIONS ?

    View Slide

  37. Data Platform Virtual Summit 2020 is a community initiative by DataPlatformGeeks
    Sunitha
    Muthukrishna
    @mksuni
    @AzureDBMySQL
    @AzureDBPostgres
    thank you
    merci
    grazie
    danke
    ध"यवाद
    ευχαριστώ
    gracias
    ధన#$ా&'ల)
    谢谢

    View Slide

  38. APPENDIX

    View Slide

  39. Heading Styling
    • Heading One Style, 28pt
    • Body content, 20pt Segoe UI (gray)
    • Heading Two Style, 24pt
    • Body content, 20pt Segoe UI (gray)
    • HEADING THREE STYLE, 22PT, BOLD, ALL CAPS
    • Body content, 20pt Segoe UI (gray)

    View Slide

  40. SECTION DIVIDER
    Type 1 -

    View Slide

  41. Data Platform Virtual Summit 2020 is a community initiative by DataPlatformGeeks
    SECTION DIVIDER
    Type 2 -

    View Slide

  42. Azure Kubernetes Services
    Provides orchestration with your favorite tools and more
    Development tools Platform
    Azure
    Kubernetes
    Service
    Azure
    Red Hat
    OpenShift
    Azure
    Container
    Instances
    Azure Arc
    Management across environments
    Community
    Active
    Directory
    Azure
    Policy
    Security
    Center
    Key
    Vault
    Azure
    Advisor
    GitHub
    Visual Studio
    Code
    Azure Container
    Registry
    Azure Dev
    Spaces
    Azure
    Monitor

    View Slide

  43. Chart Type 1
    0
    1
    2
    3
    4
    5
    6
    Category 1 Category 2 Category 3 Category 4
    Series 1
    Series 2
    Series 3

    View Slide

  44. Chart Type 2
    Sales
    1st Qtr
    2nd Qtr
    3rd Qtr
    4th Qtr

    View Slide

  45. Table
    Heading 1 Heading 2 Heading 3 Heading 4 Heading 5 Heading 6

    View Slide

  46. Slide for Showing Developer’s
    Software Code
    • Use this layout to show software code
    • The font is Consolas, a monospace font
    • The slide doesn’t use bullets but levels can be indented using the
    “Increase List Level” icon on the Home menu

    View Slide

  47. Video Video Title
    • Add subtitle

    View Slide

  48. Demo Demo Title
    • Name
    • Title
    • Group

    View Slide

  49. Special Thanks To
    for supporting
    DataPlatformGeeks & SQLServerGeeks
    Community Initiatives

    View Slide

  50. Three Ways to Win Prizes
    Post your selfie with hash tag #DPS2020
    Give Session & Conference Feedback
    Visit our Sponsors & Exhibitors
    Thank You
    Follow us on Twitter @TheDataGeeks @DataAISummit

    View Slide