Should I use EJB3 or Spring for my business layer?

There won’t be much difference between EJB3 and Spring based on Performance. We chose Spring for the following reasons (not mentioned in the question): Spring drives the architecture in a direction that more readily supports unit testing. For example, inject a mock DAO object to unit test your business layer, or utilize Spring’s MockHttpRequest object … Read more

Algorithm for autocomplete?

For (heh) awesome fuzzy/partial string matching algorithms, check out Damn Cool Algorithms: http://blog.notdot.net/2007/4/Damn-Cool-Algorithms-Part-1-BK-Trees http://blog.notdot.net/2010/07/Damn-Cool-Algorithms-Levenshtein-Automata These don’t replace tries, but rather prevent brute-force lookups in tries – which is still a huge win. Next, you probably want a way to bound the size of the trie: keep a trie of recent/top N words used globally; for … Read more

Scaling Node.js

Load balancing Most probably for the most simple sites you don’t need any scaling at all. Just one single box will get you covered. After that you should do load balancing like you are mentioning which is almost the same for every architecture(like you are saying you could start multiple node processes first. But when … Read more

How/why do functional languages (specifically Erlang) scale well?

A functional language doesn’t (in general) rely on mutating a variable. Because of this, we don’t have to protect the “shared state” of a variable, because the value is fixed. This in turn avoids the majority of the hoop jumping that traditional languages have to go through to implement an algorithm across processors or machines. … Read more

Caveats of select/poll vs. epoll reactors in Twisted

For very small numbers of sockets (varies depending on your hardware, of course, but we’re talking about something on the order of 10 or fewer), select can beat epoll in memory usage and runtime speed. Of course, for such small numbers of sockets, both mechanisms are so fast that you don’t really care about this … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)