Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alternative to Java/Spring based Webservices

I'm looking for alternatives for my team to create simple REST services which respond in JSON format to several clients. As far these services are developed on Spring MVC with Hibernate. It is a mandatory to connect and work with legacy databases (SQLServer, DB2 and MySQL - depends on project). Now I'm looking for alternatives to take the service development to a lighter approach. Don't get me wrong: Spring does a good job but sadly not everyone in our team is familiar with Spring even Hibernate. Addtion to this: In most cases not the full Spring stack is even needed. It would help also to get rid of the JVM too.

I was thinking of something script-like solution. Maybe PHP? Is there something like an ORM which could work on legacy DB systems? Same for Ruby on Rails.

Maybe there is something which I haven't heard of or come to now. I would love to hear you opinions or experiences whith other techniques.

Regards

like image 741
onigunn Avatar asked Dec 04 '11 23:12

onigunn


People also ask

Is Quarkus better than Spring?

Quarkus provides faster hot reloads than Spring Boot since it can automatically detect changes made to Java and other resource/configuration files, and transparently re-compile and deploy the changes. This feature can also be used with Quarkus applications running in a remote environment.

Which is better Django or Spring?

{Django as well as spring are both open-source tools frameworks that helps developers build excellent applications. These applications can both be web-based as well as standalone. Django being a more mature language has more Github stars and forks compared to spring. Companies prefer Django more than Spring.

Which one is alternative to the Spring MVC?

Spring WebFlux is the new module, it's an alternative to spring-webmvc module and built on reactive framework. This module is used to create fully asynchronous and non-blocking application built on event-loop execution model.


2 Answers

JAX-RS is a really nice lightweight way of doing rest on the JVM. There are plugins that convert JAXB annotated objects into JSON, or you could just roll that yourself in a multitude of ways.

EclipseLink is a good implementation of the JPA spec. Its a pretty easy way to map your objects to the database through annotations. JAX-RS works with this by default, e.g. you can look up an object with JPA. You can then annotate it with JAXB and then return it straight up from your web service method (if you want XML) and it will just work. There's also a plugin for Jersey (the JAX-RS reference implementation) that allows you to serialize things as JSON this way too.

These JAX-RS, JPA and JAXB are three really nice API's. They don't do everything, but they're lightweight and help you to get real work done without a lot of fuss.

like image 137
Bill Avatar answered Sep 30 '22 17:09

Bill


Not sure if you would be willing to go in this direction, but I recently wrote a webservice in ASP.NET MVC 3. You can bind the passed JSON directly to object models without having to write any extra code. You can also configure the URLs to match the REST standard. If you are working with something like SQL Server this approach would probably be pretty straightforward.

like image 28
Mike L. Avatar answered Sep 30 '22 17:09

Mike L.