What is Ballerina?
For those of you who do not know what Ballerina is: it is a Cloud Native Programming Language enabling you to create microservices that integrate APIs. It is based on language like Java, Go and is more a true programming language when you compare it to the configuration-based Synapse environment that is core of the current Enterprise Integrator and API Manager. The Keynote was given by Paul Fremantle, the CTO of WSO2. He gave a demo of Ballerina, roughly along the lines of the well-known demo we have seen before. Everything is becoming a network addressable endpoint and the numbers are growing rapidly.
Ballerina, according to Paul, fills the gap in the space between agility and integration. You need something to marry the integration and agility aspects. It is a full programming language that allows for easy integration. The demo starts with HelloWorld and grows increasingly more complex from the perspective of what you want to do, not so much how difficult it is to use ballerina. The HelloWorld example was turned into a service that allows to connect to Twitter and with just a few extra lines allows to make the connection due to the concept of connectors, prebuilt libraries that allow you to quickly use all kinds of online services. The latest editor allows you to edit the diagram and the code is edited. This is something that will interest especially novice Ballerina users.
Ballerina Philosophy
The next presentation was about the language of Ballerina. All programming languages are interconnected, all have high level abstractions in them. For people who are interested in the details of the language and the choices made. The presentation will be online in the week after WSO2Con. Ballerina is a compiled, type safe, concurrent programming language. Ballerina is now runtime build but, in the future, can be compiled into native code.
The presentation gave insight into what you can do with Ballerina and is a must view if you want to get started with Ballerina.
Writing Microservices
The network aspects are built into Ballerina itself. Endpoints and services are concepts in the language. The presentation starts off with endpoints. The listening endpoint is to get messages into the system, the client endpoints are the destination where you want to send it. The endpoints are more than simply a URL. The endpoints supported are roughly the set that the Enterprise Integrator also supports (with optional connectors in EI).
It is possible to convert json to a record directly. There is support for XML enabling inline definition in Ballerina. XML is a Union Type, a new special type construct that allows multiple types in a value.
It allows int | string value getVal(key);
supporting two types; and subsequently match the two situations. Ballerina supports the try catch pattern. Ballerina is secure by default, allowing for instance taint analysis (checking malicious payloads) and of course authentication / Authorization support.
Ballerina supports directly metrics collections (Prometheus, Honeycomb), Tracing (e.g. Zipkin, Jeager, Honeycomb), logging (e.g. ELK) and for Visualization (Grafana). When you need to test Microservices, there is a Test Frame work in Ballerina itself.
You can deploy Ballerina on standalone binary as well as Docker / Kubernetes deployment.
Want to see more?
We hope this bog and our previous blogs of day 1 and day 2 gave you some more insight about this conference. In the below video you can see and hear more about the Ballerina day of WSO2CON EU 2018.