longevity link

Are you developing in Scala against a NoSQL database such as MongoDB or Cassandra? Looking for more than just driver-level support for your persistence operations? If so, then you need to take a look at longevity: a Domain Driven Design persistence framework for Scala and NoSQL. longevity is ready for you to use today! Please give it a try.


Longevity Now Supports Querying with Akka Streams

I'm excited to announce longevity release 0.8, which features streaming queries with Akka Streams! Prior to this release, longevity queries returned a list of results wrapped in a future, which was sort of only half-way reactive, and definitely wouldn't work in the face of query results that were too large to fit into memory. I was never particularly happy with this, but I had enough to do at the time with designing and implementing the query DSL.


Longevity Release 0.7.0 - Entity Polymorphism

Longevity release 0.7.0 is out! The major focus of this release is support for entity polymorphism - that is, subtyping - in your domain model. This is a critical usability feature. It's also hopefully the last of what I might call "core features": those features that require me to go back and rework the core code of the longevity engine, consequently causing major ripple effects throughout the project. So this is a big release for me! It's a critical feature, and hopefully the last feature in a while that takes me a month to complete!

From the outside looking in, it may not seem like supporting subtyping in your domain model should be such a big deal. To understand why this is, I need to step back and discuss some of the key principles and design decisions I made in this project.


An API Design Conundrum

Over the past months, I've been working through a tricky API design problem in the longevity project. After a number of trials, I think I've finally come up with something that does not feel kludgy, and is easy for the user to understand and use. In this post, I will describe the problem I was having, and what makes it difficult. I will show some of my solutions that didn't work so well, and finally, present the solution I've landed on. It's not perfect, and never will be, so I am eager to hear any thoughts you might have on it.


Longevity Now Persists Events and Views

Longevity 0.6.0 release is now out! There are no new features in this release, just a wide selection of API fixes and improvements. You can read the CHANGELOG for a complete run-down, but there is one API change that I would like to focus on today: Longevity now persists events and views - and whatever else you might want - and not just aggregate roots.


Longevity is Like Hibernate … Except that it’s Not

Longevity is like Hibernate, except that it’s not. The two projects share one major goal: provide persistence support for your domain entities in your enterprise application. But they are more different than same.
While Hibernate is for Java and relational databases, Longevity is for Scala and document databases. Hibernate is also an Object-Relational Mapper (ORM), and longevity is not. Let’s break that down.


Longevity Builds Database Integration Tests For You

Longevity - a persistence framework for Scala and NoSQL - provides a variety of tools to help you test your database application. In tests where you don't want to mock your repositories, but you want to avoid the overhead of persisting to a real database, longevity provides you with a suite of fully functional in-memory repositories. There is also a test class that you can extend to test your database queries - you basically just have to build your queries, and the base class does the rest of the work for you. Finally, longevity provides you with a test class that will exercise all the basic CRUD operations for all your repositories against a test database. In this article, we'll take a look at how we go about setting up the CRUD tests.


Longevity Now Has a Cassandra Back End

Longevity release 0.5 is out! The central focus of this release is the shiny new Cassandra back end.

Longevity is a DDD-oriented persistence framework for Scala and NoSQL. It was originally built with a MongoDB back end, but I've always planned on supporting more kinds of databases. Longevity is mature enough at this point to add a second back end, and I chose Cassandra for a few different reasons.