You are already thinking in the right direction if you understand how Hadoop works. But don't bother for now. No, really, don't!
Just be ready to profile and refactor your code when you do need to scale.
That said, you can improve the odds with practices that are almost cost-free, but will help a lot later on.
- Read Cal Henderson's book.
- The center of your design should be the data store, not a process. You transition the data store from state to state, securely and reliably, in small increments.
- Avoid globals and session state. The more "pure" your function is, the easier it will be to cache or partition.
- Don't make your data store too smart. Calculations and renderings should happen in a separate, asynchronous process.
- The data store should be able to handle lots of concurrent connections. Minimize locking. (Read about optimistic locking).
- Protect your algorithm from the implementation of the data store, with a helper class or module or whatever. But don't (DO NOT) try to build a framework for any conceivable query. Just the ones your algorithm needs.
Think this is obvious? Just the other day I heard of a project, staffed by so-called experts, that made every one of the mistakes I mentioned above. And in simulations, they cannot even keep up with the load they expect at launch.