MarkLogic for Node.js Developers

I’ve been working on a book — MarkLogic 8 for Node.js Developers. The thing about writing a book is that it doesn’t help anybody until it’s done. With that in mind, I decided to put what I have so far up here as a work in progress. You will find sections that are incomplete or need polish. Your feedback is welcome; also feel free to comment on incomplete sections to encourage me to get to them. My notes about what I still need to work on will be [in brackets].

MarkLogic 8 for Node.js Developers is for JavaScript developers who are new to MarkLogic. This book will show how to use the many features of MarkLogic to solve Big Data problems.

MarkLogic offers detailed documentation on their Developer site. Currently, the PDFs about 4,600 pages of documentation, in addition to the HTML pages describing over 2,600 functions available in both XQuery and JavaScript, various tutorials, videos and blog posts. This book will give you a learning path that introduces you to all the concepts you need, with an emphasis on building production-worthy, robust applications. Along the way, we’ll cover topics like deploying your application in multiple environments and testing your code.

This book does not spend much time on building user interfaces for MarkLogic applications; rather the focus is on making use of MarkLogic features to provide the best information for applications.

I assume that you know how to work with JavaScript and have at least some knowledge of Node.js. No prior knowledge of MarkLogic is assumed.


As you read through this book, you will be shown how to build an application using MarkLogic 8. In order to do the same steps, you will need to install MarkLogic, which you can download from After installing, the software will guide you through the process of getting a free Developer License. All exercises in the book assume that you have installed MarkLogic 8 on localhost using the default ports.


MarkLogic has published a reference application showing how to build on a three-tier stack, using AngularJS for the user interface, MarkLogic for the database, and either Node.js or Java for the middle tier. This book will use the Node version of Samplestack to illustrate various points.

Table of Contents

I’ll add content over time and link to it from here.

  • Welcome to MarkLogic
    • Why MarkLogic?
    • Concepts
    • MarkLogic Application Architecture
    • Working With MarkLogic
    • Samplestack
    • Additional Resources
  • Loading and Modeling Data
    • Data Modeling
    • Loading Data
    • Updating Data
    • Additional Resources
  • Configuration
    • Databases
    • Application Servers
    • Additional Resources
  • Search
    • Building Queries
    • Search Performance
    • Additional Resources
  • Updating Content
    • Additional Resources
  • Semantics
    • Additional Resources
  • Security
    • Authentication
    • Authorization
    • Security in Samplestack
    • Additional Resources
  • Alerting
    • Additional Resources
  • Testing and Debugging
    • Additional Resources
  • Performance
    • Additional Resources
  • Appendix A: ACID Transactions
    • ACID Principles