<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Maurizio Turatti</title>
    <description>The latest articles on Forem by Maurizio Turatti (@mkjsix).</description>
    <link>https://forem.com/mkjsix</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F504306%2Fb149f52b-7ecd-4e35-98fc-d623933d6c1a.jpeg</url>
      <title>Forem: Maurizio Turatti</title>
      <link>https://forem.com/mkjsix</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/mkjsix"/>
    <language>en</language>
    <item>
      <title>Facet: The data-driven Web framework</title>
      <dc:creator>Maurizio Turatti</dc:creator>
      <pubDate>Tue, 10 Feb 2026 11:12:59 +0000</pubDate>
      <link>https://forem.com/mkjsix/facet-the-data-driven-web-framework-544b</link>
      <guid>https://forem.com/mkjsix/facet-the-data-driven-web-framework-544b</guid>
      <description>&lt;p&gt;Facet is a new kind of Web Framework: it transforms JSON into server-rendered HTML using path-based templates. Templates simply mirror your API structure. The same endpoint serves JSON to clients and HTML to browsers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building Data-Driven Web Apps Without the Backend Complexity
&lt;/h2&gt;

&lt;p&gt;Facet brings Java's production-grade reliability with PHP's rapid development experience. Map MongoDB collections to HTML templates through convention, no controllers, no ORMs. Hot reload during development, deploy as a single JAR or native binary with sub-100ms startup.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;Modern web development forces you to choose:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Spring Boot?&lt;/strong&gt; Powerful but complex—controllers, services, repositories, configuration files, dependency injection&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Laravel/Django/Rails?&lt;/strong&gt; Fast development but requires careful operational tuning for production scale&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Modern SPAs?&lt;/strong&gt; Build separate frontend and backend, manage state, loading states, API orchestration&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Headless CMS?&lt;/strong&gt; Pay for features you don't need, locked into proprietary systems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What if you could get &lt;strong&gt;Java's performance&lt;/strong&gt; with &lt;strong&gt;PHP's simplicity&lt;/strong&gt;?&lt;/p&gt;

&lt;h2&gt;
  
  
  Meet Facet
&lt;/h2&gt;

&lt;p&gt;Facet is a data-driven web framework that transforms MongoDB REST APIs into server-rendered HTML. Convention over configuration means your collections become web pages automatically—no backend code needed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hybrid API/UI from the same endpoint:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# JSON for APIs&lt;/span&gt;
curl &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Accept: application/json"&lt;/span&gt; http://localhost:8080/shop/products

&lt;span class="c"&gt;# HTML for browsers  &lt;/span&gt;
curl &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Accept: text/html"&lt;/span&gt; http://localhost:8080/shop/products
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The same code, same data, different representation. Templates are opt-in—add HTML rendering only where you need it. Your REST API remains unchanged.&lt;/p&gt;

&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Convention-Based Template Resolution
&lt;/h3&gt;

&lt;p&gt;Your template structure mirrors your API paths:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Request: GET /shop/products
         Accept: text/html

Facet looks for:
1. templates/shop/products/index.html   ✓ (found!)
2. templates/shop/index.html            (parent fallback)
3. templates/index.html                 (global fallback)
4. No template → return JSON            (API unchanged)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;SSR is opt-in per resource.&lt;/strong&gt; Add templates only where you need HTML.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Rich Template Context
&lt;/h3&gt;

&lt;p&gt;Templates automatically receive:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight twig"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;database&lt;/span&gt; &lt;span class="cp"&gt;}}&lt;/span&gt;/&lt;span class="cp"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;collection&lt;/span&gt; &lt;span class="cp"&gt;}}&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;

&lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nv"&gt;item&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nv"&gt;items&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"product"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;item.data.name&lt;/span&gt; &lt;span class="cp"&gt;}}&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;item.data.description&lt;/span&gt; &lt;span class="cp"&gt;}}&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;span&amp;gt;&lt;/span&gt;$&lt;span class="cp"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;item.data.price&lt;/span&gt; &lt;span class="cp"&gt;}}&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;endfor&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;

&lt;span class="c"&gt;{# Pagination built-in #}&lt;/span&gt;
&lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nv"&gt;totalPages&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;1&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;nav&amp;gt;&lt;/span&gt;
    &lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nv"&gt;p&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nv"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;totalPages&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nv"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"?page=&lt;/span&gt;&lt;span class="cp"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;p&lt;/span&gt; &lt;span class="cp"&gt;}}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;p&lt;/span&gt; &lt;span class="cp"&gt;}}&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
    &lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;endfor&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/nav&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;endif&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Context includes: pagination, authentication, permissions, MongoDB query parameters, and more.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. First-Class HTMX Support
&lt;/h3&gt;

&lt;p&gt;Facet automatically detects HTMX requests and routes to fragment templates:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Full page template:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight twig"&gt;&lt;code&gt;&lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;extends&lt;/span&gt; &lt;span class="s2"&gt;"layout"&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;

&lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;block&lt;/span&gt; &lt;span class="nv"&gt;main&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"product-list"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;include&lt;/span&gt; &lt;span class="s2"&gt;"_fragments/product-list"&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;form&lt;/span&gt; &lt;span class="na"&gt;hx-get=&lt;/span&gt;&lt;span class="s"&gt;"/shop/products"&lt;/span&gt;
        &lt;span class="na"&gt;hx-target=&lt;/span&gt;&lt;span class="s"&gt;"#product-list"&lt;/span&gt;
        &lt;span class="na"&gt;hx-indicator=&lt;/span&gt;&lt;span class="s"&gt;"#loading"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"filter"&lt;/span&gt; &lt;span class="na"&gt;placeholder=&lt;/span&gt;&lt;span class="s"&gt;"Search..."&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"submit"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Search&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;endblock&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Fragment template&lt;/strong&gt; (&lt;code&gt;templates/_fragments/product-list.html&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight twig"&gt;&lt;code&gt;&lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nv"&gt;item&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nv"&gt;items&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;article&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;item.data.name&lt;/span&gt; &lt;span class="cp"&gt;}}&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;item.data.description&lt;/span&gt; &lt;span class="cp"&gt;}}&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;span&amp;gt;&lt;/span&gt;$&lt;span class="cp"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;item.data.price&lt;/span&gt; &lt;span class="cp"&gt;}}&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/article&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;endfor&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When HTMX sends &lt;code&gt;HX-Target: #product-list&lt;/code&gt;, Facet automatically renders just the fragment—no backend code needed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick Start
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Start Facet and MongoDB
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-O&lt;/span&gt; https://getfacet.org/docker-compose.yml
docker-compose up &lt;span class="nt"&gt;-d&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Create Database and Add Data
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Create collection&lt;/span&gt;
curl &lt;span class="nt"&gt;-X&lt;/span&gt; PUT http://localhost:8080/shop/products

&lt;span class="c"&gt;# Insert products&lt;/span&gt;
curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST http://localhost:8080/shop/products &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'[
    {"name": "Laptop", "price": 999},
    {"name": "Mouse", "price": 29}
  ]'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Create Template
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; templates/shop/products
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;templates/shop/products/index.html:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight twig"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Products&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://unpkg.com/htmx.org@2.0.8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;main&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Products&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"product-list"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nv"&gt;item&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nv"&gt;items&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;article&amp;gt;&lt;/span&gt;
          &lt;span class="nt"&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;item.data.name&lt;/span&gt; &lt;span class="cp"&gt;}}&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
          &lt;span class="nt"&gt;&amp;lt;span&amp;gt;&lt;/span&gt;$&lt;span class="cp"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;item.data.price&lt;/span&gt; &lt;span class="cp"&gt;}}&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/article&amp;gt;&lt;/span&gt;
      &lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;endfor&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. Visit in Browser
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;open http://localhost:8080/shop/products
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✨ That's it! You have a working web application with zero backend code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real-World Example
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://github.com/SoftInstigate/facet/tree/master/examples/product-catalog" rel="noopener noreferrer"&gt;product catalog example&lt;/a&gt; demonstrates a complete application with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ MongoDB data binding and display&lt;/li&gt;
&lt;li&gt;✅ Search and filtering with MongoDB queries&lt;/li&gt;
&lt;li&gt;✅ Pagination with preserved query parameters&lt;/li&gt;
&lt;li&gt;✅ HTMX partial updates for dynamic search&lt;/li&gt;
&lt;li&gt;✅ Authentication &amp;amp; role-based access control&lt;/li&gt;
&lt;li&gt;✅ Full CRUD operations (admin only)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Try it yourself:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/SoftInstigate/facet.git
&lt;span class="nb"&gt;cd &lt;/span&gt;facet/examples/product-catalog
docker-compose up
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Visit &lt;a href="http://localhost:8080/shop/products" rel="noopener noreferrer"&gt;http://localhost:8080/shop/products&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Login credentials: &lt;code&gt;admin&lt;/code&gt; / &lt;code&gt;secret&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The example includes hot-reload—edit templates and see changes instantly without restart.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why This Approach?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  For Simple Projects
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No backend coding&lt;/strong&gt; - Templates directly render API data&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Convention over configuration&lt;/strong&gt; - No route wiring, templates map to URLs automatically&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hot reload&lt;/strong&gt; - Edit templates, refresh browser, see changes instantly (no build step, no webpack, no npm scripts)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Progressive enhancement&lt;/strong&gt; - Start with JSON API, add HTML where needed&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  For Complex Projects
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Flexible layouts&lt;/strong&gt; - Different layouts per application area&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Framework agnostic&lt;/strong&gt; - Use any CSS/JS framework (React, Alpine.js, Tailwind, etc.)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTMX native&lt;/strong&gt; - Build SPA-like experiences with server-side rendering&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SEO friendly&lt;/strong&gt; - Server-rendered HTML from the start&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Extensible&lt;/strong&gt; - Add custom logic via RESTHeart plugins (Java or JavaScript via GraalVM)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  For Teams
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Separation of concerns&lt;/strong&gt; - Web devs work on templates, backend devs on API&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No deployment coupling&lt;/strong&gt; - Templates update without backend changes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gradual adoption&lt;/strong&gt; - Add HTML to existing APIs incrementally&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Architecture Benefits
&lt;/h2&gt;

&lt;p&gt;Facet leverages &lt;strong&gt;RESTHeart&lt;/strong&gt;'s production-grade features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;MongoDB REST API&lt;/strong&gt; with full query support&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Authentication&lt;/strong&gt; (JWT, Basic Auth, OAuth, LDAP)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Authorization&lt;/strong&gt; with fine-grained ACL&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;WebSocket&lt;/strong&gt; and Change Streams for real-time data&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GraphQL&lt;/strong&gt; support (coming soon to Facet templates)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Plugins&lt;/strong&gt; for custom business logic&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You get &lt;strong&gt;enterprise-grade infrastructure&lt;/strong&gt; without building it yourself.&lt;/p&gt;

&lt;h2&gt;
  
  
  When to Use Facet
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Great fit:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ Content-driven applications (blogs, catalogs, dashboards)&lt;/li&gt;
&lt;li&gt;✅ Internal tools and admin panels&lt;/li&gt;
&lt;li&gt;✅ MongoDB-backed applications&lt;/li&gt;
&lt;li&gt;✅ Projects prioritizing SEO and fast initial load&lt;/li&gt;
&lt;li&gt;✅ Teams wanting to avoid frontend/backend coordination&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Not ideal for:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;❌ Highly interactive applications with complex client-side state&lt;/li&gt;
&lt;li&gt;❌ Non-MongoDB databases (Facet is MongoDB-specific)&lt;/li&gt;
&lt;li&gt;❌ Applications requiring real-time collaboration (though RESTHeart supports WebSockets)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How Does Facet Compare?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  vs. Spring Boot and Java MVC Frameworks
&lt;/h3&gt;

&lt;p&gt;Spring Boot is powerful but complex: controllers, services, repositories, configuration files, build tools, and dependency injection. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Facet eliminates this boilerplate:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ MongoDB collections automatically become web pages through convention-based templates&lt;/li&gt;
&lt;li&gt;✅ No controllers, no ORMs, no XML configuration&lt;/li&gt;
&lt;li&gt;✅ Hot reload templates without restart&lt;/li&gt;
&lt;li&gt;✅ Get Java's performance without Java's ceremony&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Performance:&lt;/strong&gt; Same JVM benefits (sub-100ms startup with native images, ~50MB memory footprint, handle thousands of concurrent connections)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When to use Spring Boot instead:&lt;/strong&gt; Complex business logic requiring extensive service layers, non-MongoDB databases, or team already invested in Spring ecosystem&lt;/p&gt;

&lt;h3&gt;
  
  
  vs. Laravel, Django, Rails
&lt;/h3&gt;

&lt;p&gt;PHP and Python frameworks are great for rapid development, but they require careful operational tuning for production scale.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Facet gives you the same rapid development experience:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ Convention over configuration&lt;/li&gt;
&lt;li&gt;✅ Hot reload during development
&lt;/li&gt;
&lt;li&gt;✅ Minimal boilerplate&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;But runs on the battle-tested JVM:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ Deploy with confidence—no PHP-FPM tuning, no WSGI complexity&lt;/li&gt;
&lt;li&gt;✅ Sub-100ms startup with native images&lt;/li&gt;
&lt;li&gt;✅ ~50MB memory footprint&lt;/li&gt;
&lt;li&gt;✅ Handle thousands of concurrent connections out of the box&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;When to use Laravel/Django instead:&lt;/strong&gt; Team expertise in PHP/Python, need for framework-specific packages, or using PostgreSQL/MySQL&lt;/p&gt;

&lt;h3&gt;
  
  
  vs. Modern SPAs (React, Vue, Angular)
&lt;/h3&gt;

&lt;p&gt;SPAs excel at highly interactive applications but add complexity:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Facet simplifies:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ Server-rendered HTML by default (SEO-friendly from day one)&lt;/li&gt;
&lt;li&gt;✅ No state management, loading states, or API orchestration needed&lt;/li&gt;
&lt;li&gt;✅ HTMX for SPA-like interactivity without build tools&lt;/li&gt;
&lt;li&gt;✅ Progressive enhancement—add interactivity where needed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;When to use SPAs instead:&lt;/strong&gt; Highly interactive applications with complex client-side state (think Gmail, Figma, or real-time collaboration tools)&lt;/p&gt;

&lt;h3&gt;
  
  
  vs. Headless CMS (Contentful, Strapi)
&lt;/h3&gt;

&lt;p&gt;Headless CMSs provide content modeling and APIs:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Facet offers:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ More flexibility—not limited to content modeling paradigms&lt;/li&gt;
&lt;li&gt;✅ Direct MongoDB access with full query power&lt;/li&gt;
&lt;li&gt;✅ Open source—run anywhere, no vendor lock-in&lt;/li&gt;
&lt;li&gt;✅ No licensing costs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;When to use Headless CMS instead:&lt;/strong&gt; Non-technical content editors need a UI, or you need advanced content workflows and localization&lt;/p&gt;

&lt;h2&gt;
  
  
  Performance &amp;amp; Deployment
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Choose Your Runtime
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;GraalVM JDK&lt;/strong&gt; (with JavaScript extensibility):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;~1s startup time&lt;/li&gt;
&lt;li&gt;~150MB memory footprint&lt;/li&gt;
&lt;li&gt;Support for JavaScript plugins via GraalVM&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Native Image&lt;/strong&gt; (maximum performance):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&amp;lt;100ms startup time
&lt;/li&gt;
&lt;li&gt;~50MB memory footprint&lt;/li&gt;
&lt;li&gt;Single binary, no Java installation required&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both configurations handle thousands of concurrent requests efficiently. MongoDB queries stream directly to templates—no ORM overhead.&lt;/p&gt;

&lt;h3&gt;
  
  
  Production Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Template caching&lt;/strong&gt; - Compiled templates cached for optimal performance&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ETag support&lt;/strong&gt; - Browser caching with 304 Not Modified responses&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MongoDB indexes&lt;/strong&gt; - RESTHeart leverages your database indexes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stateless design&lt;/strong&gt; - Horizontal scaling is trivial&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Single artifact&lt;/strong&gt; - Deploy as JAR or native binary&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;12-factor compliant&lt;/strong&gt; - Environment-based configuration, health checks built in&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Deployment Options
&lt;/h3&gt;

&lt;p&gt;Deploy anywhere:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Docker containers&lt;/li&gt;
&lt;li&gt;Kubernetes clusters
&lt;/li&gt;
&lt;li&gt;AWS, Azure, Google Cloud&lt;/li&gt;
&lt;li&gt;Bare metal servers&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Documentation:&lt;/strong&gt; &lt;a href="https://getfacet.org/docs" rel="noopener noreferrer"&gt;https://getfacet.org/docs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/SoftInstigate/facet" rel="noopener noreferrer"&gt;https://github.com/SoftInstigate/facet&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt; &lt;a href="https://github.com/SoftInstigate/facet/tree/master/examples/product-catalog" rel="noopener noreferrer"&gt;Product Catalog Tutorial&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;RESTHeart Docs:&lt;/strong&gt; &lt;a href="https://restheart.org/docs" rel="noopener noreferrer"&gt;https://restheart.org/docs&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  License
&lt;/h2&gt;

&lt;p&gt;Facet is &lt;strong&gt;Apache 2.0&lt;/strong&gt; licensed—free for commercial use. Built on RESTHeart (AGPL v3 core, Apache 2.0 plugin interfaces).&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Facet brings together the best of two worlds: Java's production-grade reliability and performance with the rapid development experience of PHP or Python frameworks. Convention over configuration, hot reload during development, deploy as a single JAR or native binary.&lt;/p&gt;

&lt;p&gt;If you're building data-driven applications and want to skip the backend boilerplate while maintaining production-grade performance, give Facet a try.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quick start:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-O&lt;/span&gt; https://getfacet.org/docker-compose.yml
docker-compose up &lt;span class="nt"&gt;-d&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Or explore the product catalog example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/SoftInstigate/facet.git
&lt;span class="nb"&gt;cd &lt;/span&gt;facet/examples/product-catalog
docker-compose up
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>webdev</category>
      <category>opensource</category>
      <category>api</category>
      <category>mongodb</category>
    </item>
    <item>
      <title>Side effects of AI on open source</title>
      <dc:creator>Maurizio Turatti</dc:creator>
      <pubDate>Mon, 19 Jan 2026 09:20:29 +0000</pubDate>
      <link>https://forem.com/mkjsix/side-effects-of-ai-on-open-source-3ja8</link>
      <guid>https://forem.com/mkjsix/side-effects-of-ai-on-open-source-3ja8</guid>
      <description>&lt;p&gt;One of the side effects of massive AI adoption in programming is how that impacts some open source projects.&lt;/p&gt;

&lt;p&gt;Tailwind CSS is a successful CSS library. Unlike other frameworks, like Bootstrap, it does not provide a series of predefined classes for elements such as buttons or tables. Instead, it creates a list of "utility" CSS classes that can be used to style each element by mixing and matching.&lt;/p&gt;

&lt;p&gt;AI is creating pressure on the commercial offering from Tailwind because it is now easy for AI to recombine the elements to create full web components. So no reasons to buy their high-level commercial components.&lt;/p&gt;

&lt;p&gt;I've seen this firsthand. While building a new website with AI assistance, I didn't use any CSS framework at all. The AI generated custom, responsive styles from scratch, and the results are clean and professional.&lt;/p&gt;

&lt;p&gt;According to &lt;a href="https://www.opensourceforu.com/2026/01/tailwind-css-collapses-under-ai-usage-rescued-by-google-vercel-lovable/" rel="noopener noreferrer"&gt;this article&lt;/a&gt;, Tailwind has faced significant challenges from this shift, though they've recently secured backing from Google, Vercel, and Lovable to adapt their model.&lt;/p&gt;

&lt;p&gt;This raises a bigger question: if AI can generate what you used to sell, how do open source projects sustain themselves commercially? The old model of "free core + paid convenience layer" may need rethinking when AI provides that convenience layer for free.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>ai</category>
    </item>
    <item>
      <title>Is Java a verbose programming language?</title>
      <dc:creator>Maurizio Turatti</dc:creator>
      <pubDate>Tue, 23 Dec 2025 08:55:49 +0000</pubDate>
      <link>https://forem.com/mkjsix/is-java-a-verbose-programming-language-25eg</link>
      <guid>https://forem.com/mkjsix/is-java-a-verbose-programming-language-25eg</guid>
      <description>&lt;p&gt;&lt;strong&gt;Short answer&lt;/strong&gt;: Most complaints about Java’s verbosity are based on Java 8-era Java. Since 2014, the language has evolved significantly, and many of those criticisms no longer hold.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the “Java is verbose” criticism is outdated
&lt;/h2&gt;

&lt;p&gt;People usually mean three things by “verbose,” all of which were largely true in Java 8:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Boilerplate-heavy data modeling&lt;/li&gt;
&lt;li&gt;Clumsy control flow&lt;/li&gt;
&lt;li&gt;Ceremonial program structure&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The real issue
&lt;/h3&gt;

&lt;p&gt;Most people forming opinions about Java today are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;using Java 8 at work&lt;/li&gt;
&lt;li&gt;reading Java 8-era tutorials&lt;/li&gt;
&lt;li&gt;comparing Java 8 code to modern Kotlin / Python / Go&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s like judging JavaScript today based on ES5.&lt;/p&gt;

&lt;h3&gt;
  
  
  The uncomfortable truth
&lt;/h3&gt;

&lt;p&gt;Modern Java is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;still explicit&lt;/li&gt;
&lt;li&gt;still strongly typed&lt;/li&gt;
&lt;li&gt;still conservative&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;…but it is no longer excessively verbose relative to other mainstream, production-grade languages.&lt;/p&gt;

&lt;p&gt;The criticism persists mainly because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;enterprises stayed on Java 8 for years&lt;/li&gt;
&lt;li&gt;cultural perception lagged behind language evolution&lt;/li&gt;
&lt;li&gt;Java optimizes for long-lived systems, not hype cycles&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Below a compact example of new Java features:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="n"&gt;record&lt;/span&gt; &lt;span class="nf"&gt;User&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{}&lt;/span&gt;

&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Alice"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

    &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;category&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;switch&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="nf"&gt;User&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="n"&gt;when&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;18&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="s"&gt;"minor"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="nf"&gt;User&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="n"&gt;when&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;65&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="s"&gt;"adult"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="nf"&gt;User&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;                     &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="s"&gt;"senior"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;};&lt;/span&gt;

    &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"""
        User info
        ---------
        Name: %s
        Age: %d
        Category: %s
        """&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;formatted&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="o"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;age&lt;/span&gt;&lt;span class="o"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;category&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why this example is interesting
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No class declaration&lt;/strong&gt; Java finally supports script-like programs without sacrificing type safety.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;record Immutable&lt;/strong&gt; data carrier, perfect for domain objects and DTOs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pattern matching&lt;/strong&gt; in switch No getters, no casts, no if-else chains.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Text blocks&lt;/strong&gt; Cleaner multiline output without escaping noise.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Still 100% Java&lt;/strong&gt; This is not a toy language mode.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Compile &amp;amp; run
&lt;/h2&gt;

&lt;p&gt;Copy and Save the above code into a file, say Main.java. To compile and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;~ javac Main.java
~ java Main
User info
&lt;span class="nt"&gt;---------&lt;/span&gt;
Name: Alice
Age: 32
Category: adult
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Bottom line
&lt;/h2&gt;

&lt;p&gt;If someone says “Java is verbose” and hasn’t seriously looked at Java post-17, they’re not making a technical argument, they’re repeating a historical one.&lt;/p&gt;

</description>
      <category>java</category>
      <category>programming</category>
      <category>oop</category>
      <category>java25</category>
    </item>
    <item>
      <title>PostgREST vs RESTHeart</title>
      <dc:creator>Maurizio Turatti</dc:creator>
      <pubDate>Wed, 17 Dec 2025 11:16:20 +0000</pubDate>
      <link>https://forem.com/mkjsix/postgrest-vs-restheart-3n0j</link>
      <guid>https://forem.com/mkjsix/postgrest-vs-restheart-3n0j</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fghux7zfxwwe0w0ugwhu7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fghux7zfxwwe0w0ugwhu7.png" alt="PostgREST vs RESTHeart" width="800" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  A Comprehensive Comparison of Database-to-API Frameworks
&lt;/h2&gt;

&lt;p&gt;In the world of modern application development, one challenge consistently surfaces: how to quickly and efficiently expose database operations through RESTful APIs. Two powerful open-source solutions tackle this problem from different angles: PostgREST for PostgreSQL and RESTHeart for MongoDB. While they share a common philosophy of automatic API generation, they serve distinct database ecosystems and offer unique architectural approaches.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Core Philosophy: Database-First Development
&lt;/h2&gt;

&lt;p&gt;Both PostgREST and RESTHeart embrace a "database-first" philosophy that fundamentally differs from traditional API development approaches. Instead of writing controllers, routes, and data access layers manually, both frameworks treat the database schema itself as the single source of truth. This approach eliminates the impedance mismatch between your data model and your API, reduces boilerplate code, and ensures that your API always reflects your current database structure.&lt;/p&gt;

&lt;p&gt;The key insight driving both projects is that most CRUD operations don't require custom business logic. By delegating these repetitive tasks to a specialized layer that understands your database, you can focus on implementing the features that make your application unique.&lt;/p&gt;

&lt;h2&gt;
  
  
  PostgREST: Turning PostgreSQL into a REST API
&lt;/h2&gt;

&lt;p&gt;PostgREST is a standalone web server written in Haskell that automatically generates a RESTful API from any PostgreSQL database. Simply point it at your database, and it introspects the schema to create corresponding HTTP endpoints.&lt;/p&gt;

&lt;h2&gt;
  
  
  Core Capabilities
&lt;/h2&gt;

&lt;p&gt;PostgREST offers comprehensive database operations through HTTP verbs. Standard CRUD operations map naturally to GET, POST, PUT, PATCH, and DELETE requests. The framework supports complex queries through URL parameters, allowing filtering, sorting, pagination, and even joins without writing a single line of backend code.&lt;/p&gt;

&lt;p&gt;For example, querying with filters looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;GET /students?age=gt.18&amp;amp;order=name.asc&amp;amp;limit=10
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;PostgREST translates these URL parameters directly into optimized PostgreSQL queries, leveraging the database's query planner for maximum performance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Security Model
&lt;/h2&gt;

&lt;p&gt;One of PostgREST's most compelling features is how it handles security. Rather than implementing authorization logic in the API layer, PostgREST leverages PostgreSQL's role-based access control system. When a request arrives with JWT credentials, PostgREST assumes the corresponding PostgreSQL role for that connection, ensuring the database itself enforces all permissions.&lt;/p&gt;

&lt;p&gt;This approach provides several advantages. You define security rules once in the database using standard SQL GRANT statements and Row-Level Security policies. There's no application-layer code that could bypass database constraints. Security becomes declarative and centralized, making it easier to audit and maintain.&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture and Performance
&lt;/h2&gt;

&lt;p&gt;Built on Haskell and the Warp HTTP server, PostgREST benefits from a highly efficient compiled language. It uses connection pooling through the Hasql library and PostgreSQL's binary protocol to minimize serialization overhead. The framework delegates as much work as possible to PostgreSQL itself, including JSON serialization, data validation, and authorization checks.&lt;/p&gt;

&lt;p&gt;This design results in exceptional performance. Teams have reported dramatic improvements when migrating from traditional ORM-based APIs, with some seeing 10x speed increases and massive reductions in memory usage compared to their previous implementations.&lt;/p&gt;

&lt;h2&gt;
  
  
  API Versioning and Documentation
&lt;/h2&gt;

&lt;p&gt;PostgREST handles API versioning elegantly through PostgreSQL schemas. You can expose different versions of your API by creating separate schemas with different views on the underlying tables. This allows you to evolve your data model without breaking existing clients.&lt;/p&gt;

&lt;p&gt;The framework automatically generates OpenAPI specifications for your API, which can be rendered with tools like Swagger UI for interactive documentation. This means your API documentation is always in sync with your actual database structure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limitations and Considerations
&lt;/h2&gt;

&lt;p&gt;PostgREST deliberately maintains a focused scope. It excels at CRUD operations but leaves concerns like sending emails, complex business logic, or integration with external services to other tools. You'll need to combine PostgREST with additional components (like Nginx for routing, custom PostgreSQL functions for complex operations, or separate microservices for non-CRUD functionality) to build complete applications.&lt;/p&gt;

&lt;p&gt;There's also no native GUI for managing configurations, and while the API documentation can be generated from the OpenAPI spec, this requires additional setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  RESTHeart: The MongoDB Backend Framework
&lt;/h2&gt;

&lt;p&gt;RESTHeart takes a broader approach as a full-featured Java backend framework that provides instant REST, GraphQL, and WebSocket APIs for MongoDB. While PostgREST focuses narrowly on REST operations, RESTHeart positions itself as a comprehensive application framework.&lt;/p&gt;

&lt;h2&gt;
  
  
  Multi-Protocol Support
&lt;/h2&gt;

&lt;p&gt;Unlike PostgREST's REST-only approach, RESTHeart natively supports three different protocols for accessing MongoDB data. The REST API provides the same automatic CRUD operations you'd expect, with support for filtering, pagination, sorting, and aggregations. The GraphQL API allows you to define schemas and queries through configuration rather than code. The WebSocket API enables real-time updates and change streams, notifying clients when data changes without requiring polling.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"Query"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"countPostsByCategory"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"db"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"restheart"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"collection"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"users"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"stages"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"$group"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"$category"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"count"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"$count"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="err"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
 &lt;/span&gt;&lt;span class="err"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This multi-protocol design makes RESTHeart particularly well-suited for modern applications that need real-time features alongside traditional request-response patterns.&lt;/p&gt;

&lt;h2&gt;
  
  
  Extensibility Through Plugins
&lt;/h2&gt;

&lt;p&gt;RESTHeart's plugin architecture distinguishes it from PostgREST's minimalist approach. The framework provides four plugin types: Services (custom endpoints), Interceptors (request/response transformers), Providers (dependency injection), and Initializers (startup tasks).&lt;/p&gt;

&lt;p&gt;Plugins can be written in Java, Kotlin, JavaScript, or TypeScript, giving teams flexibility in their technology choices. The restheart-core runtime handles plugin loading, configuration parsing, security enforcement, and request routing. Pre-built plugins for MongoDB operations, GraphQL support, and security come bundled with the distribution.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="nd"&gt;@RegisterPlugin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"kotlinGreeterService"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
  &lt;span class="n"&gt;defaultURI&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"/greetings"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
  &lt;span class="n"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"just another Hello World in Kotlin"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;GreeterService&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;JsonService&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;override&lt;/span&gt; &lt;span class="k"&gt;fun&lt;/span&gt; &lt;span class="nf"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;JsonRequest&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;JsonResponse&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;when&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nc"&gt;METHOD&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GET&lt;/span&gt; &lt;span class="p"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;put&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"msg"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Hello World"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
            &lt;span class="nc"&gt;METHOD&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;OPTIONS&lt;/span&gt; &lt;span class="p"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;handleOptions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setStatusCode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;HttpStatus&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SC_METHOD_NOT_ALLOWED&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This architecture allows RESTHeart to grow with your application. You can start with zero-code APIs and progressively add custom logic through plugins as requirements evolve.&lt;/p&gt;

&lt;h2&gt;
  
  
  Security and Authentication
&lt;/h2&gt;

&lt;p&gt;RESTHeart includes comprehensive authentication and authorization features out of the box. Multiple authentication mechanisms are supported, including JWT, Basic Auth, and custom authenticators. Authorization can be configured through Access Control Lists with fine-grained permissions, integration with MongoDB roles, and request predicates for conditional access.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"userCanGetOwnCollection"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"roles"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"user"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"predicate"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"method(GET) and path-template('/{userid}') and equals(@user._id, ${userid}) and qparams-contain(page) and qparams-blacklist(filter, sort)"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"priority"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mongo"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"readFilter"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"_$or"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"public"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"author"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"@user._id"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"projectResponse"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"log"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;User and permission management happens directly in MongoDB collections, eliminating the need for separate user databases or authentication services. This streamlined approach significantly reduces development time for applications with standard security requirements.&lt;/p&gt;

&lt;h2&gt;
  
  
  Performance and Deployment
&lt;/h2&gt;

&lt;p&gt;Built on Undertow (the web server powering Red Hat's WildFly applpication server) and fully embracing Java 21's virtual threads, RESTHeart achieves impressive performance characteristics. Virtual threads enable efficient handling of thousands of concurrent connections without the complexity of traditional async programming.&lt;/p&gt;

&lt;p&gt;The framework starts in approximately 100 milliseconds and has a small memory footprint (around 10MB for the JAR, 50MB when compiled to native). Each request runs in its own dedicated thread, making code simple and thread-safe by default.&lt;/p&gt;

&lt;p&gt;RESTHeart supports multiple deployment options: as a standalone JAR, as a Docker container, compiled to a GraalVM native binary, or through RESTHeart Cloud (a fully managed service). The stateless architecture enables horizontal scaling across multiple instances.&lt;/p&gt;

&lt;h2&gt;
  
  
  MongoDB Feature Coverage
&lt;/h2&gt;

&lt;p&gt;RESTHeart exposes MongoDB's full capabilities through its APIs. This includes advanced features like aggregation pipelines, transactions (when MongoDB runs as a replica set), GridFS for binary file storage, schema validation, indexes, and even change streams for real-time data.&lt;/p&gt;

&lt;p&gt;The framework works not just with MongoDB but also with compatible databases like FerretDB (which provides MongoDB compatibility for PostgreSQL), AWS DocumentDB, and Azure Cosmos DB.&lt;/p&gt;

&lt;h2&gt;
  
  
  License Considerations
&lt;/h2&gt;

&lt;p&gt;RESTHeart uses dual licensing: AGPL for open-source use and a Business Friendly Enterprise License for commercial applications. The AGPL version has no feature restrictions, but organizations building closed-source products typically need the Enterprise License.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Similarities
&lt;/h2&gt;

&lt;p&gt;Despite targeting different databases, PostgREST and RESTHeart share several fundamental characteristics:&lt;/p&gt;

&lt;p&gt;✅ Zero-Code Data APIs: Both eliminate the need to manually code CRUD endpoints, automatically generating APIs from database schemas.&lt;/p&gt;

&lt;p&gt;✅ Database-Centric Security: Both leverage the database's native security features rather than implementing authorization in application code.&lt;/p&gt;

&lt;p&gt;✅ Declarative Configuration: Most functionality comes from database schema and simple configuration rather than imperative programming.&lt;/p&gt;

&lt;p&gt;✅ Performance Focus: Both achieve high throughput by delegating work to the database and using efficient underlying technologies.&lt;/p&gt;

&lt;p&gt;✅ Open Source with Commercial Options: Both offer open-source licenses with commercial support options available.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Differences
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Database Targets
&lt;/h3&gt;

&lt;p&gt;The most obvious difference is database compatibility. PostgREST exclusively supports PostgreSQL (and must support its wire protocol). RESTHeart targets MongoDB and MongoDB-compatible databases. This isn't just a connection string change; it reflects fundamentally different data models (relational vs. document-oriented) with distinct query capabilities, transaction semantics, and schema approaches.&lt;/p&gt;

&lt;h3&gt;
  
  
  Architectural Scope
&lt;/h3&gt;

&lt;p&gt;PostgREST maintains a deliberately narrow focus on REST API generation. It does one thing extremely well and expects you to combine it with other tools for additional functionality. This Unix philosophy approach provides simplicity and composability.&lt;/p&gt;

&lt;p&gt;RESTHeart takes a framework approach, providing a broader set of built-in features including multiple API protocols, plugin systems, and application-level functionality. It aims to be a complete backend platform rather than just an API gateway.&lt;/p&gt;

&lt;h3&gt;
  
  
  Programming Languages and Ecosystem
&lt;/h3&gt;

&lt;p&gt;PostgREST is written in Haskell, leveraging functional programming concepts and the Warp server's efficiency. While you don't need to know Haskell to use it, extending PostgREST typically means writing PostgreSQL functions and using other ecosystem tools.&lt;/p&gt;

&lt;p&gt;RESTHeart runs on the JVM, is written in Java, and supports plugin development in Java, Kotlin, JavaScript, and TypeScript. This aligns with the extensive Java enterprise ecosystem and makes it more approachable for teams already working in these languages.&lt;/p&gt;

&lt;h3&gt;
  
  
  Security Implementation
&lt;/h3&gt;

&lt;p&gt;Both emphasize database-native security, but the implementations differ. PostgREST's JWT-to-PostgreSQL-role mapping creates a direct connection between authentication tokens and database permissions. Every request runs under a specific PostgreSQL role with its associated privileges.&lt;/p&gt;

&lt;p&gt;RESTHeart provides a more traditional security layer with built-in authentication mechanisms and ACL-based authorization, while also supporting MongoDB role integration. This offers more flexibility but adds a security layer between clients and the database.&lt;/p&gt;

&lt;h3&gt;
  
  
  API Protocols
&lt;/h3&gt;

&lt;p&gt;PostgREST focuses exclusively on REST over HTTP, generating endpoints that follow RESTful conventions. RESTHeart supports REST, GraphQL (with configurable schemas), and WebSockets for real-time updates, providing more options for client applications with different requirements.&lt;/p&gt;

&lt;h3&gt;
  
  
  Extension Models
&lt;/h3&gt;

&lt;p&gt;PostgREST's extension points are primarily PostgreSQL functions and views, combined with external tools handling concerns outside CRUD operations. This keeps the core simple but requires architectural planning.&lt;/p&gt;

&lt;p&gt;RESTHeart's plugin system provides formalized extension points with Java/JavaScript code, dependency injection, and lifecycle management. This makes adding custom business logic more straightforward within the framework itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use Case Recommendations
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Choose PostgREST When You
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Have an existing or planned PostgreSQL database&lt;/li&gt;
&lt;li&gt;Need a lightweight, focused REST API layer&lt;/li&gt;
&lt;li&gt;Want to leverage PostgreSQL's advanced features (foreign keys, complex queries, stored procedures)&lt;/li&gt;
&lt;li&gt;Prefer a minimalist architecture with composable tools&lt;/li&gt;
&lt;li&gt;Have strong SQL skills and want database-driven development&lt;/li&gt;
&lt;li&gt;Value the simplicity of having security defined entirely in the database&lt;/li&gt;
&lt;li&gt;Don't need GraphQL or WebSocket support&lt;/li&gt;
&lt;li&gt;Can handle additional concerns (email, file storage, etc.) through other services&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Choose RESTHeart When You
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Work with MongoDB or need a document database&lt;/li&gt;
&lt;li&gt;Want multiple API protocols (REST, GraphQL, WebSockets) from one backend&lt;/li&gt;
&lt;li&gt;Need real-time data updates through change streams&lt;/li&gt;
&lt;li&gt;Prefer an all-in-one framework over composing multiple tools&lt;/li&gt;
&lt;li&gt;Work in Java/JVM ecosystems&lt;/li&gt;
&lt;li&gt;Want to write custom business logic in Java, Kotlin, or JavaScript&lt;/li&gt;
&lt;li&gt;Need a rapid application development platform with minimal setup&lt;/li&gt;
&lt;li&gt;Want to progressively add complexity through plugins as requirements grow&lt;/li&gt;
&lt;li&gt;Require flexible schema evolution and document-oriented data modeling&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Performance Considerations
&lt;/h2&gt;

&lt;p&gt;Both frameworks deliver excellent performance, though measuring them directly against each other would be comparing apples to oranges given their different database targets.&lt;/p&gt;

&lt;p&gt;PostgREST benefits from Haskell's efficiency, PostgreSQL's mature query planner, and aggressive delegation of work to the database. Teams report handling thousands of requests per second with minimal resource usage.&lt;/p&gt;

&lt;p&gt;RESTHeart leverages Java virtual threads for efficient concurrency, Undertow's high-performance HTTP handling, and MongoDB's scalable architecture. The framework can handle hundreds of thousands of transactions per second in optimized deployments.&lt;/p&gt;

&lt;p&gt;For most applications, the database itself will be the bottleneck rather than the API framework, making your choice of database more significant than the framework's raw performance characteristics.&lt;/p&gt;

&lt;h2&gt;
  
  
  Development Experience
&lt;/h2&gt;

&lt;h3&gt;
  
  
  PostgREST Workflow
&lt;/h3&gt;

&lt;p&gt;Development with PostgREST centers on your PostgreSQL schema. You design tables, create views, define functions, and set up permissions using SQL. The API emerges automatically from these definitions. Testing often happens directly in PostgreSQL before making HTTP requests.&lt;/p&gt;

&lt;p&gt;The workflow emphasizes database skills. If you're comfortable with SQL and relational modeling, PostgREST's approach feels natural. If your team struggles with advanced SQL, the learning curve may be steeper.&lt;/p&gt;

&lt;h3&gt;
  
  
  RESTHeart Workflow
&lt;/h3&gt;

&lt;p&gt;RESTHeart development typically starts with zero configuration. Connect it to MongoDB, and you can immediately start creating collections and documents through the REST API. As requirements grow, you add configuration for relationships, validation schemas, or GraphQL mappings. Eventually, you might develop custom plugins for business logic.&lt;/p&gt;

&lt;p&gt;This progressive complexity model allows teams to start quickly and add sophistication gradually. The framework supports both low-code and code-heavy approaches depending on application requirements.&lt;/p&gt;

&lt;h2&gt;
  
  
  Community and Ecosystem
&lt;/h2&gt;

&lt;p&gt;PostgREST has an active open-source community on GitHub with contributions from developers worldwide. The project maintains solid documentation, and its focused scope means the API surface is relatively stable. Commercial support is available through Patreon supporters and third-party consultants.&lt;/p&gt;

&lt;p&gt;RESTHeart is developed by SoftInstigate, which provides both open-source AGPL licensing and commercial enterprise licensing with professional support. The project has comprehensive documentation, tutorials, and example applications. The commercial backing provides long-term stability and professional support options.&lt;/p&gt;

&lt;h2&gt;
  
  
  Migration and Integration
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Integrating PostgREST
&lt;/h3&gt;

&lt;p&gt;PostgREST integrates well with existing PostgreSQL databases. You can start with a read-only API by creating views and gradually expand to write operations. The framework works alongside traditional applications, making incremental adoption feasible.&lt;/p&gt;

&lt;p&gt;Common integration patterns include using Nginx as a reverse proxy for routing, combining PostgREST with other microservices for non-CRUD operations, and leveraging PostgreSQL NOTIFY/LISTEN for real-time features through external tools.&lt;/p&gt;

&lt;h3&gt;
  
  
  Integrating RESTHeart
&lt;/h3&gt;

&lt;p&gt;RESTHeart can connect to existing MongoDB deployments without schema modifications. Since MongoDB is schema-less, you can immediately expose existing collections through the API with automatic CRUD operations.&lt;/p&gt;

&lt;p&gt;The framework's plugin system facilitates integration with existing Java applications, and the multi-protocol support makes it easier to serve different client types (web, mobile, real-time) from a single backend.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;PostgREST and RESTHeart represent mature, production-ready approaches to automatic API generation, each tailored to its respective database ecosystem. They share a vision of database-first development that eliminates boilerplate code and embraces declarative data modeling.&lt;/p&gt;

&lt;p&gt;PostgREST's minimalist, focused approach makes it ideal for teams comfortable with PostgreSQL who want a lightweight API layer that leverages the database's full power. Its Unix philosophy of doing one thing well, combined with PostgreSQL's robustness, creates a compelling platform for data-centric applications.&lt;/p&gt;

&lt;p&gt;RESTHeart's comprehensive framework approach provides everything needed for MongoDB-based applications out of the box. The multi-protocol support, plugin architecture, and progressive complexity model make it excellent for teams wanting rapid development without sacrificing the ability to add custom logic when needed.&lt;/p&gt;

&lt;p&gt;Your choice between them primarily depends on your database selection, which itself should be driven by your data model, query patterns, and scalability requirements. If you need PostgreSQL's relational capabilities, ACID guarantees, and SQL power, PostgREST is the clear choice. If MongoDB's document model, flexible schema, and horizontal scalability fit your needs, RESTHeart provides an exceptional backend platform.&lt;/p&gt;

&lt;p&gt;Both projects prove that the tedious work of building CRUD APIs can be automated, freeing developers to focus on what makes their applications unique. In a world where time-to-market and developer productivity are critical, these frameworks represent a significant evolution in how we build data-driven applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;h3&gt;
  
  
  PostgREST
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Documentation: &lt;a href="https://postgrest.org/" rel="noopener noreferrer"&gt;https://postgrest.org/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/PostgREST/postgrest" rel="noopener noreferrer"&gt;https://github.com/PostgREST/postgrest&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;License: MIT&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  RESTHeart
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Documentation: &lt;a href="https://restheart.org/docs/" rel="noopener noreferrer"&gt;https://restheart.org/docs/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/SoftInstigate/restheart" rel="noopener noreferrer"&gt;https://github.com/SoftInstigate/restheart&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;License: AGPL / Enterprise (dual license)&lt;/li&gt;
&lt;li&gt;Commercial: &lt;a href="https://cloud.restheart.com/" rel="noopener noreferrer"&gt;https://cloud.restheart.com/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>postgres</category>
      <category>mongodb</category>
      <category>java</category>
      <category>restapi</category>
    </item>
    <item>
      <title>REST API for PostgreSQL with RESTHeart and FerretDB</title>
      <dc:creator>Maurizio Turatti</dc:creator>
      <pubDate>Fri, 06 Oct 2023 13:11:35 +0000</pubDate>
      <link>https://forem.com/mkjsix/rest-api-for-postgresql-with-restheart-and-ferretdb-4hbd</link>
      <guid>https://forem.com/mkjsix/rest-api-for-postgresql-with-restheart-and-ferretdb-4hbd</guid>
      <description>&lt;p&gt;This tutorial introduces &lt;strong&gt;FerretDB&lt;/strong&gt;, an open-source alternative to &lt;strong&gt;MongoDB&lt;/strong&gt; built on &lt;strong&gt;PostgreSQL&lt;/strong&gt;. Utilizing FerretDB in conjunction with &lt;strong&gt;RESTHeart&lt;/strong&gt;, a powerful API server for MongoDB, this guide demonstrates how to set up the FerretDB stack using Docker and interact with it using RESTHeart's REST API.&lt;/p&gt;

&lt;p&gt;The tutorial covers creating databases, populating collections, querying and updating documents, providing an efficient and compatible MongoDB-like experience while leveraging the benefits of PostgreSQL for storage and management.&lt;/p&gt;

&lt;p&gt;Read the &lt;a href="https://www.softinstigate.com/en/blog/posts/ferretdb-tutorial/" rel="noopener noreferrer"&gt;full article&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>restapi</category>
      <category>postgres</category>
      <category>mongodb</category>
    </item>
    <item>
      <title>Real-time Web chat example with Angular and MongoDB</title>
      <dc:creator>Maurizio Turatti</dc:creator>
      <pubDate>Fri, 16 Jul 2021 14:33:07 +0000</pubDate>
      <link>https://forem.com/mkjsix/real-time-web-chat-example-with-angular-and-mongodb-2903</link>
      <guid>https://forem.com/mkjsix/real-time-web-chat-example-with-angular-and-mongodb-2903</guid>
      <description>&lt;p&gt;We have developed an example Web application made with Angular 12 that uses &lt;a href="https://resheart.org" rel="noopener noreferrer"&gt;RESTHeart&lt;/a&gt; WebSockets with MongoDB Change Streams to provide an instant, zero lines of code API for a realtime chat application:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://chat.restheart.org" rel="noopener noreferrer"&gt;https://chat.restheart.org&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In short, RESTHeart leverages MongoDB's Change Streams to instantly notify database modifications to clients (Web or Mobile apps), through the WebSocket protocol.&lt;/p&gt;

&lt;p&gt;RESTHeart is an open-source runtime and a low-code SDK for Microservices with declarative security and instant Data APIs on MongoDB or any compatible database (e.g. Percona Server for MongoDB, AWS DocumentDB and Azure Cosmos DB).&lt;/p&gt;

&lt;p&gt;The complete source code of this Angular Web application is available on &lt;a href="https://github.com/SoftInstigate/restheart-webchat" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;. The most interesting thing, IMO, is that the server-side source code necessary to deploy this example is zero. You need to start MongoDB, configure RESTHeart and just start writing client-side code.&lt;/p&gt;

&lt;p&gt;Below an article which describes this demo with more details:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.softinstigate.com/en/blog/posts/restheart-webchat/" rel="noopener noreferrer"&gt;https://www.softinstigate.com/en/blog/posts/restheart-webchat/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Softinstigate’s RESTHeart API for MongoDB simplifies development and frees you to focus on delivering great user experiences</title>
      <dc:creator>Maurizio Turatti</dc:creator>
      <pubDate>Tue, 13 Apr 2021 16:10:22 +0000</pubDate>
      <link>https://forem.com/mkjsix/softinstigate-s-restheart-api-for-mongodb-simplifies-development-and-frees-you-to-focus-on-delivering-great-user-experiences-4896</link>
      <guid>https://forem.com/mkjsix/softinstigate-s-restheart-api-for-mongodb-simplifies-development-and-frees-you-to-focus-on-delivering-great-user-experiences-4896</guid>
      <description>&lt;p&gt;RESTHeart is a stateless REST API microservice for MongoDB, written in Java and embedding the Undertow HTTP server, that lets users access the full power of MongoDB using HTTP calls. No server-side coding frees developers to focus on developing innovative, value-adding apps.&lt;/p&gt;

&lt;p&gt;Read the full article here: &lt;a href="https://www.mongodb.com/customers/softinstigate" rel="noopener noreferrer"&gt;https://www.mongodb.com/customers/softinstigate&lt;/a&gt;&lt;/p&gt;

</description>
      <category>mongodb</category>
      <category>api</category>
      <category>rest</category>
      <category>java</category>
    </item>
    <item>
      <title>RESTHeart - Modern runtime for microservices - Video</title>
      <dc:creator>Maurizio Turatti</dc:creator>
      <pubDate>Sat, 12 Dec 2020 11:16:56 +0000</pubDate>
      <link>https://forem.com/mkjsix/restheart-setup-and-configuration-3h51</link>
      <guid>https://forem.com/mkjsix/restheart-setup-and-configuration-3h51</guid>
      <description>&lt;p&gt;This video introduces RESTHeart, a modern, open source backend for microservices that can expose instant APIs for MongoDB.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/9KroH-RvjS0"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;See also:&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/mkjsix" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F504306%2Fb149f52b-7ecd-4e35-98fc-d623933d6c1a.jpeg" alt="mkjsix"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/mkjsix/restheart-a-java-runtime-for-microservices-50g" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;RESTHeart - a Java runtime for microservices&lt;/h2&gt;
      &lt;h3&gt;Maurizio Turatti ・ Nov 23 '20&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#java&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#microservices&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#mongodb&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#webdev&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>rest</category>
      <category>api</category>
      <category>mongodb</category>
      <category>java</category>
    </item>
    <item>
      <title>RESTHeart - a Java runtime for microservices</title>
      <dc:creator>Maurizio Turatti</dc:creator>
      <pubDate>Mon, 23 Nov 2020 14:20:16 +0000</pubDate>
      <link>https://forem.com/mkjsix/restheart-a-java-runtime-for-microservices-50g</link>
      <guid>https://forem.com/mkjsix/restheart-a-java-runtime-for-microservices-50g</guid>
      <description>&lt;p&gt;In 2014 we had long realized that both Java application servers and frameworks force people to invest a lot of time in their configuration and maintenance, comparing to what is usually invested in the implementation of actual functionalities.&lt;/p&gt;

&lt;p&gt;For these reasons, at &lt;a href="https://www.softinstigate.com" rel="noopener noreferrer"&gt;our company&lt;/a&gt; we started developing an open-source product called &lt;a href="https://restheart.org" rel="noopener noreferrer"&gt;RESTHeart&lt;/a&gt;, in order to investigate more rational ways to build applications. It was born as a summer experiment and it became an increasingly focused and robust product in the following years.&lt;/p&gt;

&lt;h2&gt;
  
  
  What RESTHeart actually does, in a minute
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://restheart.org" rel="noopener noreferrer"&gt;RESTHeart&lt;/a&gt; is a Java open source runtime for microservices. It leverages MongoDB to provide a instant persistence data API.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Instant REST API with MongoDB;&lt;/li&gt;
&lt;li&gt;Built-in Authentication and Authorization;&lt;/li&gt;
&lt;li&gt;Elegant Java and Kotlin Framework to extend the API.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;RESTHeart is tailored for JVM, Docker and Kubernetes, designed to radically simplify server-side development and deployment.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ready-to-run stateless Microservice;&lt;/li&gt;
&lt;li&gt;Available as binary and Docker container;&lt;/li&gt;
&lt;li&gt;Deploy both on Cloud and on-premises.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;RESTHeart is a "low code" development platform: you can get most of the mandatory server-side functionalities usually required by any Web and Mobile application with just configuration.&lt;/p&gt;

&lt;p&gt;RESTHeart allows to create REST Web Services in minutes: implement a simple Java interface and deploy the web service by copying its JAR file into the plugins directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@RegisterPlugin&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"greeterService"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
    &lt;span class="n"&gt;description&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"sends a greetings message"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;defaultURI&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"/greetings"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;GreeterService&lt;/span&gt; &lt;span class="kd"&gt;implements&lt;/span&gt; &lt;span class="nc"&gt;JsonService&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nd"&gt;@Override&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;handle&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;JsonRequest&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;JsonResponse&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;isGet&lt;/span&gt;&lt;span class="o"&gt;())&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;JsonObject&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
            &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;addProperty&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"message"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Hello World!"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setContent&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setStatusCode&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;400&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The main advantage with RESTHeart is that you can immediately write and read data into a MongoDB database using just HTTP. Your JSON will travel untouched from the client to the database and back.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fv264vykowkqjljspi9ie.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fv264vykowkqjljspi9ie.png" alt="Alt Text" width="800" height="434"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Specifications
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Written in Java 11&lt;/li&gt;
&lt;li&gt;Built on top of RedHat’s &lt;a href="https://undertow.io" rel="noopener noreferrer"&gt;Undertow&lt;/a&gt; non-blocking HTTP server.&lt;/li&gt;
&lt;li&gt;Uses MongoDB and compatible databases for data persistence.&lt;/li&gt;
&lt;li&gt;Fully stateless.&lt;/li&gt;
&lt;li&gt;Can be packaged as a &lt;a href="https://hub.docker.com/r/softinstigate/restheart" rel="noopener noreferrer"&gt;Docker container&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Can be easily deployed both on Cloud and on premises.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Main features
&lt;/h2&gt;

&lt;p&gt;RESTHeart unlocks all the capabilities of MongoDB.&lt;br&gt;
It can also connect to Mongo Atlas Cloud, Amazon DocumentDB, Microsoft Azure CosmosDB and Percona Server for MongoDB.&lt;/p&gt;

&lt;p&gt;For a complete list of features please go to &lt;a href="https://restheart.org/features" rel="noopener noreferrer"&gt;this page&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try online
&lt;/h2&gt;

&lt;p&gt;You can try a simple Angular Web application &lt;a href="https://restheart.org/docs/try/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Examples
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/SoftInstigate/restheart-examples" rel="noopener noreferrer"&gt;This repository&lt;/a&gt; provides examples on how to extend RESTHeart with Java or Kotlin plugins:&lt;/p&gt;

&lt;h2&gt;
  
  
  Source code
&lt;/h2&gt;

&lt;p&gt;The full source code is available on &lt;a href="https://github.com/SoftInstigate/restheart" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>java</category>
      <category>microservices</category>
      <category>mongodb</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
