Question

Is Teradata is suggested for use in OLTP operation with java web application. Is hibernate is the good choice to use an ORM layer with Teradata ? Please suggest.

Was it helpful?

Solution

I'm not sure of the suggestion but I have worked in one of the application where we used TD for transactional operations and while doing the load testing we found some issues in performance. We involved TD team as well and came to know that referential integrity is overhead for amp operations on TD. So, my personal opinion, if you want to achieve concurrency for OLTP operations in TD then compromise with performance.

OTHER TIPS

Honestly, Teradata wouldn't be my first choice for an OLTP application: its strenghts are, IMHO, in other scenarios. It is not that it's impossible to do such an application, but it needs from the start the maximum attention to avoid falling in the traps other users have already mentioned (blocking, deadlock, etc)

I also doubt that a vanilla usage of Hibernate would be good fit for a Teradata OLTP application: you might find out you have to force Hibernate acting in a "non-standard" way (but I admit I always favour solutions that give me total control on my SQL).

Some hints we used on a Teradata OLTP-like application.

  1. strive for single-AMP queries (this might change the approach about how to model the database, favouring a small number of "strong entities").
  2. use as much cache as you can: the Teradata connection is a precious resource you'd better not use for information that doesn't need to be realtime
  3. group as much data as you can: avoid doing three separate queries if you can have a single query returing all the info
  4. for batch insert in Java, keep the primary index columns of the target table as numeric (it seems that distribution is better on unique numeric primary index, rather than on unique string primary index, and this has an impact on locking)
  5. avoid "pagination" interface for large data sets (use "top" for the first "n" pages and then ask the user to better qualify his search)
  6. favour "macro" over "stored procedure"
  7. check your locking requirements: you'll probably end-up using lots of "LOCK ROW FOR ACCESS" modifiers (opening the possibility of "dirty reads", but in some cases it might be necessary)

Our team also struggling to prove teradata as OLTP. You need to take care of lot of things when using teradata for OLTP, We are frequently facing blocking, deadlocks and performance issues in that. We need to understand more about the teradata locking mechanism and concurrency access. Our application also purely hibernate with TD. Teradata will support muli statment concept that means you can do the mulit insert/update in a single query. If you are going for hibernate that is not possible. Hibernate has its own advantage as ORM. But when it comes with Teradata we need to step back and think.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top