Skip to content

Make Java8 the base library for graphql-java #338

Closed

Description

@bbakerman

Java 8 should be the base language and platform level for the graphql-java library.

It has been stated that some people use Java 6 in a production sense and will have trouble moving (which I true - I have been one of those people).

However this has a tangible cost of the innovation that can occur in this library.

For example the graphql spec is likely to approve "subscriptions" every soon and hence to implement that the result objects in the API will probably have to change to CompleteableFutures etc..

Graphql as an idea is quite new and hence people adopting it are more likely to be adopting it inside newer projects and hence able to run newer Java platforms

(This is of course not an absolute fact - just that they will "tend" to be newer)

The ability for the library to evolve is constrained by the Java 6 underpinnings

Also : http://www.oracle.com/technetwork/java/eol-135779.html

Java 6 is End Of Life - in announced in 2011 - ending in 2013 - so its well and truly over in some regards.

I would love to get some feedback from people who absolutely need Java 6 as a counter argument but I suspect the demand is low.

This issue is track the idea of moving to Java 8

Activity

  1. oexza commented on Mar 9, 2017

    @oexza

    I second this! this library is held back by java staying on java 6.

  2. bmsantos commented on Mar 9, 2017

    @bmsantos

    I asked this same question in #283. The given reason, "because many companies are still using it", although acceptable, it is not very convincing. Such companies can always create a new micro/service in the front of their current service(s) and use Java 8 instead (just don't deploy in the same system). After all, this is exactly one of the main reasons why GraphQL shines - it can provide the same as well as reshape consumed data.

  3. andimarek commented on Mar 10, 2017

    @andimarek
    Member

    I was the one who initially decided to support Java 7 and then merged a PR to downgrade to Java 6, because there is not really a big difference between 6 and 7 (on the language level).

    But my initial goal was never to support always 2 older versions, only one.

    Java 9 will be released soon (in a few months) so I think the time to change to Java 8 is now (or very soon.)

  4. bmsantos commented on Mar 22, 2017

    @bmsantos

    Is anyone tackling this task or is it still waiting for other considerations?

    What's the strategy being considered?

    Should #336 happen first? Or should it happen in simultaneous, meaning, move project to Gradle multi-project, keep current in java 6 and create a new one in java 8 and start moving parts into sub-modules in java 8 section.

    Thoughts?

  5. bbakerman commented on Mar 22, 2017

    @bbakerman
    MemberAuthor

    @bmsantos - we dont need to do #336 in order to move to Java 8, as the multi module call was mostly about getting to Java 8

    We need to make a release with the current code as 2.x and then upgrade to Java 8 and release a 3.0 since its a major major breaking change

  6. ieugen commented on Apr 2, 2017

    @ieugen

    Hi everyone,

    I often here the same argument about still using Java 6 when it comes to libraries and while it is a valid argument in some cases it is not valid in all.

    Does someone have real usage numbers of the companies that use graphql on Java 6? If not, the argument to stick to Java 6 might be just guessing.

    Another argument for switching is that Linux distributions provide Java 8 as default install. For example Debian will be released soon with Java 8, but it is available in backports for current stable.

    GraphQL is not used like this on clients so Android compatibility is not an issue here.
    I also believe using Completable Futures and Optional are big wins!

    Disclosure: I'm considering using GraphQL in a production project with vertx.

  7. andimarek commented on Apr 6, 2017

    @andimarek
    Member

    We decided to go with Java 8 in the next release.
    Version 2.4.0 is now out and we will switch to java 8 soon on master for the next release (version 3).

    Thanks everybody for the input.

  8. GrigoryPtashko commented on Apr 6, 2017

    @GrigoryPtashko

    @andimarek so it means that after 2.4.0 I will not be able to use the library on java 7?
    I use graphql and all our production is running on java 7. There's no way to switch to java 8 in the near future.

  9. andimarek commented on Apr 6, 2017

    @andimarek
    Member

    Yes, this means you need at least Java 8 for version 3.

    I am sorry to hear that you can't switch to Java 8 any time soon, but we decided to go with Java 8 after gathering as much input as we could.

    Please consider that Java 7 is no longer updated since April 2015 and Java 9 is out in a few months. This means we will support the latest two version of Java (8+9) with the new major release.

  10. GrigoryPtashko commented on Apr 6, 2017

    @GrigoryPtashko

    @andimarek Sorry to hear that..
    By no means I want to be offensive but IMHO most of the devs I see now do not actually work on production code of big businesses. I agree about java 6. But the preference of the java 8 over the java 7 is just a race for shiny syntactic sugar which actually does not earn money. In most cases it's like a new toy for a developer. I work in a billion dollars business and I do not see requirements that push me to switch to java 8.

  11. andimarek commented on Apr 6, 2017

    @andimarek
    Member

    Here is the switch to Java 8: #359

  12. GrigoryPtashko commented on Apr 15, 2017

    @GrigoryPtashko

    @andimarek @bbakerman @dminkovsky

    People, please, don't turn away from me :) How do you think if after all the
    version of the graphql-java library can be continued with the java 7 support?
    I mean if this is possible at all I can maintain some kind of backward
    compatibility branch with a little help at the beginning.
    I'll explain my motivation:

    1. I'm watching this lib and this repo for almost a year now. I'm not a new person
      I'm just silent because there's a lot of work on my full time job. But..
    2. As a full time developer I work in a company with a very mature codebase
      written totally on java 7 and in runtime we also use java 7. Unfortunately,
      we totally do not have plans to transfer to java 8 since the infrastructure
      is really large, tested and ... working. I think you can understand it.
      But nevertheless I've implemented a graphql backend for our data storage and
      as I continue I find more and more applications of this backend. I mean so far I
      had only the read only schemas, I've tested them in production, people
      started using them. And now I'm going to start writing the write schemas so
      my API will be used for creating and editing objects in our data storage.
      I also use Relay on the front end. And as you may know there are some huge
      changes coming in the new Relay part of which I personally wait for.
      What I'm saying is that I'm really-really interested in having the
      graphql-java lib evolving for the java 7.
    3. I also got a side-project where I use graphql-java but with java 8. I've
      implemented subscriptions in it and in the spring-graphql-common projects.

    I mean that I understand internals and I make use of the lib everyday and
    as I go forward I use it more and more in production.
    What do you say?

  13. ieugen commented on Apr 15, 2017

    @ieugen

    @GrigoryPtashko

    I believe version 2.x will be a "maintenance" branch and will support Java 7, while version 3.x will use Java 8. Backporting takes some time and effort but it is possbile, especially with the IDE support. From what I saw, graphql-java has very little outside depnendencies so that should make things easier.

    That being said:

    Java 7 does not have security support since April 2015 [1] . That should be an incentive to upgrade unlesss the company you work for has bought subscriptions for Java or does not care about security.

    I believe there are solutions to switching you infrastructure to Java 8. It's hard to give good solutions without knowledge about your infrastructure and deployment processes but migrating to a micro-service architecture is one good way of doing it.

    Docker could be used for that and you could package the Java version you need. You could also keep multiple Java versions on the same system.

    I strongly encourage your company to consider a migration strategy for their technologies or at least a containerization solution so you can isolate old services and gain the ability to migrate the other systems.

    I can help if you are interested. Feel free to ping me if you wish to talk about it.

    [1] https://java.com/en/download/faq/java_7.xml

  14. GrigoryPtashko commented on Apr 15, 2017

    @GrigoryPtashko

    @ieugen I understand what you are saying but switching to java 8 is not a solution at all. The codebase is more than 15 years old. We have 30K to 40K database requests per second on the 24x7 basis. We have lots of code like database replication written on java + redis instead of native db replication and so on and so forth. I actually don't want to discuss about how it is right or wrong to stay on a concrete version of some platform.
    I guess nobody is interested in this so I'll try to make this java 7 compatibility by myself.

  15. andimarek commented on Apr 15, 2017

    @andimarek
    Member

    @GrigoryPtashko
    Again, I am sorry that you will not be able to run the latest graphql-java version. But we will not switch back Java 7 and we will not support Java 7 (except maybe bugfixes for 2.4.x).

    This project (as many OSS) is based on voluntary work: nobody earns money with it and we all do this in our free time. We simply can't afford investing any real time in keeping it Java 7 compatible.

    If your company can't switch to Java 8, but still wants to use graphql-java I recommend to fork it and maintain a compatible fork.

  16. GrigoryPtashko commented on Apr 15, 2017

    @GrigoryPtashko

    @andimarek no problem :) I understand everything. I already have a fork and I think I'll try to make a backport after the PR with subscriptions is merged (this one #358).

  17. He-Pin commented on Apr 15, 2017

    @He-Pin

    If this project is wrote in scala and then it could support both Java7 and Java 8 with scala2.11. but it's not:)

    Netty is currently still support Java 6,Java 8 is only required for compiling.

    @GrigoryPtashko Maintain a fork is hard really:)

  18. He-Pin commented on Apr 15, 2017

    @He-Pin

    And yes, this is an open source project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions