Skip to content
This repository has been archived by the owner on Apr 23, 2021. It is now read-only.

Scala lightweight, type-safe, streaming driver for MongoDB

License

Notifications You must be signed in to change notification settings

BalmungSan/scala-mongodb-streaming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scala-mongodb-streaming

Scala lightweight, type-safe, (not opinionated) streaming driver for MongoDB.

This driver is just a simple wrapper over the MongoDB Reactive Streams Java Driver. Which provides a more "Scala-friendly" API.

The driver is divided into the core module, which provides a generic abstraction over the java driver. And a set of implementation modules, which each one provide a concrete instance of the Stream[S[_]] typeclass for different streams of the Scala ecosystem.

Usage

Module Description
"com.github.balmungsan" %% "scala-mongodb-streaming" % version Core functionality.
"com.github.balmungsan" %% "scala-mongodb-streaming-akka" % version akka.stream.scaladsl.Source[T, NotUsed] implementation.
"com.github.balmungsan" %% "scala-mongodb-streaming-fs2" % version fs2.Stream[F, T] implementation (For any F which has an instance of cats.effect.ConcurrentEffect[F], like IO).
"com.github.balmungsan" %% "scala-mongodb-streaming-monix" % version monix.reactive.Observable[T] implementation.
"com.github.balmungsan" %% "scala-mongodb-streaming-zio" % version zio.stream.ZStream[Any, Throwable, T] implementation.

Motivation

My very first Scala project used mongo, at that time we used the MongoDB Scala Driver. I really liked the friendliness of the API. However, as time passed, and I started learning about FP, streams became my preferred abstraction for dealing with data-flows. That is how I ended up using the reactive driver together with fs2-reactive-streams.

I have to say that everything has been great until now. But nevertheless, since the reactive driver is written in Java, sometimes the interaction with the API is not as pleasant as I would like.

This is an attempt to provide the same functionality with a more friendlier API, and make it independent of the underlying streaming implementation.

Credits

Many other projects have been used as an inspiration, here is a list of the main ones:

License

The project is licensed under the Apache License 2.0. See the LICENSE file for more details.

Code in scala-mongodb-streaming is derived in part from:

  • MongoDB Reactive Streams Java Driver, licensed under the Apache License 2.0.
  • Akka, licensed under the Apache License 2.0.
  • FS2, licensed under the MIT License.
  • Monix, licensed under the Apache License 2.0.
  • ZIO, licensed under the Apache License 2.0.
Copyright 2019-2019 All scala-mongodb-streaming contributors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

Scala lightweight, type-safe, streaming driver for MongoDB

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages