As our last post said, the following articles will discuss about our huge code refactoring. So let‘s start with the first part of this serial.
Our persistence layer consisted of MyBatis framework on top of 2 databases, Oracle and Teradata. These databases are typically used by our customers so it was natural for us to choose these. However, this approach has several limitations. We don’t have control over database as customers doesn’t like to let us in. MyBatis has also several limitations in combination with our sure not ideal database schema design. Last but not least it is performance of Teradata with multiple join queries. To sum things up, basic requirements were to minimize these limitations. Beside of that our new architecture should allow us to run repository as a (micro)service in different JVM so we can use it from many applications at the same time via nice and clean API.
We started to look around what databases are available now. We wanted something free with fast search, dynamic schema and ideally written in Java so we can be sure that it runs smooth beside our app. OrientDB looked very promising, on the paper like perfect fit, but after few days playing with it we changed our mind. It doesn’t fit our requirements as well as we first thought. Relations were not fast enough for our use case, API wasn’t much smooth, tooling was poor and support (and by support I mean of course stackowerflow ;)) not so good. With broken hearts we said goodbye and moved on.
Our sight got focus on search engines. Maybe little unexpected and not traditional way how to solve primary data source for application, but we gave it a shot. For us, Java developers, there are more or less 2 options – Elasticsearch or Solr. Both based on Lucene with very similar feature set. Feeling after first touch was good, maybe more than good. Search fast as hell, dynamic schema, nice API, good documentation and support… Elasticsearch was little simpler, but we chose Solr due to former experience and started to develop prototype of our new repository. Analysis, architecture, design, integration tests, unit tests, implementation, refactoring… development is in full swing and only time shows where these decisions will lead us.
Please, write us your opinion on our resolution here and enjoy the second part of our serial soon!