1. What does the word "integrate" really mean? Throughout the years I have seen many projects that claim "integration" with other projects, but in many cases such integration is very poorly done and often only goes to an extent of 2 products simply being able to start together and that’s it. So, what are we to expect from “integration” when it is done right? To me, integration done right is when one product "blends-in" into another and it becomes very hard to tell where one ends and another one begins. Here are some examples of good integration:

    JProfiler & IDEA
    I often need to profile code in search for deadlocks, memory leaks, and bottlenecks. When I downloaded JProfiler and installed IDEA plug in, I was very pleased with the “blend-in” effect. All I had to do is hit JProfiler "Run" button from IDEA and that’s it – all configuration and runtime parameters from IDEA project were automatically reused. I didn’t have to waste time on any JProfiler configuration – it just worked out of the box and I was productive right away.

    GridGain & SPIs
    GridGain with its SPI-based Architecture is able to provide the same kind of “blend-in” effect when integrating with other middleware products. All a user has to do is configure a different SPI that comes with GridGain. For example, if you already use JGroups as your networking protocol, all you have to do is start GridGain with GridJgroupsDiscoverySpi and GridJgroupsCommunicationSpi and all of your JGroups settings will be reused automatically. There won’t be a single extra port open or a single extra heartbeat sent over network - your network will behave just like before, however now you have GridGain running on top of it as well.

    GridGain provides the same kind of "blend-in" integration with many other products, such as JMS, Mule, Coherence Cache, JBoss Cache, JBoss HA, JUnit, Spring, etc… Moreover, by implementing your own SPI (which is a simple Java interface) you can "blend-in" GridGain with any project/application, even if such integration is not provided out of the box.

    So, when evaluating how one product integrates with another, look for "blend-in" effect!
    0

    Add a comment

  2. In his SyncRemoting Cookbook blog, Owen Taylor from GigaSpaces outlines a cheat-sheet that he created for writing GigaSpaces apps. While you can go ahead and read all the required steps from Owen's blog, I just want to counter it with GridGain cheat sheet you would use for creating the same app:
    1. Create GridTask implementation (you need to implement 2 methods, 'map(..) or split(..)' and 'reduce(..)').
    2. If not started, start multiple stand-alone GridGain nodes by executing gridgain.sh or gridgain.bat scripts.
    3. Start GridGain from IDE of your choice (Elipse, IDEA, NetBeans, ...) and execute your task.
    This comparison kind of speaks for itself. Note how there are no explicit deployment steps either. With GridGain, all classes are peer-class-loaded automatically.

    Below is all the code that you would need to write with GridGain. First we create MyWidgetTask which extends convenience GridTaskSplitAdapter adapter and implements 2 methods, 'split(..)' and 'reduce(..)'.

    public class MyWidgetTask extends GridTaskSplitAdapter<Object, Double> {
    // Split task into multiple jobs to run on remote nodes.
    public Collection<? extends GridJob> split(int gridSize, Object arg) {
    List<GridJobAdapter<Object>> jobs =
    new ArrayList<GridJobAdapter<Object>>(gridSize);

    for (int i = 0; i < gridSize; i++) {
    // Create jobs to sent to remote nodes.
    jobs.add(new GridJobAdapter<Object>() {
    // This code will run on remote grid nodes.
    public Serializable execute() {
    // Access jboss cache
    // (could be any other cache or even local HashMap).
    Map<Integer, Widget> widgets = cache.getRoot().
    getChild(Fqn.fromString("/example/widgets")).getData();

    double priceTotal = 0.0d;

    // Calculate average price of all widgets
    // stored on the grid node this job is
    // executing on.
    for (Widget widget : widgets.values()) {
    priceTotal += widget.getPrice();
    }

    return priceTotal / widgets.size();
    }
    });
    }
    }

    // Combines all results received from remote nodes.
    public Double reduce(List<GridJobResult> results) {
    double priceTotal = 0.0d;

    for (GridJobResult res : results) {
    double price = res.getData();

    priceTotal += price;
    }

    // Return average widget price.
    return priceTotal / results.size();
    }
    }

    Now, let's execute our task on the Grid:

    public class MyWidgetExample {
    public static void main(String[] args) {
    Grid grid = GridFactory.start();

    try {
    GridTaskFuture<Double> future =
    grid.execute(MyWidgetTask.class, null);

    System.out.println("Average widget price is: " + future.get());
    }
    finally {
    GridFactory.stop(true);
    }
    }
    }

    This is it as far as coding. GridGain also does not require any XML configuration unless you want to change the defaults.

    Oh yeah... I also forgot to mention that GridGain is Open Source and is absolutely free to use ;-)

     

    2

    View comments

About me
About me
- Antoine de Saint-Exupery -
- Antoine de Saint-Exupery -
"A designer knows he has achieved perfection not when there is nothing left to add, but when there is nothing left to take away."
Blog Archive
Blogs I frequent
Loading
Dynamic Views theme. Powered by Blogger.