Axiom has Layers

...you know, like Ogres

Fork me on GitHub

What are layers?

One feature that Axiom Stack has that many other web application frameworks do not is the notion of layering. Layers here mean different levels of view on your content. For instance, you can change the contents of an object on one layer and the data wont be affected on others. So it makes staging and previewing content changes incredibly simple.

How it works!

Layers - No EditsLayers operate by publishing changes to the specified layer. For instance, lets say you decided to view a layer. You go to preview.domain.com which you've specified links to the first layer (we'll get into how in a bit). As of now there are no changes to the data. This means that you are effectively looking at the exact site that exists. So, lets assume that you have a home, section, and page. There are no modifications to any of those objects. That means that if you go to preview.domain.com/home you are looking at the same thing someone going to www.domain.com/home is looking at. An analogy that helps is thinking of this like a glass ceiling. A layer can see the objects under itself.

Now you decide to make some edits. The domain you are using to access your web app is preview.domain.com. Let's say that you've changed some of the data represented on section, you've persisted a change to section prime (not to be mistaken with Optimus Prime). This change can now be viewed by going to preview.domain.com/home/section.

Layers - Section PrimeTo be clear here, when you make a change to section on the layer, you're creating section prime. This is a full copy of the object, but does not include children.

So, the changes that we just made are now within the first layer. This means that anyone going to preview.domain.com will be able to see the changes I've made on section.

How Does This Help You?

To start with, this helps because you only have to setup DNS entries to make your layers accessible. But, should you desire more, you can do more.

Axiom Stack provides API level access to this functionality. The benefit of this API is that as a developer you get the ability to control objects, within different layers, from the Javascript code.

API Overview

The API mentioned above are pretty simple. In all of these cases, the second parameter described is optional. It allows you to specify the layer on which to do the operations. If no layer is specified then it will make a judgment call on the layer to perform the action.
  • app.getDraft - This method takes at least one parameter, the object you want the draft of. A second parameter can be passed in, this is the number of the layer from which you want the draft. Ultimately, an AxiomObject is returned to you. If the object doesn't already exist on the layer you're requesting from, it will create a new object.
  • app.saveDraft - This method takes at least one parameter, the draft object you want to save. A second parameter can be passed in, this is the number of the layer where you want to save the draft.
  • app.deleteDraft - This method takes at least one parameter, the object you want to delete. A second parameter can be passed in, this is the number of the layer where you want to delete the object.

What Could This Be Used For?

There are a few types of applications where this becomes really beneficial. Plus, I'm sure that you can imagine more. If you have ideas for use of this please let us know. We're interested to know how others are using our software.

Advertising

Let's say that you want to have a free version of your site that is supported by advertising. Alternatively, you have a pay-for version of your site. You could have members directed to members.domain.com and all others to www.domain.com while showing your referenced advertisements only to the free version of the site.

User Segmentation/Sandboxing

Assume for a minute that you want to have user sites separated out for each user, but want to use the same basic data for each. While you allow some modification of that data, you can in essence give people their own playgrounds and they wont affect each others work.

What's Next?

We plan to have an application or two that will show you how this can all work so be sure to check back here for more.