java: All content tagged as java in NoSQL databases and polyglot persistence
Tuesday, 1 February 2011
Domain-model persistence with Morphia and MongoDB
Morphia is an Apache-licensed Google Code project that lets you persist, retrieve, delete, and query POJOs stored as documents in MongoDB. Morphia accomplishes this by providing a set of annotations and a wrapper around the Mongo Java driver. Morphia is conceptually similar to object-relational mappers such as Java Persistence API (JPA) or Java Data Objects (JDO) implementations. In this article, I’ll show how to use Morphia with a Java domain model mapped to MongoDB.
There are various ways to use MongoDB from Java and major MongoDB Java frameworks got compared.
Original title and link: Domain-model persistence with Morphia and MongoDB (NoSQL databases © myNoSQL)
via: http://www.ibm.com/developerworks/java/library/j-morphia/index.html?ca=drs-
Monday, 13 December 2010
NoSQL Databases in Grails and Spring Data
When checking the ☞ GitHub repository for Grails/GORM entities support for Riak MapReduce I have noticed multiple NoSQL integration projects[1]
:
Grails/GORM and NoSQL databases:
- Gemfire
- JCR
- MongoDB
- Redis
- Riak
Spring Data and NoSQL databases:
- AppEngine
- Cassandra
- Gemfire
- JCR
- MongoDB
- Redis
- Riak
What seems to be missing is the Neo4j support in Spring Data, but maybe there’s a different repo for it.
Finally lots of love for NoSQL database in the Java land.
- At this time I’m not sure about each of these project status. (↩)
Original title and link: NoSQL Databases in Grails and Spring Data (NoSQL databases © myNoSQL)
Neo4j Exceptions
As protocols, APIs are an extremely important part of the product and in case you have a rich API you might face criticism:
Now if a DeadlockDetectedException, HaCommunicationException, NotFoundException(thrown if a request is made to a node, relationship or property that does not exist), NotInTransactionException, ReadOnlyIndexException or TransactionFailureException were thrown, what would I really do about it? Nothing much, unfortunately. There is no way I could be smart and recover from these. At the most I’d log it and re-throw it.
A while back I had my part of suggestions related to Neo4j API and some of those became part of the Neo4j 1.2 roadmap. Problem is not that API is not fixable, but if you want to maintain backward compatibility things are quickly becoming complicated (or leading to ugly APIs).
Update: I’ve received a couple of comments that made me realize that most probably I haven’t expressed myself too well. So here is another attempt:
- it is normal for graph databases (and embedded databases) to have richer APIs. That’s why I’ve suggested to some of the graph databases to look more into providing it as a service, as that would reduce a bit the complexity
- it is normal that a complex API would not always be obvious and perfect to everybody
- it is great to get feedback about your API (in whatever form it comes, from “your API sucks” to “it’s good, but I’d like to be able to do this and that”) as it means that:
- your users are getting deeper into your product and they care about it
- you’ll have a chance to improve it over time so new users will find a better API
- maintaining backward compatibility for complex APIs is always a challenge and you must think about this as early as possible so you can follow the same policy over time
Original title and link: Neo4j Exceptions (NoSQL databases © myNoSQL)
via: http://thought-bytes.blogspot.com/2010/12/runtimeexceptions-and-neo4j.html
Tuesday, 7 December 2010
CouchDB and Java
There are five different APIs recommended by CouchDB for use with Java. Each one uses a different API for JSON encode/decode, for logging and for the HTTP Stuff. If you want to use SSL, that’s also implemented differently
If they don’t want to support official libraries for CouchDB for every language, maybe they’ll do it for the ones where people are really confused on how to get started. Just maintaining a list as I do on NoSQL libraries for CouchDB is not enough.
Original title and link: CouchDB and Java (NoSQL databases © myNoSQL)
Wednesday, 20 October 2010
JOhm: Object-Hash Mapping for Redis and Java
In case you cannot use Redis with Grails, you might find JOhm interesting:
JOhm is a Java library for storing objects in Redis, a persistent key-value database.
Still in early versions, but looks promising.
Original title and link: JOhm: Object-Hash Mapping for Redis and Java (NoSQL databases © myNoSQL)
Sunday, 17 October 2010
MongoDB and R using Java
It would be nice if there were an R package, along the lines of RMySQL, for MongoDB. For now there is not — so, how best to get data from a MongoDB database into R
I told you before about R and “data addicts”
Original title and link: MongoDB and R using Java (NoSQL databases © myNoSQL)
via: http://nsaunders.wordpress.com/2010/09/24/connecting-to-a-mongodb-database-from-r-using-java/
Thursday, 7 October 2010
Redis and Java: JOhm
JOhm is a Object-hash mapping library for Java inspired on the awesome Ohm.
JOhm is a library for storing objects in Redis, a persistent key-value database.
Sounds quite similar to Redis support in Grails.
Original title and link: Redis and Java: JOhm (NoSQL databases © myNoSQL)
Wednesday, 29 September 2010
MongoDB: A Conversation Between Eliot Horowitz and Andy Glover
After ☞ posting an intro article on MongoDB with Java — we have a couple of these over here too, starting with this tutorial on MongoDB in Java and MongoDB Java frameworks compared — Andrew Glover ☞ publishes an audio recording of an interview with Eliot Horowitz, 10gen CTO and the first to have declared MongoDB is after MySQL and PostgreSQL users.
Original title and link: MongoDB: A Conversation Between Eliot Horowitz and Andy Glover (NoSQL databases © myNoSQL)
Tuesday, 14 September 2010
Redis: Implementing Auto Complete or How to build Trie on Redis
In the days the news are about instant searches and auto complete, Salvatore Sanfilippo (@antirez) shows how to use Redis sorted sets and corresponding commands (ZRANGE, ZRANK) to implement autocompletion:
The initial code in Ruby:
already got ported to Python:
As Ilya Grigorik (@igrigorik) commented, this is building a ☞ Trie with Redis.
Original title and link: Redis: Implementing Auto Complete or How to build Trie on Redis (NoSQL databases © myNoSQL)
Wednesday, 8 September 2010
Redis: Java Libraries
Staying in the Java land, I’ve put together this short list of Redis Java libraries as I’m looking myself for a stable one:
JRedis
Main page mentions that JRedis is compatible with Redis 1.2.x only. But JRedis author left a comment mentioning that JRedis is Redis 2.0.0 compatible.
jedis
Project home page mentions that Jedis is compatible with Redis 2.0.0. Currently the following features are supported:
- Sorting
- Connection handling
- Commands operating on all the kind of values
- Commands operating on string values
- Commands operating on hashes
- Commands operating on lists
- Commands operating on sets
- Commands operating on sorted sets
- Transactions
- Pipelining
- Publish/Subscribe
- Persistence control commands
- Remote server control commands
- Connection pooling
scala-redis
A library developed in Scala (you should still be able to use it from any VM language) compatible with Redis 2.0.0. Some features:
- Native Scala types Set and List responses.
- Consisten Hashing on the client.
- Support for Clustering of Redis nodes.
Have I missed any? Also wondering which of these is stable.
Update: Graeme Rocher (@graemerocher) pointed out:
java-redis-client
According to project home page, it is compatible with Redis 2.0.0, but there are no other details.
Original title and link for this post: Redis: Java Libraries (published on the NoSQL blog: myNoSQL)
Most Popular Articles
- Translate SQL to MongoDB MapReduce
- Tutorial: Getting Started With Cassandra
- CouchDB vs MongoDB: An attempt for a More Informed Comparison
- Cassandra @ Twitter: An Interview with Ryan King
- A Couple of Nice GUI Tools for MongoDB
- NoSQL benchmarks and performance evaluations
- Ehcache: Distributed Cache or NoSQL Store?
- Document Databases Compared: CouchDB, MongoDB, RavenDB
- Quick Review of Existing Graph Databases
- NoSQL Data Modeling