Sling Lambda - A native Sling for the edge

Apache Sling lends itself incredibly well as a foundation for long running servers but doesn’t typically cater for serverless environments that demand flexible scalability. However, its architecture, with an extensible resource tree and rendering pipeline, offers a powerful mechanism for pre-constructing content such as static webpages. The recent introduction of the 'bring your own markup' feature in AEM Sites Edge Delivery Services further broadens the content source spectrum as it makes it possible to have other content providers as well. This innovative approach allows for a content source to supply content on a page preview request, essentially pre-constructing your pages rather than serving them dynamically.

In our session, we'll explore a streamlined Sling distribution, constructed out of composable minimal features. With this you can convert markdown into Edge Delivery Service compatible HTML with a minimal set of Bundles. We'll then introduce a new feature launcher extension which facilitates the running of features on Apache Felix Atomos.

Finally, we’ll show how you can use a newly created maven plugin to compile these minimal features together with the Atomos launcher to native code using GraalVM.

At the end, we'll demonstrate the integration of the result in a serverless function as the content source for an Edge Delivery Services project. Here, Sling is employed to render the content within milliseconds using minimal resources. Join us to explore this seed of a possible serverless future of content rendering with Apache Sling.

puradawid

Is this md to html rendering used in Edge Services by default?

cziegeler

No, Edge Delivery Services renders Word or Google docs to HTML

Michal Cukierman

Did you consider rewriting Sling core bundles to use container-first, natively compiling frameworks like Quarkus?

cziegeler

No not yet

puradawid

Can the web parts (request/response, etc.) be removed from the minimal sling ran offline or it is too coupled with the base architecture?

cziegeler

Yes those can be removed, the offline Version we used had those removed

Michael

Not a question, just a general observation: seems like a hell of a lot of work just to covert MD to HTML. The fun, though!

cziegeler

Yes, fun is important. It is also just a demo which is easy to understand. In real life something more complex that warrants the effort is more realistic

In which practical situations would you recommend using Sling on the edge?

cziegeler

I think there are at least two good reasons, existence of skills/Knowhow and reusing existing Code. It is possible to make Java Code run in a function with comparable or good enough characteristics . If you already have the Code it is a faster approach than rewriting and relearning . For Apache Sling it makes sense to use it to use our own software

Michal Cukierman

How the bring your own markdown is cached/invalidated?

cziegeler

This is done by edge delivery Services if new content is published

Tomasz Sobczyk

Shall we now try to get aem through gralvm?

cziegeler

Challenge is on