Drivine is a graph database client for Node.js and TypeScript. It was created with the following design goals:
- Support multiple graph databases (simultaneously, if you wish). Currently AgensGraph and Neo4j.
- Scale to hundreds and thousands of transactions per second, without compromising architectural integrity.
With regards to the second point on scaleability, let's break that down into component facets.
- Facilitates the use of well understood object-oriented and functional programming patterns.
- Supports implementation of code that adheres to a single responsibility principle (SRP). NestJS will be optional, but is recommended.
- Takes care of infrastructure concerns, so that you can focus on making the most of your data.
- Removes boiler plate code, especially the tedious and error-prone kind.
- Supports streaming, without back-pressure. Large amounts of data can be managed in a timely and memory efficient manner.
- Light-weight use-case specific object graph mapping (OGM).
Start creating repositories like the one below. Follow the Quick Start guide here.
@Injectable()
export class RouteRepository {
constructor(
@InjectPersistenceManager() readonly persistenceManager: PersistenceManager,
@InjectCypher('@/traffic/routesBetween') readonly routesBetween: CypherStatement) {
}
@Transactional() // Has default Propagation.REQUIRED - partipicate in a current txn, or start one.
public async findFastestBetween(start: string, destination: string): Promise<Route> {
return this.persistenceManager.getOne(
new QuerySpecification<Route>()
.withStatement(this.routesBetween)
.bind([start, destination])
.limit(1)
.transform(Route)
);
}
}
Clone the sample app and start hacking.
The sample app contains a basic starter template. Also, so that you can get rolling as quickly as possible, a number a graph database koans, for typical use-cases - recommendations, social networks, etc, each presented in a Drivine style.
Detailed documentation is here.
New to graph databases? Read some tutorials.
Have a tutorial you'd like to share? Get in touch with me.
Drivine was created by Jasper Blues (that's me), who is also the creator of a popular iOS library called Typhoon from AppsQuick.ly. Typhoon is included in thousands of iOS apps including Audible.com, AMEX, Etihad Airlines, Singapore Airlines and others, so you're in good hands.
The ideas behind this library were developed while developing graph-powered applications like Vampr, which serve hundres/thousands of thransactions per second. I wanted to demonstrate how to use clean architecture patterns, and tools that remove boiler-plate, without sacrificing performance. I was informed in this tasks through experience as a past committer to the Spring Framework including on Spring Data Neo4j. More iportantly, discussion and debate with colleagues, especially among those with experience applying mapping frameworks on applications that needed to exhibit high performance guided design choices. I believe that Drivine strikes an excellent balance in these regards. Let me know what you think.
If you can't find what you need in the Quick Start or User Guides above, please get in touch.
Great! A contribution guide, along with detailed documentation will be published in the coming days.
Please raise a GitHub issue.
Copyright (c) 2019 Liberation Data
Drivine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.