import ballerina/io;

public function main() {
    io:println("Hello, World!");

Ballerina By Example

Try out the extensive collection of Ballerina by Examples (BBEs) below to grasp the features and concepts of Ballerina.

Language Concepts

Working Over the Network

  • REST API: The behaviour of the HTTP listeners and services.
  • REST Client: The behaviour of the HTTP clients.
  • REST API Security: The security aspects of the REST API clients and services.
  • REST API Advanced: The advanced functionality of the HTTP package.
  • HTTP2 The version upgrade and specific functionality.
  • Resiliency: The resiliency aspect of the HTTP clients.
  • GraphQL: The behaviour of the GraphQL listeners and services.
  • GraphQL Security: The security aspects of the GraphQL listeners and services.
  • WebSockets: The behaviour of the WebSocket listener and clients.
  • WebSub: The behavior of the WebSub Subscribers.
  • Listeners: The behaviour of the listeners.
  • gRPC: The behaviour of the gRPC listeners, services, and clients.
  • NATS: The behaviour of the NATS listener and clients.
  • STAN: The behaviour of the STAN listener and clients.
  • Kafka: The behaviour of the Kafka listener and clients.
  • RabbitMQ: The behaviour of the RabbitMQ listener and clients.
  • TCP: The behaviour of the TCP listener and clients.
  • UDP: The behaviour of the UDP listener and clients.
  • Email: The behaviour of the SMTP, POP3, and IMAP listeners and clients.
  • MySQL: The behaviour of the MySQL DB connector.
  • JDBC: The behaviour of the JDBC DB connector.

Common Libraries

  • IO: Input/output operations using streaming and non-streaming APIs.
  • Security: The cryptography and JWT utilities.
  • URL: The utilities for URL encoding/decoding.
  • Time: UTC and localized time generation and conversions.
  • Cache: The in-memory cache functionalities.
  • Log: Log information when running applications.
  • File: The file, path, and directory operations and behaviour of the directory listener.
  • Random: Generate pseudo-random numbers.
  • Task: Schedule jobs either once or periodically, and manage those jobs.
  • UUID: Generate and inspect UUIDs (Universally Unique Identifier).
  • XSLT: Transform a given XML content to another XML/HTML/plain text.
  • Regex: Manipulate the string by using Regex.
  • OS: Retrieve information about the environment variables of the Operating System.
  • XML Data: The conversion between JSON and XML.


  • Code to Cloud: Generate the Kubernetes YAML files, the Dockerfile, and Docker image for Ballerina Programs.
  • Function as a Service: Create Ballerina functions to run on AWS Lambda or Azure FaaS.


  • Tracing: The usage of traces using the built-in observability features.
  • Metrics: The usage of metrics using the built-in observability features.