2016-12-08

More Longevity Awesomeness with Macro Annotations!

I just got longevity release 0.18 out and wow, is it awesome! If you've looked at longevity before, you will be amazed at how easy it has become to start persisting your domain objects. And the best part is that everything persistence related is tucked away in the annotations. Your domain classes are completely free of persistence concerns, expressing your domain model perfectly, and ready for use in all portions of your application. Of course, we also provide a complete persistence layer for you, saving you countless hours of development effort!

See for yourself, here is a simple example demonstrating how easy it is to get started:

2016-11-15

More API Simplifications in Longevity 0.17

Longevity is the persistence framework to use with Scala and NoSQL. Release 0.17 simplifies the user API in some very pleasant ways. Empty marker traits Persistent and Embeddable are removed. Also, KeyVal now takes a single type parameter instead of two. In brief, this will make defining the classes you want to persist so much easier and more natural, as you no longer have to extend your persistent classes with empty marker traits.

2016-11-11

Longevity Artifacts for Scala 2.11 and 2.12

So I've finally got the longevity build set up to publish artifacts for Scala versions 2.11 and 2.12! I'm a little behind on the game, but, I've been busy ;-). Please use longevity version 0.16.1 for 2.12 artifacts. I'll be publishing artifacts for both Scala versions moving forward.

I'd like to shout out to the wonderful people at ScalaTest - Bill Venners and Chua Chee Seng - for helping me resolve an interoperability issue that made the longevity 2.12 artifacts possible. Thanks again!

2016-11-10

Partition Keys in Longevity

I'm so excited to announce the release of longevity version 0.16.0! Longevity now supports partition keys - a key where, given a key value, we can determine the node in a distributed database where the data resides (or would reside, if it existed). This is a critical feature for NoSQL databases in a distributed context. A partition key is implemented with sharding in MongoDB, and with partitioning in Cassandra.

I'll provide a brief example of a partition key here after the jump, but to learn more about it, please take a look at the user manual.

2016-10-13

Longevity 0.15.0 - Query Enhancements

Longevity - a persistence framework for Scala and NoSQL - is now up to version 0.15.0! The latest release focuses on query enhancements. We have added orderBy, offset, and limit clauses to our queries and query DSL.

2016-10-03

Sample Application for Longevity and Play Framework

I've ported my sample longevity application - Simple Blogging - from Akka HTTP to Play. The Play version is a Lightbend Activator tutorial, which you can find here. Or you can take a look at the source code here on GitHub.

Longevity is a persistence framework for Scala and NoSQL.

2016-09-26

Longevity 0.13.0 - Odds and Ends

In the past few weeks longevity has had three minor releases (0.11, 0.12, and 0.13) that clean up a variety of odds and ends that had been building up in the backlog. There was nothing major or exciting in these releases, but they are nonetheless important improvements. I haven't really publicized them much, but I wanted to let you know that longevity development is still proceeding.

Here are some changes that are worth mentioning:
  • You no longer have to specify polyType and polyPType in your DerivedTypes and DerivedPTypes, respectively.
  • Instead of just creating schema every time, I've added RepoPool.createSchema(), which you can call as you like. Schema creation is still non-destructive. And you can turn on the old behavior with configuration flag longevity.autocreateSchema.
  • I added RepoPool.closeSession(), so you can clean up resources held by the underlying database drivers.
  • I added some logging output.
  • I added JSON marshallers and unmarshallers to the longevity context.
Next on the list is query enhancements! Although I have a couple of things to work on other than longevity proper that may precede it. I need to debug and fix a problem that has come up with longevity tests in ScalaTest version 3.0.0. And I'm thinking I'll port my sample application simbl from Akka HTTP to Play.

2016-08-26

Configuration-level Optimistic Locking with Longevity

Longevity - a persistence framework for Scala and NoSQL - has been built from day one to isolate persistence concerns behind a clear, consistent, and easy to use API. The power of this design principle is demonstrated by how easy it is for you to bring optimistic locking to your application. All you have to do is set a configuration flag.

Longevity is growing to full maturity, and most features you would expect from a persistence framework are in place. Our 0.10.0 release brings many incremental improvements - including support for controlled vocabularies. But the central feature of this release is configuration-level optimistic locking.

2016-08-17

Longevity Framework Cares About Code Quality

We care a lot about code quality here at longevity framework. You can rest assured that longevity is well-designed, has clean code, and a robust test suite. As of now, code coverage comes in at 95.02% statement, and 93.44% branch, as measured by sbt-scoverage. What software projects do you know of that have that kind of coverage?

2016-07-20

Longevity Getting Started Guide Now Available

I'm happy to announce that the Getting Started Guide for longevity is now available. It walks through a sample application called Simple Blogging, which uses longevity on the back end, and Akka HTTP on the front.

This guide will walk you through the basics of using longevity within a real application.

2016-07-15

Longevity Now Has a Streamlined API!

I'm very excited to announce the 0.9.0 release of longevity, which features a whole slew of API improvements that make longevity much easier to use and understand. Here are the three most significant changes:

  • Shorthands are gone
  • Assocs are gone
  • The API for Key and KeyVal has been reworked for significant ease-of-use improvements
I'll discuss each of these changes in more detail below.

2016-05-26

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.

2016-05-19

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.

2016-04-11

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.

2016-04-01

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.

2016-03-28

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.

2016-03-08

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.

2016-03-02

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 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.

2016-01-13

Longevity: A Persistence Framework for Scala and NoSQL

Longevity is a persistence framework for Scala and NoSQL. We currently support MongoDB, with a Cassandra back end coming soon. [UPDATE: We've had a Cassandra back end for a long time now. We now have a SQLite back end as well.] After having been working on this project for over a year, I am so excited to finally share it with you! I've been working hard to put in a core set of features that would make the tool feasible for you to use in a real application. The result is our MMP release, which we just put out yesterday.