Akka Actors In Scala Vs Akka Actors In Java:Event Sourcing

75 views
Skip to first unread message

Prakhyat Mallikarjun

unread,
Sep 12, 2014, 8:49:33 AM9/12/14
to akka...@googlegroups.com
Team,

We are building a reactive application and planning to us akka persistence. 

But we are stuck at a point where we have decide between java and scala. Below are very important questions for my analysis.

Is it better to create actor system or actors in scala or java? 

What are the difference's between actors created in java over actors created from scala?

Will dispatcher's behavior(remote,io,cluster,others dispatcher) vary in java and scala? 

Also do we see any difference in event sourcing(akka persistence) behavior when used with java or scala?

-Prakhyat M M

Konrad Malawski

unread,
Sep 13, 2014, 12:27:08 PM9/13/14
to Akka User List
Hi Prakhyat,
"It depends". 

We provide APIs for everything in both Java and Scala.


Is it better to create actor system or actors in scala or java? 
There is no "better" as it depends on your team, their skills and willingness to learn.
I do think it's worth to get over the initial learning curve of Scala to reap the benefits it provides (far less boilerplate, easier to abstract things away etc).

 
What are the difference's between actors created in java over actors created from scala?
Of the actors? None.
Akka is a library. You can tell to an Actor implemented in Java from an Actor implemented in Scala etc.

Scala's language features make implementing Actors far less verbose (Java8 is catching up, but still does not offer the exact same level of conciseness).

Will dispatcher's behavior(remote,io,cluster,others dispatcher) vary in java and scala? 
In runtime it's all bytecode anyway.
Akka is the same library - no matter from which language you use it - and we happen to implement most things using Scala.

Also do we see any difference in event sourcing(akka persistence) behavior when used with java or scala?
See previous answers.
 

Decide based on if you're up to learning Scala (I do think it's completely worth it).
But from Akka's perspective it doesn't change any semantics – we're a library, any JVM language should be able to use Akka (JRuby too ;-)).

--
Cheers,
Konrad 'ktoso' Malawski
hAkker @ Typesafe


Prakhyat

unread,
Sep 13, 2014, 1:08:48 PM9/13/14
to akka...@googlegroups.com, Akka User List
Konrad,

Thanks a lot again for your brief insights :)
We are in poc stage this will help us in deciding next steps.

There is always a confusion scala or java? You read tons of Articles, 
but will end up with mixed responses.

I personally like scala for the reasons you mentioned.

We want to work with eventsourcing, it is vey important for us to 
understand, whether java or scala actors, execution/performance/behaviour 
will not differ.

-prakhyat m m

Sent from my iPhone
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to a topic in the Google Groups "Akka User List" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/akka-user/1k3JedN0p7w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Konrad Malawski

unread,
Sep 13, 2014, 1:14:51 PM9/13/14
to Akka User List
Language choice should have marginal (collection conversions will happen for example) has marginal impact on performance here.

If you really care you should benchmark things :-)

Prakhyat

unread,
Sep 13, 2014, 1:28:36 PM9/13/14
to akka...@googlegroups.com, Akka User List
Konrad,

Thanks again. Will keep this in mind.

From benchmarking, did you mean, micro benchmarking using caliper or jmh?

Or benchmarking runtime performance of overall poc code? If yes, then same poc has to be implemented separately  in both scala and java, followed by performance tests on each implementation. That's the only way as I fathom.

-prakhyat m m

Sent from my iPhone
--

Konrad 'ktoso' Malawski

unread,
Sep 14, 2014, 10:09:33 AM9/14/14
to akka...@googlegroups.com, Prakhyat, Akka User List
In general there should be no difference, like I mentioned a few times already.
If you’re really really worried about any performance – you cannot just assume things and will have to measure, anything you “care enough” about.

— konrad
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.

To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.
-- 
Konrad 'ktoso' Malawski
hAkker @ typesafe

Prakhyat

unread,
Sep 14, 2014, 11:39:47 AM9/14/14
to Konrad 'ktoso' Malawski, akka...@googlegroups.com
Konrad,

Thanks again. I got your point. Was looking for your discrete insights that's all.

-prakhyat m m

Sent from my iPhone
Reply all
Reply to author
Forward
0 new messages