Cloud Native Applications with Ballerina: A guide for programmers interested in developing cloud native applications using Ballerina Swan Lake
Book information
Description
Learn how to build scalable cloud native applications with the new-generation Ballerina language using expert tips and best practices Key FeaturesWork with code samples based on the Ballerina Swan Lake Beta1 versionExplore the in-built networking protocol support in Ballerina to develop secure distributed appsBuild a Ballerina app with an automated CI/CD pipeline with observability to simplify maintenance and deploymentBook Description The Ballerina programming language was created by WSO2 for the modern needs of developers where cloud native development techniques have become ubiquitous. Ballerina simplifies how programmers develop and deploy cloud native distributed apps and microservices. Cloud Native Applications with Ballerina will guide you through Ballerina essentials, including variables, types, functions, flow control, security, and more. You'll explore networking as an in-built feature in Ballerina, which makes it a first-class language for distributed computing. With this app development book, you'll learn about different networking protocols as well as different architectural patterns that you can use to implement services on the cloud. As you advance, you'll explore multiple design patterns used in microservice architecture and use serverless in Amazon Web Services (AWS) and Microsoft Azure platforms. You will also get to grips with Docker, Kubernetes, and serverless platforms to simplify maintenance and the deployment process. Later, you'll focus on the Ballerina testing framework along with deployment tools and monitoring tools to build fully automated observable cloud applications. By the end of this book, you will have learned how to apply the Ballerina language for building scalable, resilient, secured, and easy-to-maintain cloud native Ballerina projects and applications. What you will learnUnderstand the concepts and models in cloud native architectureGet to grips with the high-level concepts of building applications with the Ballerina languageUse cloud native architectural design patterns to develop cloud native Ballerina applicationsDiscover how to automate, maintain, and observe cloud native Ballerina applicationsUse a container to deploy and maintain a Ballerina application with Docker and KubernetesExplore serverless architecture and use Microsoft Azure and the AWS platform to build serverless applicationsWho this book is for This Ballerina Swan Lake book is for cloud developers, integration developers, and microservices developers who are facing challenges with legacy tooling and are looking for the latest tools and technologies to solve them. Beginner-level programming knowledge is required before getting started with this Ballerina book. Table of ContentsIntroduction to Cloud-nativeGetting Started with BallerinaBuilding Cloud Native Applications with BallerinaInterprocess Communication and MessagingAccess Data in Microservices ArchitectureMoving on to Serverless ArchitectureSecuring Ballerina Cloud PlatformMonitoring Cloud Native ApplicationsIntegrating Ballerina Cloud Native ApplicationsBuilding CI CD Pipeline for Ballerina Applications Cover Title Page Copyright Credits Contributors About reviewers Table of Contents Preface Section 1: The Basics Chapter 1: Introduction to Cloud Native Evolution from the monolithic to the microservice architecture The N-tier architecture in monolithic applications Monolithic application architecture The ESB simplifies SOA The emergence of microservices Understanding what cloud native architecture is Cloud computing Serverless architecture Definition of cloud native Why should you select a cloud native architecture? Challenges of cloud native architecture Security and privacy The complexity of the system Cloud lock-in Deploying cloud native applications Design is complex and hard to debug Testing cloud native applications Placing Ballerina on cloud native architecture Building cloud native applications The twelve-factor app Code base Dependencies Config Backing services Dev/prod parity Admin processes API-first design The 4+1 view model Building an order management system Breaking down services Impact on organizations when moving to cloud native Challenges of moving to a cloud native architecture Outdated technologies Building cloud native delivery pipelines Interservice communication and data persistence Conway’s law Netflix’s story of moving to cloud native architecture Summary Questions Further reading Answers Chapter 2: Getting Started with Ballerina Technical requirements Introduction to the Ballerina language A glimpse of Ballerina The Ballerina compiler The Ballerina threading model Setting up a Ballerina environment Downloading and installing Ballerina Setting up VS Code Using VS Code to develop a Ballerina application Writing a simple "hello world" program Building a Ballerina project Understanding the Ballerina type system Simple types Structured types Sequence types Behavioral types Other types Working with types Using types to build applications with Ballerina Controlling program flow Ballerina functions Treating functions as variables The Ballerina main function Working with Ballerina classes Ballerina objects Error handling Using custom errors Summary Questions Answers Section 2: Building Microservices with Ballerina Chapter 3: Building Cloud Native Applications with Ballerina Technical requirements Ballerina cloud native syntaxes and features The role of Ballerina in cloud native architecture Building a Ballerina HTTP service Passing data to HTTP resources Using query parameters on an HTTP server Passing structured data to HTTP services Invoking remote HTTP services Ballerina JSON support Working with XML format in the Ballerina language Ballerina remote methods Containerizing applications with Ballerina Introduction to containers Containers versus VMs Containerizing applications with Docker Building a Docker image with Ballerina Using Ballerina's development Docker image Container orchestration with Kubernetes Introduction to Kubernetes Generating Kubernetes artifacts with Ballerina Utilizing Kubernetes resources Using config maps in the Kubernetes cluster Configuring a Kubernetes health check for Ballerina services Using Kustomize to modify Ballerina Kubernetes configurations Summary Questions Further reading Answers Chapter 4: Inter-Process Communication and Messaging Technical requirements Communication between services in a microservice architecture Communication over services in the Kubernetes cluster Using environment variables for service discovery Using the Kubernetes DNS resolver for service discovery Using a service mesh to simplify inter-service communication Service discovery in a service mesh by using Consul Using resiliency patterns in Ballerina Ballerina client-side load balancing Synchronous communication Handling HTML form data Building a Ballerina backend with GraphQL Using the OpenAPI Specification with Ballerina Building a chat application with WebSocket Building Ballerina services with the gRPC protocol Asynchronous communication Asynchronous communication over microservices Building the publisher and subscriber pattern with Apache Kafka Connecting Ballerina with Kafka Connecting Ballerina with RabbitMQ Summary Questions Further reading Answers Chapter 5: Accessing Data in Microservice Architecture Technical requirements Accessing data with Ballerina Connecting the Ballerina application with MySQL Querying from MySQL Using parameterized queries Using batch execution MySQL data types and Ballerina data types Connecting databases with JDBC drivers Connecting Ballerina application with DaaS platforms Managing transactions in Ballerina Building an order management system Initializing the MySQL database for the order management system Building an order management system with Ballerina Understanding ACID properties Ballerina transaction management The database-per-service design pattern The role of Domain-Driven Design in cloud native architecture Creating aggregates with Ballerina Distributed transactions with saga Building a saga orchestrator with Ballerina Using event sourcing and CQRS in a distributed system Using events to communicate among services Developing with event sourcing Creating aggregates with event sourcing Creating snapshots Querying in microservice architecture Summary Questions Further reading Answers Section 3: Moving on with Cloud Native Chapter 6: Moving on to Serverless Architecture Technical requirements Introducing serverless architecture Developing Ballerina applications with Azure Functions Introducing Azure cloud features Building serverless applications with the Azure cloud Building Ballerina applications with Azure Queue Developing Ballerina applications with AWS Lambda functions Understanding AWS Cloud services Configuring the AWS CLI and AWS Console Creating your first Ballerina AWS Lambda function Adding triggers to invoke a Lambda function Using AWS Step Functions with an AWS Lambda function Building the Lambda function with Ballerina Creating Step functions in the AWS Console Creating an API gateway to invoke Step functions Summary Questions Further reading Answers Chapter 7: Securing the Ballerina Cloud Platform Technical requirements Managing certificates in Ballerina applications Securing the Ballerina service with HTTPS Calling an HTTPS endpoint with Ballerina Securing Ballerina interservice communication with mutual SSL Authenticating and authorizing with LDAP user stores Authenticating and authorizing users with the LDAP server Setting up Apache Directory Studio Authenticating and authorizing Ballerina services with LDAP Token-based authorization with Ballerina Securing Ballerina services with a JSON Web Token Generating and validating a JWT with Ballerina Generating JWT with WSO2 Identity Server Authorizing Ballerina services with JWT Authorizing Ballerina services with WSO2 IS-generated JWT claims Building a Ballerina service with JWT authorization OAuth2 authentication and authorization with WSO2 IS Summary Questions Further reading Answers Chapter 8: Monitoring Cloud Native Applications Technical requirements Introduction to observability and monitoring Observability versus monitoring Ballerina logging Printing logs with Ballerina Using Logstash to collect logs Using Logstash with Filebeat in container environments Using Elasticsearch to collect logs Using Kibana to analyze Ballerina logs Tracing with Ballerina Understanding the OpenTelemetry standard Using Jaeger as a tracing platform Monitoring the Ballerina application with Jaeger Creating custom spans with the Ballerina language Collecting and visualizing metrics with Ballerina Exposing metrics from Ballerina Collecting metrics with Prometheus Visualizing metrics with Grafana Creating custom metrics with Ballerina Summary Questions Answers Further reading Chapter 9: Integrating Ballerina Cloud Native Applications Technical requirements Fronting Ballerina services with an API gateway Building an API gateway with Ballerina Setting up and using WSO2 API Microgateway Using interceptors in Microgateway with Ballerina Building Ballerina integration flows with Choreo Introduction to Choreo low-code development Building HTTP services with Choreo Integrating services with Choreo Summary Questions Answers Chapter 10: Building a CI/CD Pipeline for Ballerina Applications Technical requirements Testing Ballerina applications Testing cloud native applications Writing a simple test in the Ballerina language Writing test functions with the Ballerina test framework Ballerina test reports Understanding Ballerina's testing life cycle Grouping Ballerina tests Mocking functions with Ballerina Automating a cloud native application's delivery process CI/CD pipeline in a cloud native application Using GitHub Actions with Ballerina Setting up GitHub Actions Building and deploying applications with Ballerina Central Introduction to Ballerina Central Building and publishing packages in Ballerina Central Publishing packages to Ballerina Central with GitHub Actions Using Ballerina Central packages Summary Questions Further reading Answers Other Books You May Enjoy Index
Similar books
Cloud Native Applications with Ballerina: A guide for programmers interested in developing cloud native applications using Ballerina Swan Lake
2021 · EPUB
MySQL® Notes for Professionals book
2018 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
Session C11: Ancient Cultural Landscapes in South Europe – their Ecological Setting and Evolution, Session C22: Gardeners from South America, Session S04: Agro-Pastoralism and Early Metallurgy Sessions, Session WS29: The Idea of Enclosure in Recent Iberian Prehistory, Session C88: Rhytmes et causalites des dynamiques de l'anthropisation en Europe entre 6500 ET 500 BC: Hypotheses socio-culturelles et/ou climatiques: Proceedings of the XV UISPP World Congress (Lisbon 4-9 September 2006) / Actes du XV Congrès Mondial (Lisbonne 4-9 Septembre 2006) Vol.36
2010 · PDF
THE BRITISH ARMY IN INDIA: ITS PRESERVATION BY AN APPROPRIATE CLOTHING, HOUSING, LOCATING, RECREATIVE EMPLOYMENT, AND HOPEFUL ENCOURAGEMENT OF THE TROOPS. with AN APPENDIX ON INDIA : THE CLIMATE OP ITS HILLS ; THE DEVELOPMENT OF ITS RESODRCBS, INDUSTRY, AND ARTS ; THE ADMINISTRATION OF JUSTICE ; THE BLACK ACT ; THE PROGRESS OF CHRISTIANITY ; THE TRAFFIC IN OPIUM ; THE VALUE OF INDIA ; PERMANENT CAUSES OF DISAFFECTION, AND OF THE RECENT REBELLION ; THE TRADITIONARY POLICY; MISGOVERNMENT BY NATIVE RULERS ; ANNEXATIONS OF THEIR TERRITORY, ETC.
1858 · PDF
Idries Shah 27 Books Collection : A Perfumed Scorpion, A Veiled Gazelle, Caravan of Dreams, Darkest England, Destination Mecca, Evenings with Idries Shah, Knowing How to Know, Learning How to Learn, Letters and Lectures of Idries Shah, Neglected aspects of Sufi study, Observations, Oriental Magic, Reflections, Seeker after Truth, Special Illumination, Special Problems in the study of Sufi ideas, Sufi thought and action, Tales of the Dervishes, The Dermis Probe, The Elephant in the Dark, The Englishman Handbook, Idries Shah Antology, The Magic Monastery, The natives are restless, wisdom of the Idiots PDF.
2022 · PDF
The travels of Capts. Lewis and Clarke from St. Louis, by way of the Missouri and Columbia rivers, to the Pacific ocean; performed in the years 1804, 1805 & 1806, by order of the government of the United States. Containing delineations of the manners, customs, religion, &c. of the Indians, comp. from various authentic sources, and original documents, and a summary of the Statistical view of the Indian nations, from the official communication of Meriwether Lewis. Illustrated with a map of the country, inhabited by the western tribes of Indians
1809 · PDF