How we took our server side application to the cloud and liked what we got

978 views
857 views

Published on

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
978
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
7
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • Files are never changed!
  • Community successJFrog established in 2008JavaOne 2009Pro versionSoftware as a Service (SaaS version)Heavily used by OSS community
  • Community successJFrog established in 2008JavaOne 2009Pro versionSoftware as a Service (SaaS version)Heavily used by OSS community
  • Community successJFrog established in 2008JavaOne 2009Pro versionSoftware as a Service (SaaS version)Heavily used by OSS community
  • Community successJFrog established in 2008JavaOne 2009Pro versionSoftware as a Service (SaaS version)Heavily used by OSS community
  • Last slide by Baruch
  • Last slide by Baruch
  • 30 million requests/weekMostly in the Pacific Time Monday mornings4 TB of artifacts
  • Multi-tenancyPlatform selection PaaS or IaaSDB schema updates
  • Using standard Java WAR classloader isolationCreating standard WAR with dependencies in ‘lib’, classes in ‘classes’Creating per-user databaseDone!
  • Using standard Java WAR classloader isolationCreating standard WAR with dependencies in ‘lib’, classes in ‘classes’Creating per-user databaseDone!
  • Using standard Java WAR classloader isolationCreating standard WAR with dependencies in ‘lib’, classes in ‘classes’Creating per-user databaseDone!
  • PerfectMake sure the context is bounded to thread/war
  • Was goodNew versions added staticmap of applicationsLesson learned: Recheck on each version upgrade
  • Was goodNew versions added staticmap of applicationsLesson learned: Recheck on each version upgrade
  • Was goodNew versions added staticmap of applicationsLesson learned: Recheck on each version upgrade
  • They are not shared – good!Need global management to adjust the size to match all the tenantsWithout global thread pool
  • Logger fields are (almost) always staticCan’t fight it
  • We MITM-ed the LoggerFactoryKeeps Loggers per application instead of static
  • ExamplesTransaction IDTomcat ClassLoaderSolving race condition generates synchronous initialization
  • Heap-wide temp file cleaner thread A static thread destroying the temp files of the other tenantsNot as funny as it sounds
  • Heap-wide temp file cleaner thread A static thread destroying the temp files of the other tenantsNot as funny as it sounds
  • Lucene and other cache solutions are adjusted for the whole heap sizeUse SoftReference based caches
  • Custom Tomcat (our own jars in Tomcat’s lib)Custom Machine Image with our customized software and configuration
  • Infrastructure as a Service
  • Self Service PlatformRegistrationInstance generationDBBackupVirtual HostWARCustomer account management
  • 3 Versions3 Deployment formatsWARZIPRPMLots of dependencies
  • Рекурсивный слайд с мимимишным ребенком!!!
  • Рекурсивный слайд с мимимишным ребенком!!!
  • We eat our own dog foodArtifactory is built with Artifactory
  • Snapshots are built, tested & deployed on your build server of choiceWith Artifactory pluginArtifactory “snapshot promotion” to sandbox
  • Deploying to production using ChefOther options:PuppetBuild Server pluginsZT LiveRebelScripts
  • Continuously release to the cloudOnce in a while “freezing” it to downloadable version
  • Rapid feedbackHost server accessDevelopers must think bigStandalone updates well tested by SaaSStandalone application is kind of LTS version
  • Rapid feedbackHost server accessDevelopers must think bigStandalone updates well tested by SaaSStandalone application is kind of LTS version
  • How we took our server side application to the cloud and liked what we got

    1. 1. HOW WE TOOK OUR SERVER- SIDE JAVA APPLICATION TO THE CLOUDand liked what we got
    2. 2. WHO’S TALKING? linkd.in/jbaruch
    3. 3. Developer who? 3
    4. 4. Developer who? 4
    5. 5. WHAT FROG?
    6. 6. WHAT FROG?
    7. 7. WHAT FROG?
    8. 8. WHAT FROG?
    9. 9. WHAT FROG?
    10. 10. WHAT FROG?
    11. 11. One more thing! bDaHiD1bit.ly/ JUC Israel - July 16, 2014
    12. 12. SO…
    13. 13. First things First.
    14. 14. Poll time! I use binary repository:
    15. 15. Poll time! I use binary repository:  Naturally, Artifactory!
    16. 16. Poll time! I use binary repository:  Naturally, Artifactory!  Shame on me, but still Nexus…
    17. 17. Poll time! I use binary repository:  Naturally, Artifactory!  Shame on me, but still Nexus…  I don’t like features, I use Archiva
    18. 18. Poll time! I use binary repository:  Naturally, Artifactory!  Shame on me, but still Nexus…  I don’t like features, I use Archiva  I am a caveman, binary what?
    19. 19. In the beginning…
    20. 20. In the beginning…
    21. 21. Yet Another Java Server App
    22. 22. Rabbit?!
    23. 23. Checksum storage
    24. 24. Checksum storage
    25. 25. Checksum storage
    26. 26. Checksum storage
    27. 27. Append Only, GC-ed
    28. 28. Artifactory 3 – 10 times faster! (Not bastards)
    29. 29. Moving Forward
    30. 30. Moving Forward
    31. 31. Moving Forward
    32. 32. Moving Forward
    33. 33. Moving Forward
    34. 34. Artifactory SaaS etc.
    35. 35. What you like about it:
    36. 36. What you like about it: – No need to maintain the server
    37. 37. What you like about it: – No need to maintain the server – Fanatic tech support
    38. 38. What you like about it: – No need to maintain the server – Fanatic tech support – Always up to date!
    39. 39. What you like about it: – No need to maintain the server – Fanatic tech support – Always up to date! What you don’t like about it:
    40. 40. What you like about it: – No need to maintain the server – Fanatic tech support – Always up to date! What you don’t like about it: – Can’t deploy your own plugins!
    41. 41. What you like about it: – No need to maintain the server – Fanatic tech support – Always up to date! What you don’t like about it: – Can’t deploy your own plugins!
    42. 42. What you like about it: – No need to maintain the server – Fanatic tech support – Always up to date! What you don’t like about it: – Can’t deploy your own plugins!
    43. 43. Artifactory SaaS etc.
    44. 44. Sh.t-load of artifacts!
    45. 45. Terabytes. FEBRUARY
    46. 46. Terabytes. FEBRUARY MAY
    47. 47. Terabytes. FEBRUARY MAY AUGUST
    48. 48. Terabytes. AUGUST MAY JANUARY
    49. 49. Bring Them On!
    50. 50. To The Cloud
    51. 51. Bullshit Bingo
    52. 52. Much ado about *aaS
    53. 53. * As A Service
    54. 54. * As A Service Self-service
    55. 55. * As A Service Self-service Multi-tenancy
    56. 56. Controversial example ahead! You might find it inaccurate. If you are annoyed by that feeling, try to remember – it’s just an example.
    57. 57. GaaE: Google as an Example Product Self Service Multi- tenant * aaS
    58. 58. GaaE: Google as an Example Product Self Service Multi- tenant * aaS Gmail   Not *aaS, web-app
    59. 59. GaaE: Google as an Example Product Self Service Multi- tenant * aaS Gmail   Not *aaS, web-app Google Apps   SaaS
    60. 60. GaaE: Google as an Example Product Self Service Multi- tenant * aaS Gmail   Not *aaS, web-app Google Apps   SaaS Google App Engine   PaaS
    61. 61. GaaE: Google as an Example Product Self Service Multi- tenant * aaS Gmail   Not *aaS, web-app Google Apps   SaaS Google App Engine   PaaS Google Compute Engine   IaaS
    62. 62. AaaE: Amazon as an Example Product Self Service Multi- tenant * aaS
    63. 63. AaaE: Amazon as an Example Product Self Service Multi- tenant * aaS Amazon store   Not *aaS, web-app
    64. 64. AaaE: Amazon as an Example Product Self Service Multi- tenant * aaS Amazon store   Not *aaS, web-app aStore   SaaS
    65. 65. AaaE: Amazon as an Example Product Self Service Multi- tenant * aaS Amazon store   Not *aaS, web-app aStore   SaaS Amazon Elastic Beantalk   PaaS
    66. 66. AaaE: Amazon as an Example Product Self Service Multi- tenant * aaS Amazon store   Not *aaS, web-app aStore   SaaS Amazon Elastic Beantalk   PaaS Amazon Elastic Cloud   IaaS
    67. 67. SaaS pains
    68. 68. Multi-tenancy
    69. 69. Looks good! When to expect?
    70. 70. Extrapolate This
    71. 71. Given: Release Java 7 07/2011 Release Java 8 12/2012
    72. 72. Given: Release Java 7 07/2011 Release Java 8 12/2012 Find: Release Java 9?
    73. 73. Java 8: 12/2012
    74. 74. Java 8: 12/2012 - Java 7: 07/2011
    75. 75. Java 8: 12/2012 - Java 7: 07/2011 = 15 Months cycle
    76. 76. Java 8: 12/2012 - Java 7: 07/2011 = 15 Months cycle conclusion: Java 9: 05/2013
    77. 77. Java 8: 12/2012 - Java 7: 07/2011 = 15 Months cycle conclusion: Java 9: 05/2013 It’s almost a year ago! Oh, wait… Java 8 is not out yet!
    78. 78. Observation: When Mark writes about trains it means release delay
    79. 79. Here you go:
    80. 80. Java 7: 07/2011
    81. 81. Java 7: 07/2011 + 24 Months =
    82. 82. Java 7: 07/2011 + 24 Months = Java 8: 07/2013
    83. 83. You wish!
    84. 84. Java 7: 07/2011 + 24 Months = Java 8: 07/2013
    85. 85. Java 7: 07/2011 + 24 Months = Java 8: 01/2014 Whatever mark says
    86. 86. Java 7: 07/2011 + 24 Months = Java 8: 01/2014 + 24 Months = Java 9: 01/2016 Whatever mark says
    87. 87. You think this is it?
    88. 88. Java 7: 07/2011 + 24 Months = Java 8: 03/2014 Whatever mark says
    89. 89. Java 7: 07/2011 + 24 Months = Java 8: 03/2014 + 24 Months = Whatever mark says
    90. 90. Java 7: 07/2011 + 24 Months = Java 8: 03/2014 + 24 Months = Java 9: 03/2016 Whatever mark says
    91. 91. Java 7: 07/2011 + 24 Months = Java 8: 03/2014 + 24 Months = Java 9: 03/2016 (if no more train blog posts) Whatever mark says
    92. 92. Java 7: 07/2011 + 24 месяца = Java 8: 03/2014 + 24 месяца = Java 9: 03/2016 (Если не будет больше постов про поезд) Сколько Марк скажет
    93. 93. Multi-tenancy types Multi-tenancy Type
    94. 94. Multi-tenancy types Multi-tenancy Type Data Separation
    95. 95. Multi-tenancy types Multi-tenancy Type Data Separation Application Separation
    96. 96. Multi-tenancy types Multi-tenancy Type Data Separation Application Separation Process Separation
    97. 97. GaaE for Multi Tenancy types Product Multi-tenancy Type
    98. 98. GaaE for Multi Tenancy types Product Multi-tenancy Type Google Apps Data Separation
    99. 99. GaaE for Multi Tenancy types Product Multi-tenancy Type Google Apps Data Separation Google App Engine Application Separation
    100. 100. GaaE for Multi Tenancy types Product Multi-tenancy Type Google Apps Data Separation Google App Engine Application Separation Google Compute Engine Process Separation
    101. 101. Strategy Pros Cons Separating data Separating application Separating processes Let’s compare!
    102. 102. Strategy Pros Cons Separating data  Normal Java Application Separating application Separating processes Let’s compare!
    103. 103. Strategy Pros Cons Separating data  Normal Java Application  Manual state separation  Complicated and critical schema Separating application Separating processes Let’s compare!
    104. 104. Strategy Pros Cons Separating data  Normal Java Application  Manual state separation  Complicated and critical schema Separating application Separating processes Let’s compare! 
    105. 105. Strategy Pros Cons Separating data  Normal Java Application  Manual state separation  Complicated and critical schema Separating application Separating processes  No shared state  Simple transition from existing Let’s compare! 
    106. 106. Strategy Pros Cons Separating data  Normal Java Application  Manual state separation  Complicated and critical schema Separating application Separating processes  No shared state  Simple transition from existing  JVM per tenant! Let’s compare! 
    107. 107. Strategy Pros Cons Separating data  Normal Java Application  Manual state separation  Complicated and critical schema Separating application Separating processes  No shared state  Simple transition from existing  JVM per tenant! Let’s compare!  
    108. 108. Strategy Pros Cons Separating data  Normal Java Application  Manual state separation  Complicated and critical schema Separating application  No shared state  Simple transition from existing Separating processes  No shared state  Simple transition from existing  JVM per tenant! Let’s compare!  
    109. 109. Strategy Pros Cons Separating data  Normal Java Application  Manual state separation  Complicated and critical schema Separating application  No shared state  Simple transition from existing Separating processes  No shared state  Simple transition from existing  JVM per tenant! Let’s compare!   
    110. 110. Strategy Pros Cons Separating data  Normal Java Application  Manual state separation  Complicated and critical schema Separating application  No shared state  Simple transition from existing  Stay tuned… Separating processes  No shared state  Simple transition from existing  JVM per tenant! Let’s compare!   
    111. 111. Separate WARs: Tomcat Root ┌── lib ├── webapps │ ├── customer-name │ ├── other-customer-name │ └── many other customers └── other dirs (bin, conf, log, etc)
    112. 112. Separate WARs
    113. 113. Separate WARs
    114. 114. Separate WARs That was the PermGen. Yup.
    115. 115. We love our toys
    116. 116. We love our toys Artifactory-3.0.1.warwebappWEB-INFlib$du –m 51 .
    117. 117. To the common ClassLoader!
    118. 118. Will it work?_________
    119. 119. Will it work? ‹ Object state _________
    120. 120. Will it work? ‹ Object state ‹ Static state _________
    121. 121. “Static State Quest I” (Sierra, who else?)
    122. 122. Spring Framework
    123. 123. The Evil App. Context Holder Pattern
    124. 124. The Evil App. Context Holder Pattern public class AppCtxHolder implements ApplicationContextAware { private static ApplicationContext ctx; public AppCtxHolder() { } public void setApplicationContext(ApplicationContext applicationContext) { ctx = applicationContext; } public static ApplicationContext getApplicationContext() { return ctx; } }
    125. 125. The Evil App. Context Holder Pattern public class AppCtxHolder implements ApplicationContextAware { private static ApplicationContext ctx; public AppCtxHolder() { } public void setApplicationContext(ApplicationContext applicationContext) { ctx = applicationContext; } public static ApplicationContext getApplicationContext() { return ctx; } }
    126. 126. The Evil App. Context Holder Pattern public class AppCtxHolder implements ApplicationContextAware { private static ApplicationContext ctx; public AppCtxHolder() { } public void setApplicationContext(ApplicationContext applicationContext) { ctx = applicationContext; } public static ApplicationContext getApplicationContext() { return ctx; } }
    127. 127. Apache Wicket
    128. 128. Apache Wicket We love Wicket, cause it allows people who hate UI development to develop a UI, which people don’t hate
    129. 129. Apache Wicket
    130. 130. Logger
    131. 131. Logger
    132. 132. CATS Software
    133. 133. Jackrabbit
    134. 134. Jackrabbit
    135. 135. Heap-wide Caches
    136. 136. Don’t actually have to read this
    137. 137. Tomcat Root – Where are the JARs?┌── lib ├── webapps │ ├── customer-name │ │ ├── favicon.ico │ │ ├── META-INF │ │ └── WEB-INF │ │ ├── web.xml │ │ └── classes │ │ └── DUMMY.TXT │ ├── other-customer-name │ │ ├── favicon.ico │ │ │ └── META-INF │ │ └── WEB-INF │ └── many other customers └── other dirs (bin, conf, log, etc)
    138. 138. Tomcat Root – Where are the JARs?┌── lib ├── webapps │ ├── customer-name │ │ ├── favicon.ico │ │ ├── META-INF │ │ └── WEB-INF │ │ ├── web.xml │ │ └── classes │ │ └── DUMMY.TXT │ ├── other-customer-name │ │ ├── favicon.ico │ │ │ └── META-INF │ │ └── WEB-INF │ └── many other customers └── other dirs (bin, conf, log, etc)
    139. 139. Tomcat Root – Where are the JARs?┌── lib ├── webapps │ ├── customer-name │ │ ├── favicon.ico │ │ ├── META-INF │ │ └── WEB-INF │ │ ├── web.xml │ │ └── classes │ │ └── DUMMY.TXT │ ├── other-customer-name │ │ ├── favicon.ico │ │ │ └── META-INF │ │ └── WEB-INF │ └── many other customers └── other dirs (bin, conf, log, etc)
    140. 140. Tomcat Root – Global lib folder ┌── lib │ ├── artifactory │ │ ├── artifactory-*.jar │ │ ├── jackrabbit-core-jfrog-2.2.8c.jar │ │ ├── spring-core-3.1.1.RELEASE.jar │ │ ├── wicket-core-1.5.3.jar │ │ └── other jars │ ├── catalina.jar │ ├── servlet-api.jar │ └── other jars ├── webapps └── other dirs (bin, conf, log, etc)
    141. 141. Tomcat Root – Global lib folder ┌── lib │ ├── artifactory │ │ ├── artifactory-*.jar │ │ ├── jackrabbit-core-jfrog-2.2.8c.jar │ │ ├── spring-core-3.1.1.RELEASE.jar │ │ ├── wicket-core-1.5.3.jar │ │ └── other jars │ ├── catalina.jar │ ├── servlet-api.jar │ └── other jars ├── webapps └── other dirs (bin, conf, log, etc)
    142. 142. Tomcat Root – Global lib folder ┌── lib │ ├── artifactory │ │ ├── artifactory-*.jar │ │ ├── jackrabbit-core-jfrog-2.2.8c.jar │ │ ├── spring-core-3.1.1.RELEASE.jar │ │ ├── wicket-core-1.5.3.jar │ │ └── other jars │ ├── catalina.jar │ ├── servlet-api.jar │ └── other jars ├── webapps └── other dirs (bin, conf, log, etc)
    143. 143. Tomcat Root – Global lib folder ┌── lib │ ├── artifactory │ │ ├── artifactory-*.jar │ │ ├── jackrabbit-core-jfrog-2.2.8c.jar │ │ ├── spring-core-3.1.1.RELEASE.jar │ │ ├── wicket-core-1.5.3.jar │ │ └── other jars │ ├── catalina.jar │ ├── servlet-api.jar │ └── other jars ├── webapps └── other dirs (bin, conf, log, etc)
    144. 144. Tomcat Root – Global lib folder ┌── lib │ ├── artifactory │ │ ├── artifactory-*.jar │ │ ├── jackrabbit-core-jfrog-2.2.8c.jar │ │ ├── spring-core-3.1.1.RELEASE.jar │ │ ├── wicket-core-1.5.3.jar │ │ └── other jars │ ├── catalina.jar │ ├── servlet-api.jar │ └── other jars ├── webapps └── other dirs (bin, conf, log, etc)
    145. 145. PaaS or IaaS?
    146. 146. PaaS or IaaS?
    147. 147. Self-Service?
    148. 148. Prevent the Fork!
    149. 149. The process
    150. 150. Artifactory is built with Artifactory!
    151. 151. The Process
    152. 152. The Process
    153. 153. The Process
    154. 154. The Process
    155. 155. The Process
    156. 156. The Process
    157. 157. The Process
    158. 158. The Process
    159. 159. It’s all about right tools
    160. 160. Also right tools
    161. 161. The Paradigm…
    162. 162. Now we do it the other way around
    163. 163. Actually, now we do it the right way!
    164. 164. And we love what we got!
    165. 165. And we love what we got!
    166. 166. NO, THANK YOU!

    ×