Ask HN: What should I build an iOS API in?
The system will be a CRUD back end for an iOS app, later offering a web app, then otehr clients, etc. I'm outsourcing it, so the choice of language/appserver will be up to the lucky (!) programmer.
Will be RESTful with JSON data exchange. Linux on EC2.
Other than that - what would you say would be the best route for:
- Low system overhead - Fast performance - Low resource usage - Scalability to multiple appservers (eventually)
Ruby on Rails? Pyton / Django? PHP on a framework?
Or doesn't it matter?
16 comments
[ 4.9 ms ] story [ 52.5 ms ] threadGoing to hit the backend every transaction as its very stateful so minimal caching can be possible.
Unknown on growth! Hope for the best, I want to take 1000 r/sec on an EC2 instance.
http://www.mongodb.org/display/DOCS/How+does+concurrency+wor...
Or does that only apply if "safe mode" is on, rather than fire-and-forget unverified writes?
If you _really_ think you need 1,000 writes, only a complete in-memory DB like Redis can offer that... My suggestion would be to go with a simple set-up and consider scaling issues when the need arises - they are always a good headache to have.
MySQL it is then. :)
As for safe-mode, the waiting that it does is always outside of the lock. It uses a cached datastructure that is protected by a secondary mutex so that it never has to interact with the global dbMutex. If you choose to wait for replication or journalling of your writes, that will block the connection and therefore your client thread so single-threaded tests will show much worse performance with the db mostly idle. If you use more client threads or asynchronous I/O connections you should see roughly identical throughput in aggregate (see mongostat) although much higher latencies compared with not waiting.
If you have any questions about this feel free to shoot me an email. Replace the _ with an @ and add a .com to my user name.
With this setup, you can easily throw more DB instances in the pool to grow with your needs. The frontend should be able to handle as many requests as needed (especially Node which has VERY lightweight threads, I hear). You'll just need to reduce the turnaround time via the queue.
Your real pain point is going to be your back end. If immediate consistency isn't important, run a job queue with works in the back end hitting some kind of fast access nosql and have a worker whose job it is to write to a mysql or postgress store. raid the ebs volumes and keep a monolithic volume sister box to take snapshots off. you can have the entire environment scripted and repeatable.