ããã€ãã
ãªãâç§â thisâ â âå¿é ããå¿ èŠãããâ
ããŒã¿ã¯ããªããžã§ã¯ãããªã¹ããé åãªã©ã®ããŒã¿æ§é ã®åœ¢åŒã§ã¡ã¢ãªã«æ ŒçŽãããŸãããã ãããããã¯ãŒã¯ãŸãã¯ãã¡ã€ã«ã«ããŒã¿ãéä¿¡ããå Žåã¯ãããããbaytovã®ã·ãŒã±ã³ã¹ãšããŠãšã³ã³ãŒãããå¿ èŠããããŸãããã€ãã·ãŒã±ã³ã¹ã§ã®ã¡ã¢ãªå ã®è¡šçŸã¯ãšã³ã³ãŒãã£ã³ã°ãšåŒã°ããéå€æ-dekodirovaniemãæçµçã«ã¢ããªã±ãŒã·ã§ã³ã«ãã£ãŠåŠçãããããŸãã¯ã¡ã¢ãªã«æ ŒçŽãããããŒã¿ãã€ã¢ã°ã©ã ãé²åããæ°ãããã£ãŒã«ããstaryeã«è¿œå ãŸãã¯åé€ãããå ŽåããããŸãã âUsedâ â encodingâ âmustâ âhaveâ âasâ reverseâ âïŒnewâ âcodeâ âmustâ âbeâ âcapableâ readâ âdata â writeâ old âcodeïŒãâso âandâ âdirectâ âïŒå€ãâ âcodeâ âmustâ âbeâ âcapable âreadâ âdata ââwroteâânewââcodeïŒâ âcompatibility.â â
ã§
ããã®èšäºã§ã¯ãæã ã¯ãã€ããªç¬Šå·åæ¹æ³ã¯ãã¹ããŒã ãå€æŽãµããŒããšããŠã³ãŒãã£ã³ã°ãã€ããªãããè¯ãJSONãXMLãããããšçç±ãèŠã€ããã³ãŒãããæ§ã ãªãã©ãŒãããã«ã€ããŠèª¬æããŸã
dannyhãã
ã¿ã€ãâãã©ãŒãããã³ãŒãã£ã³ã°â
ãšã³ã³ãŒã圢åŒã«ã¯2ã€ã®ã¿ã€ãããã
- ããã¹ãâ âãã©ãŒãããâ
- ãã€ããªâ âãã©ãŒãããâ
ããã¹ãâ âãã©ãŒããã
ããã¹ã圢åŒã¯ããçšåºŠchelovekochitaemyãäžè¬çãªåœ¢åŒã®äŸã¯ãJSONãCSVãXMLã§ããããã¹ã圢åŒã¯äœ¿ããããç解ããããã§ãããããã€ãã®åé¡ããããŸãã
- . , XML CSV . JSON , , . . , , 2^53 Twitter, 64- . JSON, API Twitter, ID â JSON- â - , JavaScript- .
- CSV , .
- ããã¹ã圢åŒã¯ããã€ããªãšã³ã³ãŒãã£ã³ã°ãããå€ãã®ã¹ããŒã¹ã䜿çšããŸããããšãã°ãçç±ã®1ã€ã¯ãJSONãšXMLãã¹ããŒãã¬ã¹ã§ããããããã£ãŒã«ãåãå«ããå¿ èŠãããããšã§ãã
{
"userName": "Martin",
"favoriteNumber": 1337,
"interests": ["daydreaming", "hacking"]
}
ãã®äŸã®JSONãšã³ã³ãŒãã£ã³ã°ã¯ããã¹ãŠã®ç©ºçœãåé€ãããåŸã82ãã€ãã䜿çšããŸãã
ãã€ããªãšã³ã³ãŒãã£ã³ã°
å éšã§ã®ã¿äœ¿çšãããããŒã¿åæã®å Žåãç¡é§ã®ãªã圢åŒãŸãã¯é«éãªåœ¢åŒãéžæã§ããŸããJSONã¯XMLããåé·ã§ã¯ãããŸãããããã€ããªåœ¢åŒãšæ¯èŒãããšãã©ã¡ããäŸç¶ãšããŠå€ãã®ã¹ããŒã¹ã䜿çšããŸãããã®èšäºã§ã¯ã3ã€ã®ç°ãªããã€ããªãšã³ã³ãŒãã£ã³ã°åœ¢åŒã«ã€ããŠèª¬æããŸãã
- ã¹ãªãã
- ãããã³ã«ãããã¡
- ã¢ãã
ãããã®ãã¹ãŠã¯ãã¹ããŒãã䜿çšããŠããŒã¿ã®å¹ççãªã·ãªã¢ã«åãæäŸããã³ãŒããçæããããã®ããŒã«ãšãããŸããŸãªããã°ã©ãã³ã°èšèªã§ã®äœæ¥ããµããŒãããŸãããããã¯ãã¹ãŠã¹ããŒãã®é²åããµããŒãããåŸæ¹äºææ§ãšåæ¹äºææ§ã®äž¡æ¹ãæäŸããŸãã
ã¹ãªããããã³ãããã³ã«ãããã¡ãŒ
Thriftã¯Facebookã«ãã£ãŠéçºãããProtocol Buffersã¯Googleã«ãã£ãŠéçºãããŸãããã©ã¡ãã®å ŽåããããŒã¿ããšã³ã³ãŒãããã«ã¯ã¹ããŒããå¿ èŠã§ããThriftã¯ç¬èªã®ã€ã³ã¿ãŒãã§ãŒã¹å®çŸ©èšèªïŒIDLïŒã䜿çšããŠã¹ããŒããå®çŸ©ããŸãã
struct Person {
1: string userName,
2: optional i64 favouriteNumber,
3: list<string> interests
}
ãããã³ã«ãããã¡ãŒã®åçã®ã¹ããŒã ïŒ
message Person {
required string user_name = 1;
optional int64 favourite_number = 2;
repeated string interests = 3;
}
ã芧ã®ãšãããåãã£ãŒã«ãã«ã¯ããŒã¿åãšã¿ã°çªå·ïŒ1ã2ã3ïŒããããŸãã Thriftã«ã¯ãBinaryProtocolãšCompactProtocolã®2ã€ã®ç°ãªããã€ããªãšã³ã³ãŒãã£ã³ã°åœ¢åŒããããŸãããã€ããªåœ¢åŒã¯ä»¥äžã«ç€ºãããã«åçŽã§ãäžèšã®ããŒã¿ããšã³ã³ãŒãããããã«59ãã€ãããããŸãã
Thriftãã€ããªãããã³ã«ã䜿çšãããšã³ã³ãŒã
ã³ã³ãã¯ããªãããã³ã«ã¯ãæå³çã«ã¯ãã€ããªãšåçã§ãããåãæ å ±ã34ãã€ãã ãã«ããã¯ããŸããç¯çŽã¯ããã£ãŒã«ãã¿ã€ããšã¿ã°çªå·ã1ãã€ãã«ããã¯ããããšã§éæãããŸãã
Thrift Compact
Protocol Buffers ã䜿çšãããšã³ã³ãŒãã¯ãThriftã®Compact Protocolãšåæ§ã«ããŒã¿ããšã³ã³ãŒãããŸãããšã³ã³ãŒãåŸãåãããŒã¿ã¯33ãã€ãã«ãªããŸãã
ãããã³ã«ãããã¡ã䜿çšãããšã³ã³ãŒã
ã¿ã°çªå·ã¯ãThriftããã³Protocol Buffersã®ã¹ããŒãã®é²åããµããŒãããŸããå€ãã³ãŒããæ°ããã¹ããŒãã§æžã蟌ãŸããããŒã¿ãèªã¿åãããšããå Žåãæ°ããã¿ã°çªå·ã®ãã£ãŒã«ãã¯ç¡èŠãããŸããåæ§ã«ãæ°ããã³ãŒãã¯ãæ¬ èœããŠããã¿ã°çªå·ã®å€ãnullãšããŠããŒã¯ããããšã«ãããå€ãã¹ããŒã ã§æžã蟌ãŸããããŒã¿ãèªã¿åãããšãã§ããŸãã
ã¢ãã
Avroã¯Protocol Buffersããã³Thriftãšã¯ç°ãªããŸããAvroãã¹ããŒãã䜿çšããŠããŒã¿ãå®çŸ©ããŸããã¹ããŒãã¯ãAvro IDLïŒäººéãèªãã圢åŒïŒã䜿çšããŠå®çŸ©ã§ããŸãã
record Person {
string userName;
union { null, long } favouriteNumber;
array<string> interests;
}
ãŸãã¯JSONïŒããæ©æ¢°å¯èªãªåœ¢åŒïŒïŒ
"type": "record",
"name": "Person",
"fields": [
{"name": "userName", "type": "string"},
{"name": "favouriteNumber", "type": ["null", "long"]},
{"name": "interests", "type": {"type": "array", "items": "string"}}
]
}
ãã£ãŒã«ãã«ã¯ã©ãã«çªå·ããªãããšã«æ³šæããŠãã ããã Avroã§ãšã³ã³ãŒããããåãããŒã¿ã¯32ãã€ãããããããŸããã
Avroã§ã®ã³ãŒãã£ã³ã°ã
äžèšã®ãã€ãã·ãŒã±ã³ã¹ãããããããã«ããã£ãŒã«ãã¯èå¥ã§ããŸããïŒThriftããã³ãããã³ã«ãããã¡ãŒã§ã¯ãçªå·ä»ãã®ã©ãã«ãããã«äœ¿çšãããŸãïŒããŸãããã£ãŒã«ãã®ããŒã¿åãå€å¥ããããšãäžå¯èœã§ããå€ã¯åçŽã«ãŸãšããããŸããããã¯ããã³ãŒãäžã«åè·¯ãå€æŽãããšã誀ã£ãããŒã¿ãçæãããããšãæå³ããŸããïŒ Avroã®éèŠãªã¢ã€ãã¢ã¯ãæžã蟌ã¿ãšèªã¿åãã®ã¹ããŒãã¯åãã§ããå¿ èŠã¯ãªãããäºææ§ããªããã°ãªããªããšããããšã§ããããŒã¿ããã³ãŒãããããšãAvroã©ã€ãã©ãªã¯äž¡æ¹ã®åè·¯ã調ã¹ãããŒã¿ãã¬ã³ãŒããŒåè·¯ãããªãŒããŒåè·¯ã«å€æããããšã§ãã®åé¡ã解決ããŸãã
ãªãŒããŒåè·¯ãšã©ã€ã¿ãŒåè·¯ã®éãããªãã
ããããããªãŒããŒãã©ã€ã¿ãŒåè·¯ã«ã€ããŠã©ã®ããã«åŠã¶ãã«ã€ããŠèããŠããã§ããããããã¯ãã¹ãŠããšã³ã³ãŒãã£ã³ã°ã®äœ¿çšã·ããªãªã«é¢ãããã®ã§ãã
- 倧ããªãã¡ã€ã«ãããŒã¿ã転éããå Žåãã¬ã³ãŒããŒã¯ãã¡ã€ã«ã®æåã«åè·¯ã1åå«ããããšããããŸãã
- åå¥ã®ã¬ã³ãŒããæã€ããŒã¿ããŒã¹ã§ã¯ãåè¡ãç¬èªã®ã¹ããŒãã§æžã蟌ãããšãã§ããŸããæãç°¡åãªè§£æ±ºçã¯ãåãšã³ããªã®å é ã«ããŒãžã§ã³çªå·ãå«ããã¹ããŒãã®ãªã¹ããä¿æããããšã§ãã
- ãããã¯ãŒã¯ãä»ããŠã¬ã³ãŒããéä¿¡ããããã«ããªãŒããŒãšã©ã€ã¿ãŒã¯ãæ¥ç¶ã確ç«ããããšãã«ã¹ããŒãã«ã€ããŠåæã§ããŸãã
Avro圢åŒã䜿çšããäž»ãªå©ç¹ã®1ã€ã¯ãåçã«çæãããã¹ããŒãã®ãµããŒãã§ããçªå·ä»ãã¿ã°ã¯çæãããªããããããŒãžã§ã³ç®¡çã·ã¹ãã ã䜿çšããŠãããŸããŸãªã¹ããŒã ã§ãšã³ã³ãŒããããããŸããŸãªãšã³ããªãä¿åã§ããŸãã
çµè«
ãã®èšäºã§ã¯ãããã¹ããšãã€ããªã®ãšã³ã³ãŒã圢åŒãæ€èšããåãããŒã¿ãJSONãšã³ã³ãŒãã§82ãã€ããThriftãšãããã³ã«ãããã¡ãŒã§ãšã³ã³ãŒãããã33ãã€ããããã³Avroãšã³ã³ãŒãã䜿çšããŠ32ãã€ãã®ã¿ãå ããæ¹æ³ã«ã€ããŠèª¬æããŸããããã€ããªåœ¢åŒã¯ãããã¯ãšã³ããµãŒãã¹éã§ãããã¯ãŒã¯ãä»ããŠããŒã¿ã転éãããšãã«ãJSONã«æ¯ã¹ãŠããã€ãã®æ確ãªå©ç¹ãæäŸããŸãã
è³æº
ããŒã¿éçŽåã¢ããªã±ãŒã·ã§ã³ã®ãšã³ã³ãŒããšèšèšã®è©³çŽ°ã«ã€ããŠã¯ãMartin KleppmanèãããŒã¿éçŽåã¢ããªã±ãŒã·ã§ã³ã®èšèšããèªãããšã匷ããå§ãããŸãã
SkillFactoryã®ææãªã³ã©ã€ã³ã³ãŒã¹ãåè¬ããŠãã¹ãã«ãšçµŠäžã®æ³šç®ã®è·æ¥ããŒãããååŸããæ¹æ³ã®è©³çŽ°ãã芧ãã ããã
- æ©æ¢°åŠç¿ã³ãŒã¹ïŒ12é±éïŒ
- ããŒã¿ãµã€ãšã³ã¹ã®å°éè·ããŒããããã¬ãŒãã³ã°ããïŒ12ãæïŒ
- åå¿è ã¬ãã«ã®åæè·ïŒ9ãæïŒ
- Python for Web Developmentã³ãŒã¹ïŒ9ãæïŒ
ç¶ããèªã
- ããŒã¿ãµã€ãšã³ã¹2020ã®åå
- ããŒã¿ãµã€ãšã³ã¹ã¯æ»ãã§ããŸããé·çãããããžãã¹ãµã€ãšã³ã¹
- æãã¯ãŒã«ãªããŒã¿ãµã€ãšã³ãã£ã¹ãã¯çµ±èšã«æéãç¡é§ã«ããŸãã
- ãªã³ã©ã€ã³ã³ãŒã¹ãªãã§ããŒã¿ãµã€ãšã³ãã£ã¹ãã«ãªãæ¹æ³
- ã¢ã€ããŒãªãŒã°ã®450ã®ç¡æã³ãŒã¹
- Data Science : «data»
- Data Sciene : Decision Intelligence