4. Herokuâs HTTP API Design Guide Herokuã®APIãã¶ã¤ã³ããå¾ãç¥è¦ãã¾ã¨ãã APIè¨è¨ã®ã¬ã¤ãã©ã¤ã³ devcenter.heroku.com/categories/platform-api github.com/interagent/http-api-design Heroku Platform API
ã¯ã©ã¦ãä¸ã§ããã«ä½¿ããéçºç°å¢ãå®è¡ç°å¢ãæä¾ããPaaSï¼Platform as a Serviceï¼ã®ä»£è¡¨çãªãµã¼ãã¹ã®1ã¤Herokuããã¨ã³ã¿ã¼ãã©ã¤ãºã®éçºçµç¹åããµã¼ãã¹ãHeroku Enterpriseããçºè¡¨ãã¾ããã Heroku Enterpriseã¯ãå¾æ¥ã®Herokuãæä¾ãã¦ããRuby on RailsãJavaãNode.jsãPythonãPHPã®éçºç°å¢ã¨ã¹ã±ã¼ã©ãã«ãªå®è¡ç°å¢ãPostgreSQLããã¼ã¹ã«ãããã¼ã¿ãã¼ã¹ãµã¼ãã¹ãGitHubã¨ã®é£ä¿ãBuildpackã«ããç°å¢ã®ã«ã¹ã¿ãã¤ãºãè±å¯ãªã¢ããªã³ãªã©ã®ãã¹ã¦ã®ãµã¼ãã¹ã«å ãã¦ãã¨ã³ã¿ã¼ãã©ã¤ãºã§æ±ãããããçµç¹å ¨ä½ã®éçºè ãã¾ã¨ãã¦ç®¡çã§ããããã·ã¥ãã¼ããã¢ã¯ã»ã¹ã³ã³ããã¼ã«ãã¨ã³ã¿ã¼ãã©ã¤ãºåãã®ãµãã¼ãã®3ã¤ãæä¾ãããã¨èª¬æããã¦ãã¾ãã éçºè ä¸è¦§ã®ããã·ã¥ãã¼ã ããã·ã¥ã
CodeZineç·¨éé¨ã§ã¯ãç¾å ´ã§æ´»èºãããããããã¼ãã¹ã¿ã¼ã«ããããã®ã«ã³ãã¡ã¬ã³ã¹ãDevelopers Summitãããã¨ã³ã¸ãã¢ã®çããã¾ããã¼ã¹ãããããã®ã¤ãã³ããDevelopers Boostããªã©ããã¾ãã¾ãªã«ã³ãã¡ã¬ã³ã¹ãä¼ç»ã»éå¶ãã¦ãã¾ãã
Herokuãèªãå®è·µãã¦ããAPIãã¶ã¤ã³ã¬ã¤ããGithubã«å ¬éããï¼ âHTTP API Design Guideâ ãã®ã¬ã¤ãã¯äºç´°ãªãã¶ã¤ã³ä¸ã®è°è«ãé¿ãã¦ï¼ãã¸ãã¹ãã¸ãã¯ã«éä¸ãããã¨ç®çã¨ãã¦ããï¼Herokuç¹æãªãã®ã§ã¯ãªãï¼ä¸è¬ã«ãååé©ç¨ã§ããç¥è¦ã¨ãªã£ã¦ããï¼ æè¿ã¯ï¼ã¢ãã¤ã«åãã«APIãã¤ãããã¨ãå¤ãããï¼åå¼·ãããã¦æ訳ããï¼ãªãå 容ã¯ï¼HTTP+JSONã®APIã«ã¤ãã¦åºæ¬çãªç¥èããããã¨ãåæã¨ãªã£ã¦ããï¼ é©åãªã¹ãã¼ã¿ã¹ã³ã¼ããè¿ã ããããã®ã¬ã¹ãã³ã¹ã¯é©åãªHTTPã¹ãã¼ã¿ã¹ã³ã¼ãè¿ããã¨ï¼ä¾ãã°ï¼âæå"ã示ãã¹ãã¼ã¿ã¹ã³ã¼ãã¯ä»¥ä¸ã«å¾ãï¼ 200: GETãDELETEï¼PATCHãªã¯ã¨ã¹ããæåãï¼åæã«å¦çãå®äºããå ´å 201: POSTãªã¯ã¨ã¹ããæåãï¼åæã«å¦çãå®äºããå ´å 202: POSTãDELETEï¼PATCHãªã¯
Rubyã§ç°¡åãããã·ã¥ã¢ãããµã¼ãã¹ãå ¬éãã¦ã¿ããï¼Â  - 第3å - ãããå ¬éã ï¼ãHerokuãã¨ãRedis To Goããçµã¿åããã¦ãWebãµã¼ãã¹ãå ¬éãã¦ã¿ããï¼ ããã¾ã§Rubyè¨èªã®Frameworkã§ãããSinatraãã®ä½¿ãæ¹ãããSinatraãã¨ãªã¼ãã³ã½ã¼ã¹ã©ã¤ãã©ãªã§ãããRubygemsããçµã¿åããã¦ãWebAPIãOAuthèªè¨¼ã®å©ç¨æ¹æ³ã«ã¤ãã¦è§£èª¬ãã¦ãã¾ããã æçµåã¨ãªãä»åã¯ãããã¾ã§ã«ã話ãããSinatraããªã©ãå©ç¨ããªãããä»è©±é¡ã®PaaSåãµã¼ãã¼ãHerokuãã®ä½¿ãæ¹ããã¢ããªã±ã¼ã·ã§ã³ã®å ¬éã®ä»æ¹ã«ã¤ãã¦ã話ãã¾ãã ã¾ãä»åå©ç¨ãããHerokuãã¯ãç¡æããå©ç¨ã§ããã¯ã³ã³ãã³ãã§ã¢ããªã±ã¼ã·ã§ã³ã®å ¬éãã§ããã¯ã©ã¦ãåã®ã¬ã³ã¿ã«ãµã¼ãã¼ã§ããããç°¡åã«Webã¢ããªã±ã¼ã·ã§ã³ã®å¹ ãåºãã¦ãããã®ã§åèã«ãã¦ã¿ã¦ãã
whyILeftHeroku.rst ä½æ ç§ã¯ Heroku ããé¢ããããããã³æ°ãã AWS ã»ããã¢ããã®ã¡ã¢ åèè :Adrian Holovaty åæ:Why I left Heroku, and notes on my new AWS setup éææ¥ãç§ã¯ Heroku ãã Amazon Web Services(AWS) ãç´æ¥ä½¿ãããã« Soundslice ã移è¡ãã¾ãããç§ã¯ãã®å¤æ´ãã§ãã¦ã¨ã¦ããããã¨ã¦ãå¬ããã¦ãç§ãã©ããã£ããã¨ãããã¨ã¨ãããçãããåããããªç«å ´ã ã£ããä½æ ãããæ¤è¨ãã¹ããã¨ãããã¨ã«ã¤ãã¦åºãä¼ãããã¨æãã¾ãã ç§ã® Heroku ä½é¨ Soundslice ã¯ãµã¤ããç«ã¡ä¸ãã2012å¹´11æãããã£ã¨ Heroku ä¸ã«ããã¾ãããããã¤ãçç±ããã£ã¦ãç§ã¯ Heroku ã使ããã¨æ±ºãã¾ãã: ã·ã¹ãã 管çè ã§ããã®ã¯è¶£å³
ã追è¨ããã®ä»¶ã«é¢ãã¦ã¯ããã®å¾ãHerokuã¨Rap Geniusã¨ã®éã§ããåãããªããã¾ãããHerokuå´ã®èª¬æã«ã¤ãã¦ã¯ãä¸è¨ã®ç¶å ±ã§ç´¹ä»ãã¦ããã¾ãããã¡ããã確èªãã ããã http://www.atmarkit.co.jp/ait/articles/1302/19/news109.html Ruby on Railsã®PaaSãHerokuãã®èª²éã®ä»çµã¿ãããããæ°èã®ãããä¼æ¥ããHerokuã«ã ã¾ããããã¨è¨´ãã¦ãããHerokuã¯2æ15æ¥ã顧客ã«å¯¾ãã説æãä¸ååã ã£ããªã©ã®åé¡ãèªããæ¹åã«åªããã¨è¡¨æããã 2æ14æ¥ã«ãHerokuã®éãç§å¯ãã¨ããããã°ãæ²è¼ãã¦åé¡ãæèµ·ããã®ã¯ãæ¥æé·ä¸ã®æ°èä¼æ¥Rap Geniusãããã¾ã§Herokuã«æé¡2ä¸ãã«ãã®æéãæããªããããã®ãµã¼ãã¹ã«ã¯æºè¶³ãã¦ããã¨ããã ã¨ããã10æ¥ã»ã©åãJavaScript
ã¯ããã« ååã¯ãHerokuã§ãã¡ã¤ã«ã¢ãããã¼ããè¡ãæ¹æ³ããç´¹ä»ãã¾ãããgemãå©ç¨ãã¦Amazon S3ã«ãã¡ã¤ã«ãã¢ãããã¼ããããã¨ã§é常ã«ç°¡åã«ãã¡ã¤ã«ã¢ãããã¼ããå®ç¾ã§ãããã¨ãããã£ãã¨æãã¾ããä»åã¯ãååã®ãã¡ã¤ã«ã¢ãããã¼ãã¨åæ§ã«ãWebãµã¼ãã¹ãæä¾ããéã«ããå©ç¨ãããéåæã®å¦çã«ã¤ãã¦ç´¹ä»ãã¾ãã Delyed::Jobã¨Cron Railsã§ã®éåæå¦çã¯ãç»é²ããã¸ã§ããé次å¦çããæ¹å¼ã¨å®æçã«å¦çãå®è¡ããæ¹å¼ãããã¾ãã 1ã¤ç®ã®é次å¦çã¯ãæ¬æ¥ã¯ãªã¯ã¨ã¹ãæã«å¦çãã¹ãã¸ã§ããå®è¡ã«æéãããã£ã¦ãã¾ãããããªã¯ã¨ã¹ãã®å¦çã¨ã¯å¥ã®ããã»ã¹ã§å®è¡ãããã¨ãæãã¦ãã¾ããç»åãã¢ãããã¼ãããéã«ããªãµã¤ãºãå®æ½ããå¦çãéãããéåæã«ããã¨ããã®ãä¾ã§ãããããRailsã§å®ç¾ããããã«ã¯ãããã¤ãã®gemãç¨æããã¦ãã¾ããHeroku
ã¯ããã« ååã¾ã§ã§ãNode.jsã«ããç°¡åãªWebã¢ããªã±ã¼ã·ã§ã³ãä¸éãå®æãã¾ãããä»åã¯ãã®æ§ç¯ããã¢ããªã±ã¼ã·ã§ã³ããã¯ã©ã¦ããã¼ã¹ã®ã¢ããªã±ã¼ã·ã§ã³ãã¹ãã£ã³ã°ãµã¼ãã¹ã§ããHerokuä¸ã§ãåããã¦ã¿ããã¨æãã¾ããHerokuã¯Node.js以å¤ã«ãJava, Ruby, Pythonãªã©ã®ã¢ããªã±ã¼ã·ã§ã³ããããã¤ãããã¨ãã§ãã¾ãã Herokuã®ã»ããã¢ãã ã¾ããHerokuã®ãµã¤ãããããâ Sign upããã¿ã³ããã¢ã«ã¦ã³ããç»é²ãã¦ãã ããã å³1ãHerokuã®ãµã¤ã ããã«ãheroku toolbeltã¨ããHerokuç¨ã³ãã³ãã©ã¤ã³ãã¼ã«ãéçºããã³ãããã¤ã«ä½¿ãã¢ããªã±ã¼ã·ã§ã³ä¸å¼ãæä¾ããã¦ãã¾ãããã¡ããåã ã®ç°å¢ã«åããã¦ã¤ã³ã¹ãã¼ã«ãã¾ãã ã¤ã³ã¹ãã¼ã«ãçµãã£ãããã³ãã³ãã©ã¤ã³ããherokuã«å¯¾ããèªè¨¼å¦çãè¡ã£ã¦ããã¾ãããã $
ä»æ¥ã¯ã¿ã©ãã®æ¥ããããããã¯ãã¹ã©ã¤ãã¼ãç·ã®è©±ãæ´»çºã§ãã ãã¦ãã¦ãååã«ç¶ãã¦Redisã®è©±ã§ãã å±éºãªã»ã©éãã¨è¨ããã¦ãã¾ãããå®éã®å®åã¯ã©ããªã®ãæ°ã«ãªãã¨ããã§ãã 確ãã«ä»ã®åèè¨äºãè¦ãã¨ãããªãé«éãªããã§ãã redisãããã¯å±éºãªã»ã©ã®ã¹ãã¼ãï½ãµã¤ãã¼ã¨ã¼ã¸ã§ã³ã å ¬å¼ã¨ã³ã¸ãã¢ããã° FreeBSDã§ï¼mongoDB V.S. Redis - ãªããæ°å¦è ã«ã¯ã¯ã¤ã³å¥½ããå¤ã ããã¼ã£ã¦äºã§ãRedisã¨MongoDBããã³ããã¼ã¯æ¯è¼ãã¦ã¿ã¾ããã çµè«ããè¨ãã¨ãRedisã¯ãã£ã±ã鬼ã®ããã«éãã§ãã ãã³ãæ¹æ³ Redisã¨Mongoã«twitpicããåå¾ãã¦ãã ããã¯ãã®ç»åã«é¢ãããã¼ã¿ãå ¥ãã¦ããããããåãåºãå¦çãã©ã¡ããæ©ããã ããè¨æ¸¬ãã¦ãã¾ããæ´æ°ç³»ã®æä½ãé«éãªããã§ãããããã¯ãã¹ã©ã¤ãã¼ã¯ä»ã¯æ´æ°ç³»ã®æä½ããªãã®ã§ããã
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}