| extend ../_components/base.pug |
| |
| block pagetitle |
| title Apache Ignite Compute APIs - Data-Intensive Computing |
| meta(name="description", content="Apache Ignite compute APIs allow you to perform computations at high speeds. Achieve high performance, low latency, and linear scalability in data-intensive computing.") |
| link(rel="canonical", href="https://ignite.apache.org/features/compute-apis.html") |
| |
| meta(property="og:title", content="Apache Ignite Compute APIs - Data-Intensive Computing") |
| meta(property="og:type", content="article") |
| meta(property="og:url", content="https://ignite.apache.org/features/compute-apis.html") |
| meta(property="og:image", content="/img/og-pic.png") |
| meta(property="og:description", content="Apache Ignite compute APIs allow you to perform computations at high speeds. Achieve high performance, low latency, and linear scalability in data-intensive computing.") |
| |
| block css |
| link(rel="stylesheet", href="../css/native-persistence.css?ver=" + config.version) |
| link(rel="stylesheet", href="../css/compute-apis.css?ver=" + config.version) |
| link(rel="stylesheet", href="../js/vendor/highlight/night-owl.css?ver=" + config.version) |
| |
| script(src="../js/vendor/highlight/highlight.min.js") |
| script(src="../js/vendor/highlight/java.min.js") |
| script(src="../js/vendor/highlight/xml.min.js") |
| script(src="../js/vendor/highlight/csharp.min.js") |
| |
| |
| |
| block main |
| - global.pageHref = "features" |
| - config.hdrClassName = "hdr__blue" |
| include ../_components/header.pug |
| |
| |
| section.innerhero |
| .container.innerhero__cont |
| .innerhero__main |
| .innerhero__pre.pb-3 Apache Ignite |
| h1.h1.innerhero__h1 Compute APIs |
| .innerhero__descr.pt-2.h5. |
| Develop custom tasks in contemporary languages<br> and get the logic executed over a distributed cluster |
| .innerhero__action |
| a.button.innerhero__button(href="https://ignite.apache.org/docs/latest/index") Start Coding |
| img.innerhero__pic.innerhero__pic--computeapis(src="/img/features/compute-apis/compute-hero.svg", alt="Distributed In-Memory Cache") |
| // /.innerhero |
| |
| |
| |
| section.compute1.container |
| h2.compute1__h2.h4 Execute Data-Intensive And Compute-Intensive Tasks At High Speed |
| .compute1__deskr Get an order-of-magnitude performance increase for custom complex logic: |
| .compute1__block.flexi |
| .compute1__item |
| img(src="/img/features/compute-apis/icon-one.svg" alt="").compute1__icon |
| p.compute1__text By minimizing or avoiding network<br> utilization |
| .compute1__item |
| img(src="/img/features/compute-apis/icon-two.svg" alt="").compute1__icon |
| p.compute1__text By executing the logic straight on the <br>cluster nodes |
| // /.compute1 |
| |
| section.compute2 |
| .container |
| h2.compute2__h2 Benefits Of Apache Ignite Compute APIs |
| .compute2__grid |
| .compute2item |
| .compute2-points__item.fz20 |
| .compute2item__block |
| h3.fz20.compute2item__title Broadcast or execute<br> on specific nodes |
| p.compute2__text – Broadcast your tasks to use all<br> the CPUs of your distributed cluster. |
| p.compute2__text – Or schedule the tasks for execution on a subset of the nodes based<br> on custom criteria |
| .compute2item |
| .compute2-points__item.fz20 |
| .compute2item__block |
| h3.fz20.compute2item__title Load balance your logic |
| p.compute2__text If some of the nodes are overutilized, Ignite can automatically load-balance your computations to other nodes. |
| p.compute2__text There are three ways to enable that:<br> – Round-robin load balancing <br>– Random and weighted load balancing<br> – Job stealing. |
| .compute2item |
| .compute2-points__item.fz20 |
| .compute2item__block |
| h3.fz20.compute2item__title Execute computations<br> in a fault-tolerant way |
| p.compute2__text Some computations might take minutes or hours to complete, e.g. <em> drug discovery or logistics simulations.</em> |
| p.compute2__text You don't need to start from scratch if the execution fails in the middle. Restart a calculation from the point<br> of failure. |
| // /.compute2 |
| |
| section.nativecode.container.jsTabWrap |
| header.blockheader.blockheader--spl.flexi |
| h2.h4.blockheader__left Forget about PLSQL, use<br> the language you code with daily |
| .blockheader__right.fz20 |
| p Create tasks in the language of your choice. You don’t need<br> to learn PLSQL any more. |
| .nativecode__tabctrls.flexi |
| a(href="#", data-tablink="nativeTabJava").nativecode__link.active Java |
| a(href="#", data-tablink="nativeTabNET").nativecode__link C#/.NET |
| a(href="#", data-tablink="nativeTabCpp").nativecode__link C++ |
| .nativecode__tabs |
| .nativecode__tab(data-tab="nativeTabJava").active |
| pre.nativecode__codebox |
| code.java. |
| // Broadcast the task to server nodes only. |
| IgniteCompute compute = ignite.compute(ignite.cluster().forServers()); |
| |
| // Each remote server node will execute the logic of the task/lambda below. |
| compute.broadcast(() -> System.out.println( |
| "Hello Node: " + ignite.cluster().localNode().id())); |
| |
| .nativecode__tab(data-tab="nativeTabNET") |
| pre.nativecode__codebox |
| code.csharp. |
| // Broadcast the task to server nodes only. |
| var compute = ignite.GetCluster().ForServers().GetCompute(); |
| |
| // Each remote server node will execute the custom PrintNodeIdAction task. |
| compute.Broadcast(new PrintNodeIdAction()); |
| .nativecode__tab(data-tab="nativeTabCpp") |
| pre.nativecode__codebox |
| code.java. |
| // Broadcast the task to server nodes only. |
| IgniteCompute compute = ignite.compute(ignite.cluster().forServers()); |
| |
| // Each remote server node will execute the logic of the task/lambda below. |
| compute.broadcast(() -> System.out.println( |
| "Hello Node: " + ignite.cluster().localNode().id())); |
| // /.nativecode |
| |
| section.compute3.container |
| h2.compute2__h2 Example Of Logic Building |
| h3.compute3__h2.h4 Execute the logic in place and eliminate network impact on the performance of the calculation |
| p.compute3__text Imagine that a winter storm is about to hit a highly-populated city. As a telecommunication company, you have to send a text message to 20 million residents warning them about the blizzard. |
| .compute4.flexi |
| .compute4__block.compute4__block--bad |
| img.compute4__icon(src="/img/features/icon-check-err.svg", alt="") |
| p.pt-3 With the client-server approach, the company would read 20 million records from a database to an application that executes some logic before finally sending a message to the residents. |
| .compute4__block |
| img.compute4__icon(src="/img/features/icon-check-ok.svg", alt="") |
| p.pt-3 A much more efficient approach would be to broadcast this logic to the cluster nodes that keep data about the city's residents. The logic gets executed on those nodes only and text messages are sent from there. |
| p.pt-3 With the client-server approach, the company would read 20 million records from a database to an application that executes some logic before finally sending a message to the residents. |
| |
| .jsTabWrap |
| header.blockheader.blockheader--spl.flexi |
| |
| .nativecode__tabs |
| |
| .nativecode__tab(data-tab="nativeTabJava").active |
| pre.nativecode__codebox |
| code.java. |
| Ignite ignite = ... |
| |
| // NewYork ID. |
| long newYorkId = 2; |
| |
| // Send the logic to the cluster node that stores NewYork and all its inhabitants. |
| ignite.compute().affinityRun("City", newYorkId, new IgniteRunnable() { |
| |
| @IgniteInstanceResource |
| Ignite ignite; |
| |
| @Override |
| public void run() { |
| // Get access to the Person cache. |
| IgniteCache<BinaryObject, BinaryObject> people = ignite.cache("Person").withKeepBinary(); |
| |
| |
| ScanQuery<BinaryObject, BinaryObject> query = new ScanQuery <BinaryObject, BinaryObject>(); |
| |
| try (QueryCursor<Cache.Entry<BinaryObject, BinaryObject>> cursor = people.query(query)) { |
| // Iteration over the local cluster node data using the scan query. |
| for (Cache.Entry<BinaryObject, BinaryObject> entry : cursor) { |
| BinaryObject personKey = entry.getKey(); |
| |
| // Pick NewYorkers only. |
| if (personKey.<Long>field("CITY_ID") == newYorkId) { |
| person = entry.getValue(); |
| |
| // Send the warning message to the person. |
| |
| } |
| } |
| } |
| } |
| } |
| // /.compute4 |
| |
| |
| section.native-bottom.container |
| .native-bottom__grid |
| article.nativebotblock |
| .h4.nativebotblock__title |
| img(src="/img/features/native-rocket.svg", alt="").nativebotblock__icon |
| span Ready to Start? |
| p.nativebotblock__text Start coding distributed computing APIs |
| a.nativebotblock__link.arrowlink(href="https://ignite.apache.org/docs/latest/key-value-api/transactions", target="_blank") Performing Distributed Computing |
| article.nativebotblock.nativebotblock--learn |
| .h4.nativebotblock__title |
| img(src="/img/features/native-docs.svg", alt="").nativebotblock__icon |
| span Want to Learn More? |
| p.nativebotblock__text Learn more about high-performance computing use cases and see how it works in practice |
| a.nativebotblock__link.arrowlink(href="/use-cases/high-performance-computing.html", target="_blank") High-Performance Computing Use-Cases |
| |
| |
| |
| |
| |