--
You received this message because you are subscribed to the Google Groups "fabric3" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fabric3+u...@googlegroups.com.
To post to this group, send email to fab...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fabric3/f8feb874-90a2-4ca6-ac45-a3ddc0eae3c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "fabric3" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fabric3+u...@googlegroups.com.
To post to this group, send email to fab...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fabric3/314116db-89a2-4674-9171-3570d1d4aec9%40googlegroups.com.
On Tue, Sep 15, 2015 at 10:39 AM, Tomas Fecko <tomas...@gmail.com> wrote:
Hi Jim,
You are right about the services, which you know for sure, that they will be remote and services where you know, you want them as performant as possible.
Using custom serialization is also a good point, I wanted to mention. We are using custom serialization which is something between Externalizable and Simple Binary Encoding.
It would be great, if there is a possibility to write directly and read directly from the stream (something like externalizable with fabric3 interface as parameter).
Creation of byte[] is just one step too many.
Back to the remote services. Usualy in projects I used fabric3, we know exactly which services should be remote and which should be performant.
We usualy used channels for remote fast data distribution and we used local services for services, we need fast access to. That's about 20% of services. 80% of them we don't realy care how fast they are, we just need them to work reliably.
But than we get to the phase, where more factors comes to the scene. e.g. in the project I'm working on right now. At the beginning the project was a prototype, with some basic security in mind.
Than when we tryed opening the project to the public, we wanted to finish the security layer to the point, we feel that it would suffice (you can't realy secure everything to 100%, you just want to make best effort for the money and time you have). At the project we are executing customer code in our system. We are executing jar-s, R code, python code, etc. and we wanted to simply relocate some of the services from the jvm of the code executor to different jvm in the same server instance (we are using ec2 and gce clouds interconnected with VPN). But there are instances we didn't wanted to separate JVMs, as they are running our own code. Creating a sandbox environment is a pain, and having that completely separated feeled more secure to us. So the services which touch databases (rds, kvs, ...) or anything that's not public, are not in the same JVM as the third-party-code we execute. We even wanted to have that in different docker containers, but we didn't get to that, maybe in the future.
Having the ability to relocate services is realy one of the main feature of fabric3, we are counting on. You can't realy plan all the services ahead, so you can't tell if they will be remote or local - as I wrote, some of them are pretty obvious, but some are not. Well at least not in agile project, where you can't realy see the whole picture at the beginning. In startup you usually start building a car and ending up with submarine, but that's how it should be, if customer at the end pay for a submarine. The possibily to simply change service from local to remote and vice versa is therefor realy usefull. We developed some best practices on building sca services, so we can use that feature to it's full potential. e.g. don't use whiteboard pattern, as it can't span local space, make sure every input/output parameters of services are serializable, ...
ZeroMQ binding is presented as the main remote sca-binding. To be honest, it's the first time we realy take it for a serious test drive. And I must say, it's far from being mature even with services with 1 input/output parameter and without exceptions, if there is a problem with it, wire starts behave unpredictable. I don't remember that before zeroMQ there were problems with remote bindings. I can't remember, but we used maybe jms? In that matter, I think the default setting for fabric3 should be for the environments without multicasts. Multicasts are hard to manage, and can cause a mess in infrastructure if not routed properly. They are rarely supported in cloud environments, and in private datacenters, it's many times considered as present and working, but it realy depends on admins, if they can handle them - and in many situations they cause more problems than gain...
I think we discussed that in the past, but there is a cluster layer, which interconnects all the nodes. Why not leverage that for remote bindings? I think fabric3 don't need to have profiles like zeromq or jms present, to be able to call remote services - standalone package should suffice, it sure have. I'm not speaking about jgroups, but you mentioned hazelcast...
what do you think?
Tomas
Dňa 08.09.2015 o 23:35 Jim Marino napísal(a):
Hi Tomas,
This touches on modeling local and remote services. For simplicity, I think they need to be modeled differently. Otherwise, an application will miss important cases (treating everything as local and ignoring network latency and failures) or become overly complex (treating everything as remote).
What I have found effective is to layer systems such that remote calls are grouped at the system boundaries, if possible. If performance is not paramount, JSON over a messaging layer or REST works nice. If performance is critical, then I usually handle de/serialization directly with byte[] since that is a typical bottleneck. It's a bit ugly but the byte[] passing is only done in a few places and the arrays are either converted directly into POJOs (e.g. protobufs) or fronted by a flyweight which points back to the original bytes (or off-heap buffer). That doesn't pollute the codebase since most of the services are passed complex Java types as opposed to bytes.
I wanted to focus in particular on something you said, which is that one of the best parts of SCA is the ability to collocate or remotely host services and have the runtime pick a binding using the "SCA binding".
It is really valuable to have multiple options for deployment topologies, e.g. for testing everything can be run locally and in production services can be distributed by simply changing a configuration setting. Is this what you see as the main value in the "SCA binding" - the ability to switch how things are deployed?
I have been thinking about this lately and I am beginning to believe the "SCA binding" where a remote transport is automatically selected (not SCA itself ;-) ) is not the best approach to solving this problem. What is leading me down this path is that nearly every time I have used automatic binding selection I also wanted to tune communication parameters. What I think I want is the ability to selectively apply bindings. For example, in testing use use local wires but in production use ZeroMQ configured in a certain way.
Is this what you are trying to do or am I missing your use case?
Jim