DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Lifecycle Microservices With GenAI Tools
  • Artificial Intelligence, Real Consequences: Balancing Good vs Evil AI [Infographic]
  • The Rise of Shadow AI: When Innovation Outpaces Governance
  • Gemma 3: Unlocking GenAI Potential Using Docker Model Runner

Trending

  • Mastering Advanced Traffic Management in Multi-Cloud Kubernetes: Scaling With Multiple Istio Ingress Gateways
  • AI's Dilemma: When to Retrain and When to Unlearn?
  • Comprehensive Guide to Property-Based Testing in Go: Principles and Implementation
  • Unlocking Data with Language: Real-World Applications of Text-to-SQL Interfaces
  1. DZone
  2. Software Design and Architecture
  3. Microservices
  4. Web GenAI Microservices Creation: An Overview

Web GenAI Microservices Creation: An Overview

Create and run a microservice, with a simple prompt from your browser. Download and customize the system in your IDE with rules and Python, all open source!

By 
Val Huber user avatar
Val Huber
DZone Core CORE ·
Oct. 17, 24 · Tutorial
Likes (6)
Comment
Save
Tweet
Share
5.9K Views

Join the DZone community and get the full member experience.

Join For Free
  1. This article will show you how to use GenAI from your browser to create and run a microservice in about a minute. Here is what you'll learn: 
  2. Provide a prompt to a cloud-based microservice appliance, and you get a system with a running database, a web app, and an API.
  3. Collaborate with stakeholders using the web app.
  4. Iterate instantly, to get the requirements right.
  5. Download the created project, and customize it in your IDE to build out the system using Python and Rules — 40x more concise than code.  

All of this is open source.  No runtime or license fees.

Microservices Creation: Get the Requirements Right

We've all seen many projects fail due to difficulties in getting the requirements right. Let's explore that.

Catch 22: Screens Best for Collaboration, But Available Too Late

A common — and frustrating — project experience is:

  • Weeks (or months) to get running screens
  • Then —  after all that investment — stakeholders explore the screens, revealing that the requirements were misunderstood.

So, how do we get the screens — in moments — to collaborate and iterate, to get the requirements right?

Introducing Web GenAI Automation Services

GenAI technology has enabled an exciting new class of software to address this. Products are accessed via your browser and are able to create complete running systems from a natural language prompt. Let's look at one example: Web/GenAI.

Web/GenAI: Get Working Screens Instantly from a Prompt

Web/GenAI creates complete running systems from a prompt.  It works like this:

  1. Create by providing a prompt, right in your Browser. The system creates the microservice in a minute or so.
  2. Runthe microservice.
    1. A database, a web app, and an API
      • No database definition needed, no framework complexity, not even any screen painting
    2. It's live on the web - stakeholders can collaborate and review the app and API
      • Contrast this to wireframes, which provide little insight into the actual data and its behavior
    3. Iterate in just a minute. Rename tables, add new tables, change attributes, all while retaining what you have.
    4. It's not just a wizard - you have a standard project you can download and customize in your IDE, using Python and Rules (described below).

To see it in action, play the video above. Or, run it yourself (link at end).

All that's needed is one minute to create running screens -
collaborate and iterate
to get the requirements right.

Enterprise Class API

The standard JSON:API is enterprise class - multi-table, filtering sorting, pagination, and optimistic locking. Explore it with automatically created Swagger.

Development of a Standard, Fully Customizable Project

Web GenAI may be fast and simple, but it's far more than a wizard. You also get a fully executable project you can download, and customize in your IDE using Python and Rules.  

Automation can also reduce architectural risk. For example, using a manual framework does not ensure aspects such as APIs that provide pagination, optimistic locking, and logic sharing (further discussed below). An automated approach can/should provide these.

The basic process is shown in the thumbnail diagram below:

  1. Inception phase: use Web GenAI to get the requirements right, as described above
  2. Backend development in your IDE, using Python and Rules, further described below

Screenshot of the inception and development phase of Web/GenAI


Architecture

Speed is great, but architecture matters. Let's take a quick look under the hood of how projects are created, developed, and ran.

1. Creation: ChatGPT, API Logic Server

When you provide your prompt, the system:

  1. Invokes ChatGPT to compute a data model
  2. Invokes API Logic Server to create and run an executable Python project from a data model, or an existing database (see references, at end).

Not a FrankenPrompt or low level technical instructions
that require deep framework understanding.

Web GenAI prompts are simple business-level requirements.

2. Development: Your IDE, Code-Based, Models

You can download the created project and customize it in your IDE. And/or, use CodeSpaces, a browser-based version of the popular VSCode IDE.

Your project is completely represented as code. There is a not a formal repository stored as a database or markup files. That means you can use your IDE to debug and manage your project. For example, see below how logic is entered in Python, as a DSL.

The resultant project is not a massive amount of code that is hard to understand and customize. Rather, it is a set of models that are clear and concise.  For example, 

  • the API is not code - it is simply a list of data models
  • the Admin App is not complex HTML and JavaScript - it is a JSON file listing entities and attributes

Models, represented as code,
are easier to manage, debug, understand, and modify.

3. Runtime: Standard 3-Tiered, API-Driven, Container-Based

Clients access the system via the JSON:API, described above. More than access, the API enforces the semantics of your data - the business logic that governs security, and integrity (multi-table derivations and constraints) with automatic transaction bracketing.

The server executes as a container, accessing the database(s) as required. Containers are share-nothing, providing scalability.


A diagram of a created API logic project, illustrating the flows of API clients and ultimate output into the database.


Backend Development: Your IDE, Python, and Rules

Let's now see how you add logic in your IDE, using Python and Rules.

Python

The Python code below illustrates how you can add business logic to format and send Kafka messages for internal application integration. Use your IDE to enter the code, debug it, and manage your source control. Leverage external packages as required - it's a standard Python project.

A screenshot of Python code to demonstrate how to add business logic to format and send Kafka messages.


This combines the speed and simplicity of AI, with the flexibility of a framework.  

Rules Enforce Security and Integrity

A rules engine is provided to automate backend business logic. This is a substantial part of any project - typically nearly half.

Rules address:

  1. Row-level security based on user roles (e.g., use Keycloak for Single Sign-on), and 
  2. Multi-table Derivations and Constraints (with automatic transaction bracketing)

The following rules govern entering and altering orders to enforce the Credit Limit check:

A screenshot demonstrating the setup of Rules.


These 5 rules represent the same logic as 200 lines of code.

Maintenance Automation

While conciseness is perhaps the most salient point, rules provide substantial value in maintenance.  Maintenance often seems to be a matter of archaeology - you spend most of your time reading existing code to figure out where to insert your new code, so that it always called, and in the correct order. 

Rules automate that.

The rules engine plugs into SQLAlchemy events, and monitors updates at the attribute level. Rules that don't apply are pruned. Rules that do apply are executed in an order that respects their system-discovered dependencies. This results in:

  • Your ability to insert new rules anywhere in your code.
  • The system will ensure they are called, and in the correct order.

Unlike Rete engines and some ORMs, rules are highly optimized to eliminate expensive (and often chained) aggregate queries. In the example above, a new Order makes 1 update to Customer, without reading all the existing Orders and OrderDetails to compute the new Balance.

While the GenAI Automation is exciting, you just might conclude it's "come for creation, stay for the rules."

Front End Development

We do not contend that the automatically created app is a customer-facing app.  

This approach is to leverage your existing UI dev tools such as UI frameworks or low code screen painters, by automating the API. In addition to existing UI Dev tools, please explore automation support for Ontimize.

That said, it's worth noting the value that a robust backend can provide to front-end dev:

  • An instant API unblocks UI dev, which is often delayed until the end of the project.
  • Server-enforced declarative logic averts one of the most serious architectural error, placing critical business logic in UI buttons (controllers). This blocks sharing logic between UI apps, and headless services.

Open Deployment

Created projects include scripts to automate docker creation, so you can deploy on your own infrastructure. To try out your own Web GenAI prompt creation, click here.

In summary, if you provide a natural language prompt, and you'll get:

  • A running microservice: Database, API and app, all for collaboration and iteration, to get the requirements right
  • A project: download and customize in your IDE with Python and Rules
  • Deploy as a container in your preferred infrastructure

You can begin collaborating with business users, and extending the project in your IDE.

Integrated development environment microservice generative AI

Published at DZone with permission of Val Huber, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Lifecycle Microservices With GenAI Tools
  • Artificial Intelligence, Real Consequences: Balancing Good vs Evil AI [Infographic]
  • The Rise of Shadow AI: When Innovation Outpaces Governance
  • Gemma 3: Unlocking GenAI Potential Using Docker Model Runner

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!