Hacker News new | past | comments | ask | show | jobs | submit login

You know any way I could access databases through a static page? I mean, I wanted to have an "open to read, but not write" database to feed contents to a static HTML through javascript, would be neat.



I covered it very briefly in the post, but could/should have gone into more detail. You can store all of your static HTML/CSS/JS on an S3 instance, then have a separate EC2 (or whatever) to do the database stuff.

Create it as an API that's reachable through JSONP or (better) CORS. It won't stop you having scaling issues, but it'll help to reduce the number of requests hammering your database. I've recently spent an unhealthy amount of time setting up Varnish to cache dynamic content, so a post on that topic will be coming down the pipeline soon.


Ajax requests are what you're after. Store your data in JSON or plain text files and use your favourite JavaScript framework to retrieve them client-side.


Keep a database on your computer, write a quick script that dumps it to json format, and uploads it S3 automatically, and have the javascript hit that file. Run the script every time you change the data.


Look into Firebase, https://www.firebase.com/ .They have a js api to work straight from the browser.


You should be able to use JSONP regardless of the data source to accomplish that.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: