2. Werner Keil Thodoris Bais
Jakarta EE Specification Committee Member Expert Group Member JSR-385
Let’s meet
@thodorisbais@wernerkeil
3. @thodorisbais@wernerkeil
ABN Amro Bank
Financial sector
Amsterdam
Agile organization
20,000
3000+
400+
Total number of employeesEnterprise bank
Headquarters Development Teams
DevOps / Hybrid cloud Applications
6. • Develop with agility
• Operate at any scale
• Deliver the performance and
availability required to meet the
demands of Digital Economy
businesses
6
What are the technical challenges?
7. 7
• Handle large volumes of data at high-speed with a scale-out architecture
• Store unstructured, semi-structured, or structured data
• Enable easy updates to schemas and fields
• Developer-friendly
• Take full advantage of the cloud to deliver zero downtime
Advantages of NoSQL
8. Why this talk
Tons of persistence frameworks
Which one performs best for your case?
JVM can cope with heavy loads
Would normally take ages to
compare
26. Repository with Queries
interface PersonRepository extends Repository<Person, Long> {
@Query("select * from Person")
Optional<Person> findByQuery();
@Query("select * from Person where id = @id")
Optional<Person> findByQuery(@Param("id") String id);
}
27. Diversity
@Entity("god")
public class God {
@Column
private String name;
@UDT("weapon")
@Column
private Weapon weapon;
}
interface GodRepository extends
CassandraRepository<God, String> {
@CQL("select * from God where name = ?")
List<God> findByName(String name);
}
28. List<Movie> movies = documentTemplate.query("select * from Movie
where year > 2012");
List<Person> people = columnTemplate.query("select * from Person
where age = 25");
Optional<God> god = keyValueTemplate.query("get 'Ullr'");
List<City> cities = graphTemplate.query("g.V().hasLabel('City')");
Query by Text
37. Entities
@Node("Person")
public class PersonEntity {
@Id
private final String name;
private final Integer born;
}
@Node("Movie")
public class MovieEntity {
@Id
private final String title;
@Property("tagline")
private final String description;
@Relationship(type = "ACTED_IN", direction =
INCOMING)
private Map<PersonEntity, Roles> actorsAndRoles =
new HashMap<>();
@Relationship(type = "DIRECTED", direction =
INCOMING)
private List<PersonEntity> directors = new
ArrayList<>();
}
43. Conclusions
Still in Progress ❌
Supports a huge number of NoSQL
database systems
✅
Loosely coupled code makes switching between
different NoSQL vendors just a matter of configuration
✅
Removes boiler-plate code and
provides a cleaner, more readable DAO
✅
44. Conclusions
Switching between different NoSQL
vendors not so easy
❌
Micronaut Data does not support NoSQL
databases yet
❌
Still in Progress ❌
Often faster with a lower footprint, polyglot language
support for Java, Kotlin and Groovy
✅
45. Conclusions
Provides a cleaner and more readable DAO
implementation
✅
Loosely coupled code makes switching between
different NoSQL vendors just a matter of configuration
✅
Removes a lot of boiler-plate code ✅
Only half a dozen wider used NoSQL databases are supported
out of the box, others require more effort or won’t work yet ❌
46. Conclusions
Using a mapper for all scenarios is not a
recommended approach
❌
Some JPA concepts are not easily mapped to
the NoSQL world (e.g. transactions)
❌
Error safe way to run the query language and hydrate DTOs from
the result the simplest way possible ❌
Outdated documentation ❌