Category Archives: Programming Languages

Programmable Networks – Is The Dream Finally Coming True?

One of the hottest trends in the Telecommunications industry is Software Defined Networking (SDN), the idea that you can control the logic of the data flow dynamically using central programmable logic, instead of having it hard-coded into every individual networking “box”.

Stanford Prof. Nick McKeown, one of the guys who invented SDN, and a serial entrepreneur in networking technology startups, now brings the next transformation: programmable switching chips. While in today’s networks special-purpose chips are used which are hard-wired to run specific protocols, the new switch chips can be programmed so that they could perform different functions such as firewall and load balancing, which currently require specialized networking equipment.

McKeown’s new startup Barefoot Network just completed its series C funding round with $57 million from Google (Alphabet) and Goldman Sachs. Google’s interest isn’t surprising as Google has been exploring next-generation networking for a while, and even earlier this year joined the Open Compute Project (in which Goldman Sachs is also a member).

The chips will be programmed by P4, a language for protocol-independent data packet forwarding. P4 is backed by a large open consortium of industry leaders, including tier-1 Telcos AT&T and Huawei, leading manufacturers such as Intel, Cisco and Juniper, and even software giant Microsoft. Reportedly the new chip can reach up to up to 6.5Tbps (terabits per second)—double the speed of the fastest comparable technology on the market, which is critical in making the new chips realistic for the high-performance standards of Telecom.

The vision of Software Defined Networking and that of programmable switching chips is basically one. As Barefoot puts it:

We envision a world where programmable networks outperform fixed-function networks. We believe that programming the network should be as easy to program as a server.

That’s a vision worth pursuing. And it may just about to come true.

You can read more on the latest announcement on this comprehensive coverage by the Wall Street Journal.

For a more technical deep-dive, download Barefoot’s whitepaper here.

1311765722_picons03 Follow Horovits on Twitter!

 

1 Comment

Filed under NFV, Programming Languages, SDN, Telecommunications

Microsoft Expands Open Source and Big Data Involvement, acquires Revolution Analytics

When you think about Microsoft, you probably think the very opposite of Open Source Software (OSS). Some would even go as far as picturing it as Dr. Evil of OSS. But recent moves show Microsoft begs the differ. This week Microsoft announced acquisition of Revolution Analytics, the company behind the open source R programming language that has become popular for statistical analysis on big data. As Joseph Sirosh, Corporate Vice President, Machine Learning as Microsoft writes in his blog post:

We are making this acquisition to help more companies use the power of R and data science to unlock big data insights with advanced analytics

Microsoft’s acquisition comes after showing interest in the language, both using it internally by Microsoft’s data scientists and frameworks, and actively contributing to open source R projects such as ParallelR, and RHadoop.

This joins other contributions by Microsoft to open source, such as Linux kernel contributions (yes, Microsoft, the father of Windows, contributing to Linux). Microsoft also released some of its core assets as open source, such as the .NET Core programming language and the REEF big-data analytics framework for YARN, and other open-source projects.

MS-buys-RevolutionR

Microsoft’s recent moves also shows its recognition that Big Data Analytics is where the world is heading. Organizations accumulated data, and are now looking for ways to monetize on that data and leverage the most advanced technologies and languages for that. Microsoft got a painful reality check a couple of months ago, when Facebook decided to dump Microsoft’s Bing and develop its own revamped big data search framework. Facebook, Twitter, Google and the likes have long realized the potential of their big data and have been developing advanced big data analytics technology to address that.

Microsoft opened 2015 with an impressive acquisition, marking important realization around open source software and big data analytics. Such statement hints for more to come down the year.

—————————————————————-
Update: Microsoft released its big data Azure Stream Analytics cloud service. check out the details in this post.

1311765722_picons03 Follow Dotan on Twitter!

3 Comments

Filed under Big Data, Programming Languages

Scaling All The Way: Welcoming Scala as a First-Level Citizen in GigaSpaces XAP

Scala is a hot topic in the programming world. I’ve been following Scala for quite a while, and about 2 years ago I endeavored programming in Scala on top of GigaSpaces XAP (disclaimer: I’m solution architect for GigaSpaces). XAP had no built-in support for Scala, but I leveraged XAP’s native support for Java together with Scala’s compatibility with Java.

And it worked like a charm!

You can read the full details in my previous blog post. I concluded my blog post by saying that

… programming in Scala on top of XAP is a viable notion that deserves further investigation.

However, I also added a disclaimer that

… XAP platform offers a vast array of features, and that the Scala language offers a vast array of constructs, very few of which have been covered on this experiment. Similarly, I should also state that Scala is not officially supported by the XAP product, which means that there is no official support or test coverage of Scala in the product.

Further explorations of more advanced Scala usage, also together with concrete customer use cases, showed that although possible, the resulting code is less intuitive for Scala users, and does not fully utilize the elegant constucts of the Scala language.

Two years went by, and now we decided to take our relationship with Scala to the next level, and make Scala programming on XAP much more intuitive with things such as better support for immutable objects, functional querying using predicates, Scala script execution and enhanced REPL shell. XAP now also exposes some of the platform’s powerful mechanisms for distributed and scalable processing, such as remote script execution and Map/Reduce pattern, over native Scala. These goodies have just been unveiled as part of the latest release of XAP (XAP 9.6). Let’s give you a taste of some of the goodies.

Predicate-based queries

You can now run queries based on Scala predicates just as you’re used to for functional querying:

val pGigaSpace = gigaSpace.predicate
val person = pGigaSpace.read { person: Person =>
person.age > 25 || person.name == personName }

This will be compiled into the XAP native SQL query mechanism, so no runtime overhead and you get all the optimizations available on the platform’s SQL query engine and indexing.

Scatter/Gather and Map/Reduce patterns

XAP contains a mechanism called Task Execution which provides easy implementation of the Scatter/Gather and Map/Reduce patterns.

Scatter:

DistributedTaskExecution_phase1

Gather:

DistributedTaskExecution_phase2

You can now define both the Scatter and the Gather as Scala functions and dispatch onto a cluster of nodes with a simple invocation:

val asyncFuture2 = gigaSpace.execute(
{ gigaSpace: GigaSpace => gigaSpace.read(Data()).data },
{ results: Seq[AsyncResult[String]] => results.map { _.getResult() } mkString } )

Remote and parallel execution of Scala scripts over a cluster

What if you want to execute your Scala script across a cluster of compute nodes (a-la compute grid)? Maybe even colocated with the data found on these nodes (a-la in-memory data grid)? This is now easily achievable using XAP’s Dynamic Language Tasks (which also supports other dynamic language scripts such as JavaScript and Groovy):

val script = new ScalaTypedStaticScript("myScript", "scala", code)
  .parameter("someNumber", 1)
  .parameter("someString", "str")
  .parameter("someSet", Set(1,2,3), classOf[Set[_]]) 
val result = executor.execute(script)

Final words

XAP is a multi-language and multi-interface platform. You can write in Java, .NET, C++;you can use standards such as SQL, JPA and Spring; you can use it as a key-value store; you may even choose to store your data in document format instead of objects, to support semi-structured model. So enhancing XAP to support Scala was but a natural move.

XAP-multi-API

In my blog post two years ago I concluded saying that

… [Scala] is an exciting option worth exploring, and who knows, if Scala becomes predominant it may one day become an official feature of the product.

Finally the day has come and Scala made its first steps in becoming a first-level citizen in GigaSpaces XAP. What I described above is just part of it. You can read the full listing here.  There are yet many more things to do in order to fully expose XAP platform’s rich functionality through Scala functional language, such as full support for immutable types. Now it’s time for the user community to check it out. So go ahead and play with it and let us know what you think you need to make your application scale all the way with XAP and Scala.

Leave a comment

Filed under Programming Languages

Scaling All the Way: Running Scala Applications on GigaSpaces XAP Platform

Scala, the “scalable language”, is the hottest thing in the programming languages world these days. You may have thought that innovation these days only happens in dynamic scripting languages. Or you may have thought that Java and .Net cover all angles for static languages. Or that object-oriented programming is the answer to every large-scale system. So here comes Scala and shuffles the cards. It offers a fascinating fusion of object-oriented and functional paradigms, an elegant and compact syntax, full compatibility with Java and .Net, and most notably – it is easily extensible for defining Domain-Specific Languages (DSL). Several major players already recognized the potential of the language and switched to Scala, including Twitter, Foursquare, and Sony Pictures. A fascinating example of the power of the language is the adoption of the Actor Model for high-level concurrency inspired by the Erlang language.

On one of my recent consulting sessions with a customer in the Financial Services industry in the UK, the customer expressed a desire to develop in Scala on top of the GigaSpaces XAP platform. XAP officially does not support the Scala language, so the customer consulted me on how to construct such a solution on top of the product. Well, I’m a solutions architect, so that’s just the kind of challenges I live for…

My first thought was that as Scala declares full compatibility with Java and complies with Java classes (with very few exceptions), and as any Java program can run on XAP, there should be a way to make it work. However, the customer reported that initial experiments had failed. While visiting the customer onsite, I investigated the problems together with the customer, and came up with some interesting conclusions about inter-operability with Scala that I’d like to share in this post.

The customer had domain model objects written in Scala that he wished to write into the Space. The Space is GigaSpaces implementation of an In-Memory Data Grid. Interestingly, the space functions as a general-purpose data store and exposes an Open Interfacing Layer that enables access to the data using various languages (Java, .Net, C++, scripting) and standard APIs (JPA, JDBC, REST, Map, Document, Memcached, Spring, and more). So having Scala as yet another API for interacting with data in the space would be a natural extension, wouldn’t it?

In order to store instances of a given Java domain class (POJO) in the Space, the class needs to be decorated with metadata to determine things such as which of its properties would serve as the primary key, which properties need to be indexed for efficient querying, etc. GigaSpaces offers two standard methods to specify this metadata: using Java annotations in the class source definition, or using XML alongside the class definition. I wanted to check if any of these methods can serve to similarly decorate Scala classes in preparation for storage in the Space. Experimenting with the customer’s use case, I was able to make the domain model of the customer work with both methods, namely the Scala objects were properly written into the data grid and replicated across the data grid after being annotated using the standard GigaSpaces Java annotations, or using the standard GigaSpaces XML.

That indeed solved the needs of the customer. But I myself only got more of an appetite: What else can be done with Scala on top of XAP? GigaSpaces XAP offers more than just an in-memory data grid, it also offers services on top of the data grid, such as remote invocation using the space as the transport layer, event-driven containers, executing distributed tasks in a Map/Reduce pattern, and more. Would these also work so neatly with Scala in virtue of Scala’s compatibility with Java? So I worked with my colleague Dan Kilman to port the GigaSpaces “Hello World” application to Scala. This application is the beginner’s example application (packaged with the XAP distribution), and it utilizes the basic features of the platform. Porting turned out to be straight-forward, and worked smoothly. The example is published as an open-source project at OpenSpaces.org.

This little experiment showed that programming in Scala on top of XAP is a viable option that deserves further investigation. I should add a proper disclaimer that the XAP platform offers a vast array of features, and that the Scala language offers a vast array of constructs, very few of which have been covered in this experiment. Similarly, I should also state that Scala is not officially supported by the XAP product, which means that there is no official support or test coverage of Scala for the product. However, as a solutions architect exploring possible solutions on top of the product I can now say that this is an exciting option worth exploring, and who knows, if Scala becomes predominant it may one day become an official feature of the product.

1311765722_picons03
Follow Dotan on Twitter!

5 Comments

Filed under Programming Languages