4

I am going to develop a Saas ( Software as a Service ) based application , which uses a python app which will run on the server and a client GUI which will be running as a jython app. Initially my plan is that the client will be developed in Jython for prototyping purposes, but later if the application complexity increases and depending on jython's performance deterioration , I will port the client entirely to JAVA.

Now, I wanted to explore a way so that I can have a effective TCP/IP communication between the server and client apps using some well known tools like Twisted. I was also thinking of other options like corba and pyro.

So based on this I have this questions.

What would be the most effective way of TCP/IP socket communication between a python and jython client. Can I use twisted at the python end and java socket api at the jython end (are they compatible) ? Or is there any other better way ( for prototyping & RAD purpose ) ?

3
  • is this always client-controlled, or will you sometimes need to "push" data from the server? how many clients are likely to run concurrently? how much data will be transferred? how critical is communication responsiveness to client responsiveness (will the client be pausing to send/receive in the middle of interactive use)? will there be many or few messages? what kind of security do you need? will you need to support other clients or other protocols (eg http rest to server)? is it critical that no information be lost between client and server (eg financial data)? lan or internet? Commented Aug 22, 2011 at 4:24
  • @andrew - it will be both push and pull ways for data access. clients can be many (hundreds and even thousands in case of commercial deployment ) , but I can choose to have a separate instance of server app for each client.Amount of data transfer will not be beyond few hundred KBs but it will happen every few hours (push from server) . Commented Aug 22, 2011 at 4:54
  • @andrew - client responsiveness is crucial bcoz it will (in some cases ) have to send n receive information (pull) in between interactivity.Messages will be few initially but as the application grows this will also grow. For security , initially for prototyping , I can use non secure way but later for commercializing I will have to go for some thing like ssl. Loss of data is not really critical bcoz it can be retrieved again from server app. The serer and client comm. will be over internet. Commented Aug 22, 2011 at 4:54

2 Answers 2

2

I recommend to use RPC, instead of pure TCP/IP communication via sockets.

If there's few clients, and you don't want to engage with complicated technologies, use something like JsonRPC or XMLRPC. (Note that Pyro can only be used when both server and client written in Python. If you plan to move to Java later, you should consider this.)

If performance and security is important here (e.g. lot of clients sends requests at the same time, or you need SSL connection) use something like Ice. I prefer Ice over Corba, because it's more simple, more modern, and yet as good as Corba (Maybe even better).

Update: After I read your comments, I really recommend you to use Ice. Ice and Corba and technologies like them calls ORB (Object Request Broker) They're not use traditional server/client model. So, all of the objects in the application can communicates with each others. No matter where they are. In this case, you'll have a real distributed application.

Sign up to request clarification or add additional context in comments.

2 Comments

thanks for the advice on Ice. I will explore it but I am wondering will it make the system too heavy ?. I see the installer is nearly 160 MB in size. Is there any lightwieght ORB which works well between python & java ?
@Shyam: You're welcome :) Ice comes with a lot of services, which you may don't need. It also contains language mapping, and libraries for Java, CSharp, Ruby, ... which you may not use. So, you can only pick some light libraries you really need. For example, Ice main libraries and Python modules. For big systems, Ice is really a good choice. We use it for more than 2 years on a banking system, with thousands of clients.
0

You could use twisted, nothing wrong with that, I'd recommend zeromq though. It's really fast, and makes writing networked apps really simple.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.