Visual Programming | Create Microservices/Monoliths Faster Than Cooking 2min Noodles

Rajat Nigam
Geek Culture
Published in
4 min readJan 5, 2022

This blog throws light on low code Drag N Drop platforms that embrace the concept of Visual Programming and suggests how these platforms come in handy when the time to market is a priority.

Node-Red by IBM is one such opensource Drag N Drop platform that is taken as an example in this blog to present a fully-featured event-driven platform.

Node-Red not only simplifies the creational and structural concerns for Software Architects but also helps in curbing staffing problems by promoting flow-based visual programming.

Photo by Shelbey Hunt on Unsplash

What is Visual Programming?

A Visual Programming Language (VPL) is any programming language that lets users create programs by manipulating program elements graphically rather than by specifying them textually.Source: Wikipedia

Benefits of Node-Red

Simplification

As the name no-code/low-code indicates, coding is eliminated and programming is intuitively completed with a minimal number of operations needing to be used.

Efficiency

Node-RED flow editor takes care of building the application execution environment, library synchronization, the integrated development environment (IDE), and editor preparation so that you can concentrate on development.

High Quality

High quality is the true value of flow-based and visual programming. Each node provided as a component is a complete module that has been unit tested.

OpenSource

Node-RED is an open-source piece of software under the Apache2 license.

Node-Red library

Although Node-Red implements all aspects of CRUD operations but also provides placeholders for writing custom logic in NodeJs, for those who find it difficult to practically implement SOLID design principles.

Node-Red alternatives

Setup

docker run -it -p 1880:1880 -v $PWD/data:/data nodered/node-red

Node-Red Based Event Driven Architecture

Event-Driven Microservice Orchestration

1. Implementing Simple REST Controller

HelloProduct Controller
Postman — POST Request

2. Node-Red | MongoDB CRUD Operation

Mlab — Mongo As A Service

MLab

Configure MongoDB in Node-Red

Configure Mongo Instance in Node-Red
Configure Collections & Operations
Create “Item” Microservice
Create “Item” — POST Request
GET By ItemName
GET All “Items”

3. Event-Driven Microservice | Kafka Integration

Cloudkarafka — Multicloud Vendor For Kafka As A Service

Cloudkarafka — Kafka As A Service
Configure Kafka Cluster in Node-Red
Configure Producer
Cart Microservice | CQRS Pattern
Cart Events | POST Request
Cart State Store
Audit Events
Get Cart By UserID | Query Operation

Conclusion

  • Created Event-Driven Microservices without even writing a single line of code.
  • The microservice architecture can be exported in the form of JSON configuration and packaged as a docker image.
  • It takes almost 2min to create an event-driven microservice with Kafka and Mongo integrations using Visual programming.
  • Each component of microservice is unit tested by default.
  • Node-Red offers thousands of npm modules for integrations with multiple channels eg. SMTP, Cloud Services, Messaging Queues, etc.

References

--

--

Rajat Nigam
Geek Culture

I'm a lifetime student of software engineering. Professionally I work in the capacity of Individual Contributor, Trainer, Lead Engineer and an Architect.