Behind the Scenes with Samplestack

Behind the Scenes with Samplestack

Posted on March 10, 2015 0 Comments
Person using a tablet


This week, I had the opportunity to sit down and chat with Kasey Alderete, the Product Manager that helped guide Samplestack from a nascent idea that we started thinking about last spring into a fully functioning app that we just launched a few weeks ago.

While we have plenty of technical documentation on Samplestack, and the code is available now in GitHub, I wanted to get a bit more background on why we built Samplestack in the first place, and what our team learned about MarkLogic in the process.

Also, if you haven’t already, you should sign-up for MarkLogic World in San Francisco or any of the other stops around the world where you can learn more about Samplestack and the other new features in MarkLogic 8.

Me: Kasey, you’ve been in the code for the past few months working on this project, but for those less familiar with Samplestack, can you provide a high-level description?

Kasey: Yes, absolutely—Samplestack is a comprehensive sample application designed to show recommended ways of building applications with MarkLogic. The actual app is a knowledge management tool where users can ask questions and answers that then get voted up or down.


Samplestack: A full-featured application to help developers get going fast with MarkLogic.

Me: So, we basically just created our own version of Stack Overflow, powered by MarkLogic, that anyone can download and run for free?

Kasey: We started with an initial seed data set from Stack Overflow, which makes its archive content available to others for sharing and remixing. We implemented features that are common to Q&A sites and which also happen to showcase some of MarkLogic’s out of the box strengths such as search, updates, and storage. And yes—with a free developer licensed version of MarkLogic, there is no cost to downloading and running the application on your local machine.

Me: I’ve also heard you mention Samplestack being like the “Java Pet Store”—can you tell me more about that?

Kasey: Yes, Samplestack is designed to be similar in concept to the “Java Pet Store” application that Sun originally built over a decade ago (Note: Oracle later came out with a Pet Store 2.0 version as well). It was an effective tool in helping developers get familiar with Java. Similarly, Samplestack will help developers get familiar with MarkLogic and the modern development tools and techniques involved.

Pet Store

We’ve certainly come a long way with sample apps since the “Java Pet Store” application launched over a decade ago.

Me: Can you tell me a bit more about why Samplestack was built?

Kasey: One of the big themes of our latest release, MarkLogic 8, was the Developer Experience. This meant giving developers the new features they wanted, but also making sure MarkLogic’s many existing features were readily accessible.

MarkLogic is really flexible and there are many ways to use it to meet different enterprise requirements. But, many developers have the challenge of deciding which pathway to take given a huge menu of options. Developers were frequently asking, “How do I put all the pieces together? How does MarkLogic fit into the rest of the stack? Where does middleware fit in? How does the front-end integrate?”

We needed a reference point for where to start and to give guidance on the most common patterns found in a typical MarkLogic application. That’s what Samplestack provides.

Me: And, Samplestack also includes a Reference Architecture, right?

Kasey: Yes, in addition to providing the fully functioning web app, we also provide guidance in our documentation on best practices for architecting applications on top of MarkLogic, as well as for building, testing, and deploying MarkLogic applications.

There are tons of ways that you can build applications on MarkLogic, but by providing recommendations, it provides clarity on what we know works well, which is particularly helpful for developers new to MarkLogic.

samplestack architecture

The Reference Architecture provides guidelines and best practices for building apps on MarkLogic, and includes two different development pathways—one for Java and one for Node.js.

Me: How is Samplestack different from some of the other sample applications that MarkLogic has?

Kasey: MarkLogic has built sample applications for training, such as TopSongs, and of course we have dozens of demo applications that we’ve built for customers. Samplestack is a bit different though. Samplestack is not what many people think of as a “sample app”—it’s a true enterprise application with working code and end-to-end integration.

MarkLogic is an enterprise database, and we wanted users to see its enterprise features in practice. It really helps bridge the gap that many developers have.

Developers often come to us needing guidance on understanding how to really build an enterprise app on MarkLogic from start to finish. They may have had some experience with NoSQL after downloading some open-source software and running some queries, but then when it comes to the hard stuff—transactions, scalability, security—we wanted to provide a framework so that developers could take their apps to the next level.

Me: What are some of the cool MarkLogic features in Samplestack?

Kasey: Samplestack is packed with features. It has full-text search and indexing, authentication and security, and we’re even looking at building in semantics in the next release. I think my favorite feature is the transactional capability though. I actually wrote a blog post about transactions in Samplestack if you want to get technical. Samplestack showcases MarkLogic’s ability to do multi-document, multi-statement transactions that maintain full ACID properties—pretty unheard of with NoSQL.

Me: Did the team learn anything through creating Samplestack?

Kasey: We were definitely drinking our own champagne. It was an excellent opportunity to take on the developer mindset, learning how they might be using MarkLogic as we started working with Native JSON storage, Server-Side JavaScript, and the other new features of MarkLogic 8.

We put ourselves in the shoes of developers learning MarkLogic, and we really got to understand their needs. This applied to a lot of really small things that you don’t normally think about, but which become very important when you’re building an application in the course of a few weeks.

For example, we had choices regarding how complex the data model would be because we had choices in how we stored the text in the application. Samplestack has a lot of text in the Questions and Answers, and some of that text is pulled into search results using snippeting. We had flexibility to store that text in a separate XML document, or just use Markdown, a formatting language that makes it easy to embed programming language code and have a browser syntax-highlight it. We ended up using Markdown, which meant that we could maintain a simple data model based entirely on JSON. It was the sort of an “aha moment” early on in developing the application—that we the flexibility to create either a simple or more complex data model because we had flexibility in how the data was stored.

Me: The team also focused on building multiple development pathways, right?

Kasey: Yes, in the effort to make MarkLogic more accessible, we built Samplestack using both a pathway that would be familiar for Java developers and one familiar to Node.js (JavaScript) developers.

Both pathways use JSON for data, and both use Angular.js in the front-end, but they have different middle tiers. We wanted to make it as easy as possible for a developer who may be new to MarkLogic to pick it up really quickly using the languages and tools they are familiar with.

Me: What have people said who’ve tried it out already?

Kasey: So far the response has been really positive—both to MarkLogic 8 and to Samplestack in particular.

One engineer from Hinttech, David Ennis, has been trying Samplestack and thinks it will be a really powerful tool to get going quickly with MarkLogic: “The fact that SampleStack provides the base scaffolding for an application using technologies (like Angular.js, Java and Node.js) is a powerful statement in itself.”

Me: Anything else to add?

Kasey: I just want to encourage everyone to sign up for MarkLogic World, which is coming up really soon. We’ll be doing a hands-on workshop where we’ll go more in-depth with Samplestack.

Sneak preview… we’ve got a talk planned where we’ll dive into application architecture for Java developers using Samplestack (with Charles Greer – one of the engineers behind Samplestack) and check out a cool new demo using data from the World Cup with Jochen Jörg.

Learn more about Samplestack here

Sign up for MarkLogic World here

Matt Allen

Matt Allen is a VP of Product Marketing Manager responsible for marketing all the features and benefits of MarkLogic across all verticals. In this role, Matt interfaces with the product and engineering team and with sales and marketing to create content and events that educate and inspire adoption of the technology. Matt is based at MarkLogic headquarters in San Carlos, CA and in his free time he is an artist who specializes in large oil paintings.


Comments are disabled in preview mode.

Sitefinity Training and Certification Now Available.

Let our experts teach you how to use Sitefinity's best-in-class features to deliver compelling digital experiences.

Learn More
Latest Stories
in Your Inbox

Subscribe to get all the news, info and tutorials you need to build better business apps and sites

Loading animation