Friday, April 14, 2017

Turbocharging SAP Hybris with SAP HANA


In my current work with Hybris, in most implemented solutions, scalability challenges come at persistent layers where there is a little say over data management (due to Item modelling created within the persistence layer in hybris) to normalize/optimize the database. To overcome it, I am currently trying to utilize SAP HANA, which is a relational database offering benefits of NoSql databases as well (as it is a RAM residing database which offers instantaneous data results akin to other OLAP offerings).

First, I sign up with SAP Cloud Platform which is currently offering a full scale HANA instance for 12 hrs (you would need to restart the instance). After this, I can create a database on the SAP Cloud Platform Cockpit as well as view my login credentials.





Next, I set that up on my local machine via eclipse. To use eclipse, one needs to install hana library (which I did via this update site : https://tools.hana.ondemand.com/neon on my Eclipse Neon).



Here I can see various infrastructure related things that can be modified to set the database level user management as well as utilize Hana for other things like predictive analysis, real-time machine learning from the available data, etc.





 
Now that our connection has succeded, we can create a little jdbc application to test the credentials that we used to confirm whether we can connect with the database. We will need to have the Hana java driver in the classpath to make this happen.



 

It is worth mentioning that as the database is tunneled via the Hana viewer, the host becomes localhost:30015 and the user name/password is the one that you have set for the database instance (not the S/P user ID that SAP gave you or the userd id of the SAP Hana Cloud instance)


After this, we can trivially set this up on Hybris via the following db configuration in local.properties:

db.url=jdbc:sap://localhost:30015/?reconnect=true
db.driver=com.sap.db.jdbc.Driver
db.username=
db.password=

Start the Hybris and initialize it (note the DB name in the following image)



After initialization, you can use Hybris as an e-Commerce/CRM solution and utilize HANA as its extremely fast and fault-tolerant backend system.
My experience was that it was not as blazingly fast as it is portrayed to be, but then I am just using a 2MbPS connection but YMMV.

What was your experience ? Do let me know in the comments below or shout out to me @sumitbbd your experiences.

Wednesday, January 18, 2017

JRebel alternatives for SAP Hybris

Developers hoping to accelerate their Hybris debugging time while skipping the time consuming steps of ant clean all - server start and then debugging can do so with DCEVM and change code on the fly basis and view it on the browser without having to restart hybris.

Advantages

  • Reduced time to carry out trivial changes.
  • Faster development cycle.
  • Flexibility in trying out features.
  • Increased server uptime.

Step-by-step guide

Login into help.hybris.com and view the following page for this:
https://help.hybris.com/6.2.0/hcd/0b40907d5db14955bf4074b4b25e6998.html

Although the steps are mentioned in the hybris help, this post is done to incorporate other changes that we faced here in Eperium.
  1. Download the light installer from https://github.com/dcevm/dcevm/releases
  2. Open cmd from start menu and right-click 'Run as Administrator' (as there are no sudo user console otherwise in Windows)
  3. cd to location where DCEVM jar is present and run java -jar DCEVM-light***-installer.jar 
  4. Run the install DCEVM as altjvm for your JDK
  5. If there is an permission error, you need to check if jar was run with admin privledges (see point #2 above)
  6. If there is an error 'could not get dceversion of ..' , then download a different version (try older and stable versions from step #1 above)
  7. Add the following to local.properties
tomcat.debugjavaoptions=-XXaltjvm=dcevm -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=n



Do an ant to update configurations in the embedded tomcat server (used by Hybris) and run Hybris server in debug mode. Now connect Eclipse with it as remote process.

Thursday, December 29, 2016

Microservices as a Product

Now that the year is wrapping to an end, use of microservice architecture continue on the rise. However, people are often confused in understanding the use and more importantly, rational behind creation of these services which are not to be confused with API and providing versioning of them in silo-ed manner, but to ensure that all end consumers are accommodated by them.
In a recent technology radar, a term 'Microservice As A Product' was promoted, which prompted my introspection and in my opinion is misleading because when you market a product, there are a bunch of micro services that are documented and provided, and over time, these grow and parallel services provide an alternative - while the original ones remain for backward compatibility.
It is true that established players are promoting microservices in cloud and also provide a marketplace, but treating it as a product is a bit far fetched; as terming it as tooling (a software component) rather fits the job well. Otherwise, we are bound to be stuck with the naming conventions and keep getting confused (similar to an application and a plugin).