Well, the problem I see with this is that you're asking for help developing a server side solution with a client side language. Javascript is run in-browser along with the HTML and CSS, so any Javascript is inherently going to lend itself to a client side solution. Now, you may be able to write or find some plug-in that uses a server side scripting language to generate the dynamic map on the fly and then makes it accessible via a Javascript API or at least a javascript URL request, but a complete javascript solution it's likely to really meet what you need, there would have to be a server side component there.
Now, with that said, I see two options that come to mind that I know of. First, you could create different user interactions with the data depending on the zoom level they are at. You could aggregate the data, create a geoprocessing model/script that aggregates the data in some manner at various levels (there are tools to help with this in the Spatial Statistics Toolbox in ArcToolbox). Ex: for a world wide view you may only need one point (color/size coded to represent how "hot" that spot is) for each country, but as you zoom in past a particular zoom level it turns off the aggregated layer and turns on the feature service and does the standard client side rendering based on the points (but it would only have to use the points visible instead of all the points in the entire service because you're only zoomed in to a smaller area). And of course you could add more levels of aggregation in-between if you still had too many points (ex: all data aggregated by 500 miles for X zoom level, data aggregated by 100 miles for Y zoom level, and raw data shown at Z zoom level, or such as that). Just a thought though...
Honestly though, I'd look at Google Fusion Tables. So long as you are willing to upload your data and either manually or write the bit of code to automate the maintenance of the data within their Fusion Table framework, the heat map is relatively simple. The fusion table map component has a server side generated heat-map (at least last time I checked it was still server side, but you have to use that for server side not the fusion table layer access within the Google Map API because that is client side). Anyway, try Google Fusion tables out, I really think, it might help you out with your server side issue (so long as working within the Google licensing limitations doesn't bother you). You can get to it via a having a Google account and going to Google Drive and one of the create options should be a fusion table (so long as you're not using an organizational account that has all beta features turned off).