Building a Microservice in Perl (Part 1): Designing the API

Building a Microservice in Perl (Part 1): Designing the API

Building a Microservice in Perl (Part 1): Designing the API - A brief description of microservices, then jumping into defining one with OpenAPI for building with Perl and Mojolicious.

A brief description of microservices, then jumping into defining one with OpenAPI.

A microservice can be thought of as the distributed computing implementation of the  Unix philosophy of "Do one thing and do it well." Usually modeled around specific business domains, a well-designed set of microservices each have their own lifecycle and communicate with each other and with consuming applications via technology-agnostic protocols like  HTTP.

Because of this, a microservice may be implemented using whatever is the best programming language, database, or other environment to fit the job. Perl can be an excellent choice for development because of its strengths as a battle-tested, expressive multi-paradigm language with a  broad open-source library of modules.

In this series of articles, we'll be using Perl, the  Mojolicious web framework, and the  OpenAPI (formerly  Swagger) specification for describing web services to develop an example microservice that adheres to the  REST architectural style for communication over HTTP. Some knowledge of Perl and web development is assumed, and we'll be linking to supporting documentation and literature as we go.

In a full microservices implementation, we would start by modeling the business domains being serviced and the explicit boundaries between them. For the purposes of this series, we are limiting ourselves to developing only one microservice with a trivial purpose-a toy, if you will. This service will act as a simple dictionary allowing consumers to both query for the definitions of words as well as add new entries.

We could envision a variety of consumers: a web front-end, a mobile app, maybe even SMS text messaging. The key is that the design of our application programming interface (API) should not dictate the implementation or lifecycle of any of these consumers, and it should be easy for their developers to understand its specification.

To that end, we turn to  OpenAPI, which gives both our microservice and its consumers an unambiguous machine-readable description of the interface without the need for additional code or documentation. And as we'll see later, we'll use that very same specification to drive our web framework to produce HTTP routes that accept valid input and produce valid output.

tutorial perl swagger openapi microservice design mojolicious

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Building a Microservice in Perl (Part 2): Up and Running

Building a Microservice in Perl (Part 2): Up and Running - In part 1 we designed our API using OpenAPI/Swagger. Now it's time to write some tests and wire it up using Perl and Mojolicious::Plugin::OpenAPI.

Landscapes Website Design | Nature Landscapes Website Designer

DataIT Solutions is one of the top landscapes website design companies offering website design solutions for lawn care or landscaping business.

Introduction to Design Systems for UX/UI Designers

For junior designers - those who have just started studying UX / UI design systems and those who have been working in this field for up to 1-2 years. The main goal of this article is to introduce you to the basic components of system design, to give you a basic introduction to this concept and to revise the material by demonstrating several examples of design systems that are already used by large companies.

UI/UX Design Principles: Guide to Perfect App Designing Process - TopDevelopers.co

Following the app design process and UI/UX design principles rightly guide UI/UX designers to purvey app designs that help in developing efficient mobile apps.

Graphic Design Tutorial | Graphic Design Tutorial for Beginners| Photoshop Tutorial

Great Learning brings you this video “Introduction to Graphic Design with Photoshop”, which aims at helping you get started with the basics of it. We start off by understanding what a Graphic Design is followed by understanding Careers and Application of Graphic Design. Next, we look at Basic Fundamentals of Design, Graphic Elements, etc. and will also take you through a variety of concepts such as typography, colour theory, and so on. Added to this, the video teaches these concepts by carrying out simultaneous demonstrations as well as examples of Graphic Designing on Photoshop!