Coder Social home page Coder Social logo

vladimir-krasikov / multiple-mongodb-databases-using-spring-data Goto Github PK

View Code? Open in Web Editor NEW

This project forked from binarycodifier/multiple-mongodb-databases-using-spring-data

0.0 1.0 0.0 172 KB

Multiple MongoDB databases using Spring Data

multiple-mongodb-databases-using-spring-data's Introduction

Multiple MongoDB databases using Spring Data example

This example shows how to interact with multiple MongoDB databases using Spring Data.

It employs the analogy of a market with products (with currency) it has to offer. The currency, products and market are separate entities and on purpose, which reside in separate data stores. Currency is associated directly to the product, whereas products are associated to market in the form of a collection.

Interestingly this is very similar to a very real world market, in a real world stock exchange (market) people/companies purchase instruments (products). Market participants do not need to know everything about the instrument, rather they need to identify the instrument and they are typically concerned about the currency price on the day. Most of these instruments are referenced using well known identifiers e.g. CUSIP, ISIN, etc.

Databases

  • Market
  • Product
  • Currency

Collection names are the same as the database names.

Issue:

There is an issue with retrieving DfRef associated objects in separate databases (persisting works fine). The DbRef can be retrieved from the same database, however cannot be retrieved from another separate database. There is an issue at the MongoDB driver (2.9.1) as it does not truly support multiple DB's. I've patched the driver see my MongoDB driver fork 2.10.0-PATCH

Dependency versions:

  • Spring Data MongoDb 1.1.1.RELEASE
  • Mongo Java Driver 2.10.0-PATCH (forked)
  • Spring Framework 3.1.2.RELEASE

Branches used to verify associations

References:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.