SlideShare uma empresa Scribd logo
1 de 32
Baixar para ler offline
APACHE SLING & FRIENDS TECH MEETUP
BERLIN, 25-27 SEPTEMBER 2017
Robert Munteanu, Tomek Rękawek @ Adobe
0DT deployments for Sling-based apps
Agenda
● Motivation
● Concepts
● Usage
● Demo
● Wrap-up
Motivation
Clustered deployments
Standalone deployments
Concepts
Separate content from code
Oak Composite NodeStore
Oak Composite NodeStore
● Manages a number of 1 to n NodeStores
● Always has a global NodeStore, holding the content not
claimed by other NodeStores
● Multiple mounted NodeStores, owning content for certain
paths, for instance /libs and /apps
● Certain paths in the global mount can be claimed by mounts
– Looks for a :oak:mount- prefx in node names and matches them with mounts
– Currently implemented for indexes
Typical confguraton
Note: for your viewing pleasure, not an actual config file
/ <default> # global mount
/libs libs # read-only mount
/apps libs # read-only mount
Following paths also belong to the libs mount:
●
/oak:index/uuid/:oak:mount-libs-index ( and others )
● /jcr:system/rep:permissionStore/oak:mount-libs-
default
Oak composite store with Sling / AEM
● Two repositories:
– /apps & /libs - stored in a separate, read-only
repository-libs,
– other data - stored in the normal repository (Segment,
Mongo or RDB).
● The first one has to be created before starting
the instance.
Limitatons
● Mounts are always read-only
– Atomic state changes non trivial to get right, fast, scalable
– Write support requires additonal change to multple Oak subsystems
– No observaton events generated
● Referenceable nodes are not suported in non-default
NodeStores
● Versionable nodes are not supported in non-default
NodeStores
Ensuring consistency
● Mount-time checks
– No versionable nodes in non-default NodeStores
– No referenceable nodes in non-default NodeStoress
– No duplicate entries in unique indexes amongst all NodeStores
– Node type defnitons from mounts consistent with the global node type
registry
– Namespace usage in mounts consistent with the global namespace registry
● Run-time checks
– No cross-mount references may be created at run-tme
Applicaton-level changes
● No run-time changes under /libs or /apps
– Usually fne or applicatons
– More painful for testng
● Read-only status exposed via
Session.hasCapability, not
Session.hasPermission
Usage
Running instance in the composite mode
●
We need to have two repositories in the composite mode:
– one for the applicaton (/apps and /libs),
– one for the content (everything else).
● When running the instance in the composite mode, the
application part is read-only
– so it's not possible to install the applicaton from the content packages, as usual.
● Therefore, using composite mode involves two-step process:
– start instance without the composite node store, to create the applicaton repository,
– start instance with the composite node store.
Building and startng composite instance
Building the composite-enabled instance
●
First, the instance is started without the composite node store.
●
The composite-init.jar waits until the instance is ready:
– start level 30,
– no indexing jobs in progress.
●
Then it stops the instance.
● The created repository is renamed to repository-libs.
●
It's a completely initialized repository:
– /apps, /libs will be used for the composite node store mount,
– other content will be used to pre-populate the default node store when running the instance.
Startng the quickstart in composite mode
● The instance is configured with two node stores: the default one and
the repository-libs.
● They are combined together with composite node store.
● If the instance is started for the first time:
– the default store is empty, so the composite node store pre-populates it with the content from
the repository-libs,
– it copies everything except the apps-related data,
– once the inital pre-populaton is done, the instance startup will carry on.
● If the instance references an existing default repository:
– the startup proceeds, with the new /apps and /libs part.
Customer applicaton integraton
●
The customer application can't be installed in the instance runtime.
●
It has to be integrated with the Sling/AEM code.
●
Sling Provisioning Model:
[artifacts startLevel=20]
com.acme.site/com.acme.site.content/1.0.0/zip
com.acme.site/com.acme.site.core/1.0.0
com.acme.site/com.acme.site.email/1.0.0
com.acme.site/com.acme.site.templating/1.0.0
[configurations]
com.acme.site.core.AcmeService
enabled=B"true"
path="/home/acme"
Composite mode with Docker
● This 2-stage process needs to be automated.
●
Docker is a perfect tool for the task - it allows to
encapsulate both logic and data:
– Dockerfile can be used to orchestrate the required steps,
– the created Docker image embedds the artfacts and
repository-libs.
●
A separate image for author and publish.
Dockerizing the composite instance
Running the container
● The container uses an external storage for the
non-application content.
● Either VOLUME for the TarMK or a Mongo
instance.
● The /apps and /libs are served from the
embedded repository-libs.
Docker setup summary
Deployment scenarios
Blue-green deployments
Blue green deployments
●
Now we have the whole application code enclosed in the container.
● While the other data (/content) is stored externally.
● This allows to perform a blue-green deployment.
●
Blue container is the one running the older version of code.
●
Without disabling it, we're creating a green container, running the newer code.
● They are both using the same content, but their /apps subtrees and bundles
are different.
● Now we can switch the load balancer to point the green container.
●
The blue one can be shut down.
Incompatble content changes
●
The assumption is that the green container doesn't introduce incomatible
changes.
●
Otherwise the blue may break.
●
In AEM context: eg. no new components should be added if the older version
doesn't support them.
●
If the property name changes, the new version should fallback to reading the
older name as well.
●
If the content schema changes, a script may be used to update the content
after switching the load balancer,
– the new applicaton should allow to read the older schema too.
Demo
Zero downtme demo
● Start a Dockerized, Mongo-based AEM instance with
application v1.
● Start the second container, with application v2,
connecting to the same MongoDB.
● Confirm it contains a new "video" component.
● Switch the load balancer.
● Destroy the old instance.
Wrap-up
Resources
● https://jackrabbit.apache.org/oak/docs/node
store/compositens.html

Mais conteúdo relacionado

Mais procurados

Developing Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScriptDeveloping Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScript
nohuhu
 
Automating JavaScript testing with Jasmine and Perl
Automating JavaScript testing with Jasmine and PerlAutomating JavaScript testing with Jasmine and Perl
Automating JavaScript testing with Jasmine and Perl
nohuhu
 
Python to go
Python to goPython to go
Python to go
Weng Wei
 

Mais procurados (20)

Developing Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScriptDeveloping Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScript
 
Perl wants you
Perl wants youPerl wants you
Perl wants you
 
Juc boston2014.pptx
Juc boston2014.pptxJuc boston2014.pptx
Juc boston2014.pptx
 
Ansible, Idempotency, and Jenkins
Ansible, Idempotency, and JenkinsAnsible, Idempotency, and Jenkins
Ansible, Idempotency, and Jenkins
 
Riak at Posterous
Riak at PosterousRiak at Posterous
Riak at Posterous
 
Mono Repo
Mono RepoMono Repo
Mono Repo
 
WordPress 4.4 and Beyond
WordPress 4.4 and BeyondWordPress 4.4 and Beyond
WordPress 4.4 and Beyond
 
Building Good Containers for Python Applications
Building Good Containers for Python ApplicationsBuilding Good Containers for Python Applications
Building Good Containers for Python Applications
 
Automating JavaScript testing with Jasmine and Perl
Automating JavaScript testing with Jasmine and PerlAutomating JavaScript testing with Jasmine and Perl
Automating JavaScript testing with Jasmine and Perl
 
Better delivery with DevOps Driven Development
Better delivery with DevOps Driven DevelopmentBetter delivery with DevOps Driven Development
Better delivery with DevOps Driven Development
 
Advantages and disadvantages of a monorepo
Advantages and disadvantages of a monorepoAdvantages and disadvantages of a monorepo
Advantages and disadvantages of a monorepo
 
Python to go
Python to goPython to go
Python to go
 
Moving 1,000 Users & 100 Branches into Streams
Moving 1,000 Users & 100 Branches into StreamsMoving 1,000 Users & 100 Branches into Streams
Moving 1,000 Users & 100 Branches into Streams
 
Custom angular libraries
Custom angular librariesCustom angular libraries
Custom angular libraries
 
Docker in Production
Docker in ProductionDocker in Production
Docker in Production
 
Vincit Teatime 2015.2 - Niko Kurtti: SaaSiin pa(i)nostusta
Vincit Teatime 2015.2 - Niko Kurtti: SaaSiin pa(i)nostustaVincit Teatime 2015.2 - Niko Kurtti: SaaSiin pa(i)nostusta
Vincit Teatime 2015.2 - Niko Kurtti: SaaSiin pa(i)nostusta
 
10/29 Austin Ansible MeetUp - AnsibleFest Talk & Extending Ansible
10/29 Austin Ansible MeetUp - AnsibleFest Talk & Extending Ansible10/29 Austin Ansible MeetUp - AnsibleFest Talk & Extending Ansible
10/29 Austin Ansible MeetUp - AnsibleFest Talk & Extending Ansible
 
[Srijan Wednesday Webinar] How to Run Stateless and Stateful Services on K8S ...
[Srijan Wednesday Webinar] How to Run Stateless and Stateful Services on K8S ...[Srijan Wednesday Webinar] How to Run Stateless and Stateful Services on K8S ...
[Srijan Wednesday Webinar] How to Run Stateless and Stateful Services on K8S ...
 
The Beam Vision for Portability: "Write once run anywhere"
The Beam Vision for Portability: "Write once run anywhere"The Beam Vision for Portability: "Write once run anywhere"
The Beam Vision for Portability: "Write once run anywhere"
 
They why behind php frameworks
They why behind php frameworksThey why behind php frameworks
They why behind php frameworks
 

Semelhante a Zero downtime deployments for Sling application using Docker

01 web-apps
01 web-apps01 web-apps
01 web-apps
snopteck
 

Semelhante a Zero downtime deployments for Sling application using Docker (20)

Migraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sitesMigraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sites
 
Java 9 Features
Java 9 FeaturesJava 9 Features
Java 9 Features
 
Mule scopes&amp;error handling
Mule scopes&amp;error handlingMule scopes&amp;error handling
Mule scopes&amp;error handling
 
Node JS - A brief overview on building real-time web applications
Node JS - A brief overview on building real-time web applicationsNode JS - A brief overview on building real-time web applications
Node JS - A brief overview on building real-time web applications
 
Node js Global Packages
Node js Global PackagesNode js Global Packages
Node js Global Packages
 
Open Dayligth usando SDN-NFV
Open Dayligth usando SDN-NFVOpen Dayligth usando SDN-NFV
Open Dayligth usando SDN-NFV
 
System software module 3 presentation file
System software module 3 presentation fileSystem software module 3 presentation file
System software module 3 presentation file
 
System software module 3 presentation file
System software module 3 presentation fileSystem software module 3 presentation file
System software module 3 presentation file
 
Essential applications management with Tiny Puppet
Essential applications management with Tiny PuppetEssential applications management with Tiny Puppet
Essential applications management with Tiny Puppet
 
Webpack: from 0 to 2
Webpack: from 0 to 2Webpack: from 0 to 2
Webpack: from 0 to 2
 
Overview of Node JS
Overview of Node JSOverview of Node JS
Overview of Node JS
 
Carbon and OSGi Deep Dive
Carbon and OSGi Deep DiveCarbon and OSGi Deep Dive
Carbon and OSGi Deep Dive
 
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
 
Eclipse Training - Introduction
Eclipse Training - IntroductionEclipse Training - Introduction
Eclipse Training - Introduction
 
CD in kubernetes using helm and ksonnet. Stas Kolenkin
CD in kubernetes using helm and ksonnet. Stas KolenkinCD in kubernetes using helm and ksonnet. Stas Kolenkin
CD in kubernetes using helm and ksonnet. Stas Kolenkin
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
 
Tips and Tricks for the Advanced Mule Developer with Tesla and Twitter
Tips and Tricks for the Advanced Mule Developer with Tesla and Twitter Tips and Tricks for the Advanced Mule Developer with Tesla and Twitter
Tips and Tricks for the Advanced Mule Developer with Tesla and Twitter
 
Efficient development workflows with composer
Efficient development workflows with composerEfficient development workflows with composer
Efficient development workflows with composer
 
Organizing JavaScript
Organizing JavaScriptOrganizing JavaScript
Organizing JavaScript
 
01 web-apps
01 web-apps01 web-apps
01 web-apps
 

Mais de Robert Munteanu

Mais de Robert Munteanu (20)

Secure by Default Web Applications
Secure by Default Web ApplicationsSecure by Default Web Applications
Secure by Default Web Applications
 
Sling Applications - A DevOps perspective
Sling Applications - A DevOps perspectiveSling Applications - A DevOps perspective
Sling Applications - A DevOps perspective
 
Will it blend? Java agents and OSGi
Will it blend? Java agents and OSGiWill it blend? Java agents and OSGi
Will it blend? Java agents and OSGi
 
Escape the defaults - Configure Sling like AEM as a Cloud Service
Escape the defaults - Configure Sling like AEM as a Cloud ServiceEscape the defaults - Configure Sling like AEM as a Cloud Service
Escape the defaults - Configure Sling like AEM as a Cloud Service
 
Crash course in Kubernetes monitoring
Crash course in Kubernetes monitoringCrash course in Kubernetes monitoring
Crash course in Kubernetes monitoring
 
Java agents for fun and (not so much) profit
Java agents for fun and (not so much) profitJava agents for fun and (not so much) profit
Java agents for fun and (not so much) profit
 
Will it blend? Java agents and OSGi
Will it blend? Java agents and OSGiWill it blend? Java agents and OSGi
Will it blend? Java agents and OSGi
 
Cloud-native legacy applications
Cloud-native legacy applicationsCloud-native legacy applications
Cloud-native legacy applications
 
Cloud-Native Sling
Cloud-Native SlingCloud-Native Sling
Cloud-Native Sling
 
From Monolith to Modules - breaking apart a one size fits all product into mo...
From Monolith to Modules - breaking apart a one size fits all product into mo...From Monolith to Modules - breaking apart a one size fits all product into mo...
From Monolith to Modules - breaking apart a one size fits all product into mo...
 
What's new in the Sling developer tooling?
What's new in the Sling developer tooling?What's new in the Sling developer tooling?
What's new in the Sling developer tooling?
 
Scaling up development of a modular code base
Scaling up development of a modular code baseScaling up development of a modular code base
Scaling up development of a modular code base
 
Scaling up development of a modular code base
Scaling up development of a modular code baseScaling up development of a modular code base
Scaling up development of a modular code base
 
Scaling up development of a modular code base
Scaling up development of a modular code baseScaling up development of a modular code base
Scaling up development of a modular code base
 
Effective web application development with Apache Sling
Effective web application development with Apache SlingEffective web application development with Apache Sling
Effective web application development with Apache Sling
 
Of microservices and microservices
Of microservices and microservicesOf microservices and microservices
Of microservices and microservices
 
Slide IDE Tooling (adaptTo 2016)
Slide IDE Tooling (adaptTo 2016)Slide IDE Tooling (adaptTo 2016)
Slide IDE Tooling (adaptTo 2016)
 
Secure by Default Web Applications with Apache Sling
Secure by Default Web Applications with Apache SlingSecure by Default Web Applications with Apache Sling
Secure by Default Web Applications with Apache Sling
 
Apache Sling as a Microservices Gateway
Apache Sling as a Microservices GatewayApache Sling as a Microservices Gateway
Apache Sling as a Microservices Gateway
 
Apache Sling as an OSGi-powered REST middleware
Apache Sling as an OSGi-powered REST middlewareApache Sling as an OSGi-powered REST middleware
Apache Sling as an OSGi-powered REST middleware
 

Último

%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
chiefasafspells
 

Último (20)

%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 

Zero downtime deployments for Sling application using Docker

  • 1. APACHE SLING & FRIENDS TECH MEETUP BERLIN, 25-27 SEPTEMBER 2017 Robert Munteanu, Tomek Rękawek @ Adobe 0DT deployments for Sling-based apps
  • 2. Agenda ● Motivation ● Concepts ● Usage ● Demo ● Wrap-up
  • 9. Oak Composite NodeStore ● Manages a number of 1 to n NodeStores ● Always has a global NodeStore, holding the content not claimed by other NodeStores ● Multiple mounted NodeStores, owning content for certain paths, for instance /libs and /apps ● Certain paths in the global mount can be claimed by mounts – Looks for a :oak:mount- prefx in node names and matches them with mounts – Currently implemented for indexes
  • 10. Typical confguraton Note: for your viewing pleasure, not an actual config file / <default> # global mount /libs libs # read-only mount /apps libs # read-only mount Following paths also belong to the libs mount: ● /oak:index/uuid/:oak:mount-libs-index ( and others ) ● /jcr:system/rep:permissionStore/oak:mount-libs- default
  • 11. Oak composite store with Sling / AEM ● Two repositories: – /apps & /libs - stored in a separate, read-only repository-libs, – other data - stored in the normal repository (Segment, Mongo or RDB). ● The first one has to be created before starting the instance.
  • 12. Limitatons ● Mounts are always read-only – Atomic state changes non trivial to get right, fast, scalable – Write support requires additonal change to multple Oak subsystems – No observaton events generated ● Referenceable nodes are not suported in non-default NodeStores ● Versionable nodes are not supported in non-default NodeStores
  • 13. Ensuring consistency ● Mount-time checks – No versionable nodes in non-default NodeStores – No referenceable nodes in non-default NodeStoress – No duplicate entries in unique indexes amongst all NodeStores – Node type defnitons from mounts consistent with the global node type registry – Namespace usage in mounts consistent with the global namespace registry ● Run-time checks – No cross-mount references may be created at run-tme
  • 14. Applicaton-level changes ● No run-time changes under /libs or /apps – Usually fne or applicatons – More painful for testng ● Read-only status exposed via Session.hasCapability, not Session.hasPermission
  • 15. Usage
  • 16. Running instance in the composite mode ● We need to have two repositories in the composite mode: – one for the applicaton (/apps and /libs), – one for the content (everything else). ● When running the instance in the composite mode, the application part is read-only – so it's not possible to install the applicaton from the content packages, as usual. ● Therefore, using composite mode involves two-step process: – start instance without the composite node store, to create the applicaton repository, – start instance with the composite node store.
  • 17. Building and startng composite instance
  • 18. Building the composite-enabled instance ● First, the instance is started without the composite node store. ● The composite-init.jar waits until the instance is ready: – start level 30, – no indexing jobs in progress. ● Then it stops the instance. ● The created repository is renamed to repository-libs. ● It's a completely initialized repository: – /apps, /libs will be used for the composite node store mount, – other content will be used to pre-populate the default node store when running the instance.
  • 19. Startng the quickstart in composite mode ● The instance is configured with two node stores: the default one and the repository-libs. ● They are combined together with composite node store. ● If the instance is started for the first time: – the default store is empty, so the composite node store pre-populates it with the content from the repository-libs, – it copies everything except the apps-related data, – once the inital pre-populaton is done, the instance startup will carry on. ● If the instance references an existing default repository: – the startup proceeds, with the new /apps and /libs part.
  • 20. Customer applicaton integraton ● The customer application can't be installed in the instance runtime. ● It has to be integrated with the Sling/AEM code. ● Sling Provisioning Model: [artifacts startLevel=20] com.acme.site/com.acme.site.content/1.0.0/zip com.acme.site/com.acme.site.core/1.0.0 com.acme.site/com.acme.site.email/1.0.0 com.acme.site/com.acme.site.templating/1.0.0 [configurations] com.acme.site.core.AcmeService enabled=B"true" path="/home/acme"
  • 21. Composite mode with Docker ● This 2-stage process needs to be automated. ● Docker is a perfect tool for the task - it allows to encapsulate both logic and data: – Dockerfile can be used to orchestrate the required steps, – the created Docker image embedds the artfacts and repository-libs. ● A separate image for author and publish.
  • 23. Running the container ● The container uses an external storage for the non-application content. ● Either VOLUME for the TarMK or a Mongo instance. ● The /apps and /libs are served from the embedded repository-libs.
  • 27. Blue green deployments ● Now we have the whole application code enclosed in the container. ● While the other data (/content) is stored externally. ● This allows to perform a blue-green deployment. ● Blue container is the one running the older version of code. ● Without disabling it, we're creating a green container, running the newer code. ● They are both using the same content, but their /apps subtrees and bundles are different. ● Now we can switch the load balancer to point the green container. ● The blue one can be shut down.
  • 28. Incompatble content changes ● The assumption is that the green container doesn't introduce incomatible changes. ● Otherwise the blue may break. ● In AEM context: eg. no new components should be added if the older version doesn't support them. ● If the property name changes, the new version should fallback to reading the older name as well. ● If the content schema changes, a script may be used to update the content after switching the load balancer, – the new applicaton should allow to read the older schema too.
  • 29. Demo
  • 30. Zero downtme demo ● Start a Dockerized, Mongo-based AEM instance with application v1. ● Start the second container, with application v2, connecting to the same MongoDB. ● Confirm it contains a new "video" component. ● Switch the load balancer. ● Destroy the old instance.