01 Day-01-Cloud_Native_Fundamentals on OCI

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 65

Cloud Native Fundamentals

Francesco Paolo Burruano


OCI GTM Senior Product Manager
Andrea Di Placido
Principal ACE

August 2021

Copyright © 2019 Oracle and/or its affiliates.


Safe harbor statement

The following is intended to outline our general product direction. It is intended for information purposes
only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code,
or functionality, and should not be relied upon in making purchasing decisions.

The development, release, timing, and pricing of any features or functionality described for Oracle’s
products may change and remains at the sole discretion of Oracle Corporation.

Copyright © 2019 Oracle and/or its affiliates.


Objectives
After completing this lesson, you should be able to;

• Have a general idea of Cloud Native Application Fundamentals


• Describe the patterns for building cloud-native apps
• Describe the Fallacies of Distributed Systems
• Describe Cloud-Native Building Blocks

Copyright © 2019 Oracle and/or its affiliates.


Introduction to Cloud Native

Copyright © 2019 Oracle and/or its affiliates.


Understanding Cloud-Native
"... natively utilizes service and infrastructure from cloud computing providers"

"... approach to build & run apps that exploit the advantages of the cloud computing model"

"... describes container-based environments, deployed as microservices and managed on elastic infrastructure
through agile DevOps, continuous delivery workflows"

"... build, run, and improve apps based on well-known techniques and technologies for cloud computing"

"... collection of small, independent, and loosely coupled services"

Copyright © 2019 Oracle and/or its affiliates.


Pets vs. cattle
Pets 🐶

• Treat your infrastructure like pets

• Give them names, IP addresses, Care of them, keep


them updated

Cattle 🐮

• Everything is just a number

• No attachment

• If something goes wrong, you replace it

Copyright © 2019 Oracle and/or its affiliates.


Understanding Cloud-Native

Apart from focusing on business logic, you will realize the following when building cloud- native applications
for the first time:

• I am dealing with services running across multiple machines


• I am dealing with network and communication between these services

Copyright © 2019 Oracle and/or its affiliates.


Patterns for building cloud-native apps

Copyright © 2019 Oracle and/or its affiliates.


Cloud-Native vs. Traditional Architectures
Stateful vs. Stateless

• State stored with the compute instance

• Load balancers using sticky sessions

• What happens on reboot or crash

Service orchestration vs. Service choreography

• Multiple services orchestrated to work as one, using sync communication

• Choreography uses eventing system

Dealing with failures

• Minimize failures vs. expect and deal with them

Copyright © 2019 Oracle and/or its affiliates.


CAP Theorem

Copyright © 2019 Oracle and/or its affiliates.


CAP Theorem
• Make compromises
• Partitions will always exist
• Optimize for Consistency or
Availability

• https://
en.wikipedia.org/wiki/CAP_theo
rem

Copyright © 2019 Oracle and/or its affiliates.


Fallacies of Distributed Systems

Copyright © 2019 Oracle and/or its affiliates.


8 Fallacies of Distributed Systems
1. Network is reliable
2. Latency is zero
3. Infinite bandwidth
4. Network is secure
5. Topology does not change
6. There is one administrator
7. Transport cost is zero
8. Network is homogeneous

Copyright © 2019 Oracle and/or its affiliates.


Cloud-Native Building Blocks

Copyright © 2019 Oracle and/or its affiliates.


Microservices vs. Containers vs. Functions
Microservices = architectural style

Functions & Containers = technologies serving a particular purpose

Understand how to best use functions & containers, together with eventing/messaging technologies to design,
develop and operate cloud-native microservices-based applications

Copyright © 2019 Oracle and/or its affiliates.


Microservices

• Service-oriented architecture
• Loosely coupled services
• Organized around business
capability

Copyright © 2019 Oracle and/or its affiliates.


Microservices
• Smaller code bases
• Managed by independent teams
• Independently deployable
• Single, well-defined task
• Communication through APIs
• Own tests, builds, data, deployments

Copyright © 2019 Oracle and/or its affiliates.


Benefits
• Fast(er) verification, deployment, and releases
• Easier to deliver new value
• Use the best tools/frameworks/languages for the job
• Move quicker, faster ramp up time, focus on smaller piece
• One rotten apple won't "poison" other apples
• Able to scale services at di"erent rates
• Easier to measure and observe individual services, specific
functionality

Copyright © 2019 Oracle and/or its affiliates.


Challenges
• Complexity - fallacies of distributed systems
• Decentralized data makes transactions difficult
• Performance - network adds overhead
• Lack of tools for development and testing
• Versioning, backward and forward compatibility
• Inconsistent naming, types, values, etc. when logging and monitoring
• Service dependency management
• Service availability

Copyright © 2019 Oracle and/or its affiliates.


Service Communication Patterns

Copyright © 2019 Oracle and/or its affiliates.


Objectives
After completing this lesson, you should be able to;

• Understand the Service Communication Patterns


• Protocols and their benefits in the communication pattern

Copyright © 2019 Oracle and/or its affiliates.


Service Communication
External communication (North-South)

Communication from/to external services Internal

communication (East-West)

Service-to-service communication (e.g. within a


cluster)

Copyright © 2019 Oracle and/or its affiliates.


Synchronous and Asynchronous

Copyright © 2019 Oracle and/or its affiliates.


Integrating services

• Minimize the communication between internal services


• Try not to depend on sync communication
• Use async between services (propagate data asynchronously)
• Orchestration vs. choreography

Recommended read about Orchestration vs Choreography


https://docs.microsoft.com/en-us/azure/architecture/patterns/choreography

and
https://learning.oreilly.com/library/view/architectural-patterns/9781787287495/4de04c75-e719-4799-a6a7-aaacb58ed11e.xhtml

Copyright © 2019 Oracle and/or its affiliates.


Design for resiliency
• Bulkhead pattern
The Bulkhead pattern is a type of application design that is tolerant of failure. In a bulkhead architecture, elements of an application are isolated into
pools so that if one fails, the others will continue to function
https://docs.microsoft.com/en-us/azure/architecture/patterns/bulkhead
• Circuit Breaker pattern
Handle faults that might take a variable amount of time to recover from, when connecting to a remote service or resource. This can improve the
stability and resiliency of an application.
https://docs.microsoft.com/en-us/azure/architecture/patterns/circuit-breaker
• Retry pattern
Enable an application to handle transient failures when it tries to connect to a service or network resource, by transparently retrying a failed
operation. This can improve the stability of the application.
https://docs.microsoft.com/en-us/azure/architecture/patterns/retry

• Throttling pattern
Control the consumption of resources used by an instance of an application, an individual tenant, or an entire service. This can allow the system to continue to
function and meet service level agreements, even when an increase in demand places an extreme load on resources.
https://docs.microsoft.com/en-us/azure/architecture/patterns/throttling
• Rate Limiting pattern
Many services use a throttling pattern to control the resources they consume, imposing limits on the rate at which other applications or services can access
them. You can use a rate limiting pattern to help you avoid or minimize throttling errors related to these throttling limits and to help you more accurately
predict throughput.
A rate limiting pattern is appropriate in many scenarios, but it is particularly helpful for large-scale repetitive automated tasks such as batch processing.
https://docs.microsoft.com/en-us/azure/architecture/patterns/health-endpoint-monitoring
Design patterns
Design patterns
Test and Deploy Cloud Native
Applications

Copyright © 2019 Oracle and/or its affiliates.


Objectives
After completing this lesson, you should be able to;

• Describe different Testing Methodologies


• Describe various ways to test Cloud Native Applications

Copyright © 2019 Oracle and/or its affiliates.


Testing Cloud-Native Applications

Copyright © 2019 Oracle and/or its affiliates.


Testing

• Can't survive with manual tests


• Reliable, repeatable and automated tests are essential
• Use test doubles (mocks, fakes and stubs) for dependencies

MOCK
Object use to test the calls it receives
FAKE
Object with working implementation (di"erent from a real
implementation)
STUB
Object that returns prepopulated data

Copyright © 2019 Oracle and/or its affiliates.


Test Automation Pyramid

Copyright © 2019 Oracle and/or its affiliates.


Different type of Testing
• Acceptance tests
• Smoke tests
• Integration tests
• Security
• Penetration tests
• Fuzz tests
• Performance tests
• Load tests
• Usability tests
• Chaos tests
• Canary tests
• A/B tests

Copyright © 2019 Oracle and/or its affiliates.


Right time of Testing

When and how often to execute tests?

Unit: during development, before every merge/check-in


Service/Component: before/after every merge/check-in Integration:
before deployments
Canary: run continuously*
Security: automated, part of integration/canary tests if possible

UI: on UI changes, consider automating if UI heavy


Performance: get baselines manually, consider automating for repeatable numbers A/B: as needed, make
sure you have clear goals and metrics defined
Chaos: as needed, for operational readiness, to catch potential prod issues

* can be costly to maintain


Copyright © 2019 Oracle and/or its affiliates.
Testing Environments

Dev → Test → Staging → Production

• Mimic production environment (as closely as possible)

• How to keep environments in sync?

• What's the cost for all this?

• Are you running staging in all regions, just like production

Copyright © 2019 Oracle and/or its affiliates.


Testing and Deployment Strategies
https://github.com/ContainerSolutions/k8s-deployment-strategies

Copyright © 2019 Oracle and/or its affiliates.


Testing and Deployment Strategies
Graphic examples

Copyright © 2019 Oracle and/or its affiliates.


Deployment Strategy
Deployment Strategy
OCI IAM
OCI IAM
Additional Information
• For additional information on Testing Cloud Native Applications, please refer to:
https://www.oreilly.com/library/view/cloud-native-infrastructure/9781491984291/ch06.html
Login with your Oracle SSO

For additional information on Deployment Strategies, refer to:


https://blog.container-solutions.com/kubernetes-deployment-strategies

Copyright © 2019 Oracle and/or its affiliates.


OCI API, SDK & CLI

Prasenjit Sarkar
Oracle Cloud Infrastructure
February 2020

Copyright © 2019 Oracle and/or its affiliates.


Objectives
After completing this lesson, you should be able to;

• Access Oracle Cloud Infrastructure through different ways


• Use Developer Tools with Oracle Cloud Infrastructure
• Describe SDKs provided by Oracle Cloud Infrastructure

Copyright © 2019 Oracle and/or its affiliates.


Different Ways to Access OCI

Resource
Manager

Oracle Cloud
Infrastructure Ansible
Console

Oracle Cloud
Command Line
Infrastructure
Interface (CLI)
APIs

Terraform SDKs
Copyright © 2019 Oracle and/or its affiliates.
REST APIs

The OCI APIs are typical REST APIs that use HTTPS requests and
responses. It describes basic information about using APIs.

• API Reference and Endpoints

• API Errors

• Asynchronous Work Requests

• Request Signatures

Copyright © 2019 Oracle and/or its affiliates.


Command Line Interface (CLI)

• OCI provides a Command Line Interface (CLI) to facilitate


development of custom solutions.

• The CLI is a small footprint tool that can be used on its own or
with the Console to complete Oracle Cloud Infrastructure
tasks.

Copyright © 2019 Oracle and/or its affiliates.


Tools Configuration

List of elements required to Configure the SDKs and other developer


tools to integrate with OCI services
• Required Keys and OCIDs: Details on identity and access management

• SDK and CLI Configuration File: Methods for providing configuration information when using the
SDKs or CLI

Copyright © 2019 Oracle and/or its affiliates.


Software Development Tool Kits (SDKs)

OCI provides several Software Development Kits (SDKs) to facilitate development


of custom solutions.

SDK for Python Ruby Go


Java SDK SDK SDK

Copyright © 2019 Oracle and/or its affiliates.


Installing Oracle Cloud Infrastructure CLI

The command is to run the Installer Script of OCI CLI along with the required
packages.

bash -c "$(curl -L
https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/insta
ll/install.sh
)”

If you want to accept all the default configuration then run this command

curl -L -O https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh
chmod +x install.sh
./install.sh --accept-all-defaults

Copyright © 2019 Oracle and/or its affiliates.


Configuring the Oracle Cloud Infrastructure CLI

The following command is to set up Configuration of OCI CLI:

oci setup config

The command prompts to enter the following inputs during execution:

Enter a Location for config:


Enter a user OCID:
Enter a Tenancy OCID:
Enter a Region:

Copyright © 2019 Oracle and/or its affiliates.


Working with OCI Services with CLI - Check Connectivity

Syntax
oci <service> <type> <action> <options>

This command is used to check the connectivity to OCI:


Oci os ns get

Copyright © 2019 Oracle and/or its affiliates.


Configuring the OCI CLI

The default configuration file name and location for OCI config file is in the .oci/config
directory as shown below:

~/.oci/config

Copyright © 2019 Oracle and/or its affiliates.


Downloading and Configuring SDKs for OCI

• SDK stands for Software Development Kit or Devkit.


• SDK enables to write code to manage OCI resources.
• It is a set of software tools and programs used by developers to
create applications for specific platforms.
• The SDKs available are:

Java SDK Python SDK Ruby SDK Go SDK

GitHub or GitHub or Python


GitHub or Download:
Package Index
Maven RubyGems GitHub
(PyPi)

Copyright © 2019 Oracle and/or its affiliates.


Prerequisites for Working with OCI SDK

OCI SDKs Requirement


• OCI account
• Created User being added to a group with policy that grants the desired
permissions
• Key pair used for signing API requests with the public key uploaded to
OCI
• Within the root compartment of tenancy a policy statement ALLOW
GROUP DEMO.GROUP to manage all-resources IN
COMPARTMENT must be defined to give access to resources in the
tenancy.

Copyright © 2019 Oracle and/or its affiliates.


Downloading and Configuring SDKs for OCI

OCI provides:

• Additional developer tools for automating processes and


facilitating development.

• Toolkit for Eclipse

Copyright © 2019 Oracle and/or its affiliates.


Prerequisites for Working with Python SDK

Python SDK Requirements


• Python version 2.7.5 or 3.5 or latest
• OpenSSL version 1.0.1 or latest
• Uses Cryptography.io library which requires OpenSSL

Copyright © 2019 Oracle and/or its affiliates.


Additional Information
For additional information on API, SDK, CLI, please refer to:
https://docs.cloud.oracle.com/en-us/iaas/Content/devtoolshome.htm

Copyright © 2019 Oracle and/or its affiliates.


DO NOT MISS
Resourse Manager
https://
learn.oracle.com/ols/course/developing-cloud-native-applications-on-oci/35644/75242/1020
28

Terraform advanced
https://
learn.oracle.com/ols/course/developing-cloud-native-applications-on-oci/35644/75242/1020
30
OCI SDKs
OCI SDKs
OCI SDKs
OCI SDKs
Oracle Cloud always free tier:
oracle.com/cloud/free/
OCI training and certification:
cloud.oracle.com/en_US/iaas/training
cloud.oracle.com/en_US/iaas/training/certification
education.oracle.com/oracle-certification-path/pFamily_647

OCI hands-on labs:


ocitraining.qloudable.com/provider/oracle

Oracle learning library videos on YouTube:


youtube.com/user/OracleLearning

Copyright © 2019 Oracle and/or its affiliates.


Click icon to add picture

Thank you

You might also like