I'm building an app that requires an adapter/bridge that resides on a server and interfaces with the database. The adapter allows limited database access to third-party servers. I'm trying to determine the best method to implement this adapter.
I could build a traditional daemon process using C. I'd prefer to avoid this, since working with databases in C isn't my favorite activity. I'm also decidedly mediocre with C and haven't done anything serious with it in ages.
I could build a daemon using a scripting language like Python. I'd feel more comfortable doing this, but I've never daemonized a script before. The code would also have to include network code to be accessible by third-party servers. Is this a good or bad idea? Or nothing unusual?
Lastly, I could build equivalent scripts, but serve them through a web-server. The advantage is that I can defer networking to Apache/nginx/whatever. The downside is that the implementation becomes reliant on an existing web-server, and can't be installed on a system that doesn't have one running.
Thoughts? Am I just over-thinking this?
First rule: Do never bother writing your own socket server, there are so many reasons to not build your own server, but just consider that they already exist and are better than what you could build.
That said, it's all about the type of service: For verifone machines server I use a custom protocol which I regret I had to construct every single day. I had to build it because it was a long time ago and connections speeds were too slow for https.
SOAP is a reasonable option if you have text+binary data. Also if clients already use SOAP. I dislike XML deeply, but if you have have complex objects you can combine your web service with XSD schemas and make it great.
Now, the best option: just use dead simple HTTP transporting JSON, it may be REST or not. But anyways, this is the best option you have. It's reliable, tested and fast. I don't know python, but there must be something lighter than django around. Use that with nginx or apache as http server.
Java is pretty cool to build this kind of software. Check out Apache Mina, you can create a rock solid, production ready server in minutes if you decide to roll your own protocol.