18. Microservices
Small
Independent
Each is elastic, resilient, composable, minimal and complete
Easy to replace
Organized around capabilities
May be different from each other
Naturally enforces modular structure
מי משתמש בזה?
Amazon - notably AWS API Gateway and Lambda
Apprenda[24]
1060 Research Ltd. has deployed architectures on its platform that contain on average between 3-5,000 individual services since 2003.
Bluemix
Cloud Foundry[17]
Google
The Guardian
HP Helion Development Platform
Interactive Intelligence
Jelastic
Microsoft Azure
Netflix[25] (Netflix receives nearly two-billion requests each day resulting in roughly 20 billion internal API calls.)
Nirmata[26]
בקיצור – סגנון לפיתוח אפליקציה כאוסף שירותים. כל שירות אחראי עד דבר יחיד,
בד"כ מדברים REST
כל שירות מרכז יכולת עסקית בודדת. כל שירות ניתן להפצה בנפרד. כל שירות בלתי תלוי בשירות אחר.
וזה נובע מהפילוסופיה של יוניקס- עשב דבר אחד, ועשה אותו טוב!
אבל למה צריכים אותם בכלל?
הכל בגלל המונולית!
איך היינו מפתחים עד כה?
לא משנה מה הבעיה – יש לנו את הפיתרון כמונולית
קח תצוגה
תוסיף מידע עסקי
תאחסן את הכל בDATABASE
במוקם אחד ריכוזי
אפשר לראות ארכיטקטורה?
בטח!
עם קליינט
שרת
בסיס נתונים
יחידה אחת
ואתם יודעים מה זו יחידה אחת?
כמשהו משתנה – מעדכנים את כל היחידה
כשמשנים במקום אחד = תלוב במונולית משתנה
קשה לאכוף אחידות
לעיתים נדרש תכנון עצום ופרטני
בקיצור
המושג מונולית תאר במקור מערכות מיינפריים ענקיות ללא מודולריות ברת שימוש. כך בעצם היה קל לייצר מערכות שקשה לתחזק.
The original use of the monolithic term described enormous main frame applications with no usable modularity, therefore resulting in un-maintainable systems and the "software crisis."
למה עוזר לי לפרק את המונולית?
אז מה ההבדלים בין הקקי הגדול לקטנים?
מודולריות
אנקפסולציה טבעית
מיקרושירותים חייבים להיות מופרדים
בעוד שבמונולית אפשר לייצר סיפריות
אין ריכוז סמכויות
הבדיקות יותר פרטניות
מיקרושירותים אינם תלןים אחד בשני ולכן אפשר לדפלה אותם בנפרד
מיקרושירותים אינם תלןים אחד בשני ולכן אפשר לדפלה אותם בנפרד
לא הבנתי – יש שקף מסכם?
כביקורת אומר:
המורכבות עברה לרשת,
רגישות לזמינות שירותים
בדיקות להפצה לעיתים דווקא מסובכים יותר
העברת סמכויות קשה יותר
We remain convinced that microservices can offer significant advantages to organizations, in terms of improving team autonomy and faster frequency of change. The additional complexity that comes from distributed systems requires an additional level of maturity and investment. We are concerned that some teams are rushing in to adopting microservices without understanding the changes to development, test, and operations that are required to do them well. Our general advice remains simple. Avoidmicroservice envy and start with one or two services before rushing headlong into developing more, to allow your teams time to adjust and understand the right level of granularity.