Real-World Boot-Up Sequences - QuickBooks Self-Employed

16
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Real-World Boot-Up Sequences: QuickBooks Self-Employed By Tim Hobson Engineer @

Transcript of Real-World Boot-Up Sequences - QuickBooks Self-Employed

Page 1: Real-World Boot-Up Sequences - QuickBooks Self-Employed

Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/

Real-World Boot-Up Sequences:

QuickBooks Self-Employed

By Tim Hobson – Engineer @

Page 2: Real-World Boot-Up Sequences - QuickBooks Self-Employed

About Me

• Software Developer with a bad habit of leveraging frameworks

• Not a fan of re-inventing wheels every project

• Still believe you can move fast with good architecture

2

so old

Page 3: Real-World Boot-Up Sequences - QuickBooks Self-Employed

About Our Product

3

Providing financial management

and compliance solutions for the

Self-Employed in the US and

(soon) globally.

Launched this year and

continuously releasing new

functionality.

very new

Page 4: Real-World Boot-Up Sequences - QuickBooks Self-Employed

Context – In the Beginning…

New to the world offering, evolving product features

Be ready to pivot, pivot, and

pivot again

4

very ambitious

0 customers, aspirations

of millions

0 lines of code

Aggressive timeline for

initial release

Proven scale-ability,

extensibility required

No legacy, but need to

establish patterns early

Dev/Ops Productivity

essential

Page 5: Real-World Boot-Up Sequences - QuickBooks Self-Employed

My Requirements

5

such needs

Page 6: Real-World Boot-Up Sequences - QuickBooks Self-Employed

Powerful AND Simple?

6

?so

inconceivable

Page 7: Real-World Boot-Up Sequences - QuickBooks Self-Employed

Tell us about your experiences with Spring Boot?

• No XML Config? No web.xml?

• Started prototyping with v0.5

• Bugs found, worked around

them

• Engaged with Spring Team

• Saw continual improvement

• …

7

such promise

Page 8: Real-World Boot-Up Sequences - QuickBooks Self-Employed

Growing Pains

• WAR-based deployment

• myBatis Spring

• Understanding magic (Source debugging)

• @Conditional* …

• Cost-benefit analysis of defying convention

• Security customizations

• Web Sockets through multiple routers, apache httpd

8

concern

Page 9: Real-World Boot-Up Sequences - QuickBooks Self-Employed

Tell us about your experiences with Spring Boot?

Cont’d

• Decided to adopt and GO

• Great Success!

• In production since May

• Rolling out new features every few

weeks

• Just released mobile companion

apps

9

amaze

Page 10: Real-World Boot-Up Sequences - QuickBooks Self-Employed

Observations on what made it work

• Sample apps, documentation

• Enthusiasm, Evangelism and Direction from the Spring team

• Accessible source code with tests you can run!

• Developer inclusion in the process – ideas, contributions, fixes

• Truly no xml configuration – ever, as promised

• Massively simplified POMs

• Developer productivity

• Magic

• I would take this framework with me…

10

wow

Page 11: Real-World Boot-Up Sequences - QuickBooks Self-Employed

On The Shoulders of Giants…

• General– @EnableAutoConfiguration– @EnableConfigurationProperties– YAML Configuration & Profiles

– “Starter” Dependency Management

– Boot Actuator

– ResourceBundleMessageSource– @Aspect– @EnableAspectJAutoProxy– @EnableTransactionManagement– @PersistenceContext– @EnableJpaRepositories– @Async– @EnableAsync

• Web– @EnableMvcSecurity– @EnableWebMvcSecurity– @EnableWebSocketMessageBroker– @ControllerAdvice– @ModelAttribute– @ExceptionHandler– SpringBootServletInitializer

• Batch– CRaSH ssh

– @EnableBatchProcessing– @EnableScheduling– @Scheduled– @Job

11

so enabled

Page 12: Real-World Boot-Up Sequences - QuickBooks Self-Employed

What we configured/overrode/extended/built

• General• Data Migration (flywaydb)

• JpaVendorAdapter & EntityManagerFactory

• Batch• Always-on Batch process with @Scheduled

jobs

• On-demand batch job execution using CRaSH groovy commands

• Security• CSRF support for AngularJS

(HttpSessionCsrfTokenRepository)

• Custom Identity/Auth provider for Spring Security

• Hybrid Thymeleaf + Angular UI

• REST Authentication/Authorization

• Session Expiry, Authentication Failure, AccessDenied Handler

• Web• Container Customization (error pages)

• Unsupported Browser handling

• JS Min/SASS Build integration for Maven (exec-maven) calling compass and uglify

• Static asset versioning (git.properties)

12

such customize

Page 13: Real-World Boot-Up Sequences - QuickBooks Self-Employed

Dev/Ops

• Actuator security

• Custom HealthIndicator• Custom Admin web console (leveraging Actuator

APIs, custom health checks) for ops and customer support

• SLF4J Logging with Logback and Splunk-friendly output

• Server-side error logging for Angular client

• On-demand user-level debug logging

• Memcache session storage to support automated rolling deployments

13

very sudo

Page 14: Real-World Boot-Up Sequences - QuickBooks Self-Employed

Testing – Mocks and “System” Testing

14

@EnableAutoConfiguration@Profile("test")

@Beanpublic DataSource dataSource() {

return new EmbeddedDatabaseBuilder().setType(H2).build();}

@ActiveProfiles("test")@WebAppConfiguration@SpringApplicationConfiguration(classes={ApplicationConfig.class, TestConfig.class})…

public class UserControllerTest extends AbstractTestNGSpringContextTests {

private MockMvc mvc;

@BeforeClasspublic void setUp() {

this.mvc = MockMvcBuilders.webAppContextSetup(this.context).build();}

@Mockprivate Authentication authentication;…@BeforeTestpublic void setUp() {

MockitoAnnotations.initMocks(this);}

such ease

Page 15: Real-World Boot-Up Sequences - QuickBooks Self-Employed

What’s Next?

15

Reactor

AMQP (RabbitMQ)

spring-session

Spring IO

Page 16: Real-World Boot-Up Sequences - QuickBooks Self-Employed

Thanks!

Questions?

16

@hoserdude

@hoserdude

@hoserdude

hoserdude.com