< Return to Video

RailsConf 2014 - An Iterative Approach to Service Oriented Architecture by Eric Saxby

  • 0:17 - 0:19
    ERIC SAXBY: Thanks for coming.
  • 0:19 - 0:21
    So, I am Eric Saxby. Today I'm gonna be talking
  • 0:21 - 0:25
    about iterating towards service-oriented
  • 0:25 - 0:29
    architecture. I may have time for questions
  • 0:29 - 0:30
    at the end, but I may not.
  • 0:30 - 0:31
    This might go forty minutes,
  • 0:31 - 0:33
    so I'm just gonna get started.
  • 0:33 - 0:36
    So, if you're like me, you can't really pay
  • 0:36 - 0:38
    attention in talking about programming
  • 0:38 - 0:39
    unless there are pictures
  • 0:39 - 0:45
    of cats. So really, we're going from this
    to
  • 0:45 - 0:49
    something a little bit more like this. But
    working
  • 0:49 - 0:51
    together, as a family.
  • 0:51 - 0:53
    So why should you care? Why should you listen
  • 0:53 - 0:58
    to me? So you may not know this, but
  • 0:58 - 1:02
    I'm kind of a big deal. But, but really,
  • 1:02 - 1:05
    I've, I've actually not been doing this for
    that
  • 1:05 - 1:07
    long. I've been doing Rails for about six
    years.
  • 1:07 - 1:11
    Before and after that, I had been using various
  • 1:11 - 1:17
    different technologies. And I have been fortunate
    to work
  • 1:17 - 1:20
    with some very smart people and be able to
  • 1:20 - 1:22
    learn from them and to break a lot of
  • 1:22 - 1:25
    things really quickly. And right now I work
    at
  • 1:25 - 1:28
    Wanelo. Also, I'm trying to collect all of
    the
  • 1:28 - 1:31
    buzzwords on my resume. I have more. I have
  • 1:31 - 1:32
    more than just this.
  • 1:32 - 1:37
    But, so, why is Wanelo important? We're like
    a
  • 1:37 - 1:41
    social network for shopping, but really it's
    because we
  • 1:41 - 1:45
    have many millions of users, active users,
    and databases
  • 1:45 - 1:47
    with billions of records. And we've gone through
    the
  • 1:47 - 1:50
    pain of getting there and keeping the site
    actually
  • 1:50 - 1:54
    running. So, you can save any product from
    any
  • 1:54 - 1:57
    store on the internet into your own collections
    and
  • 1:57 - 2:00
    have your own wishlist. That's what we do.
  • 2:00 - 2:04
    More importantly, we've gone from having this
    as one
  • 2:04 - 2:08
    main Rails application, doing all of this,
    to a
  • 2:08 - 2:12
    central Rails application that's still fairly
    large, but supported
  • 2:12 - 2:15
    by a lot of services. We've done as much
  • 2:15 - 2:17
    as we could open source. Some of the, the
  • 2:17 - 2:20
    business domain logic, it's really hard to
    open source.
  • 2:20 - 2:23
    But, but we try as much as possible.
  • 2:23 - 2:26
    We've done almost all of this in Ruby, including
  • 2:26 - 2:30
    some things that people who prefer other languages
    say
  • 2:30 - 2:33
    can't be done in Ruby. And we've done this
  • 2:33 - 2:36
    with a very, very small team very quickly.
  • 2:36 - 2:39
    If you're like me, though, you're really not
    so
  • 2:39 - 2:42
    interested in the success story as you're
    interested in,
  • 2:42 - 2:46
    how did you screw up, how did you, how
  • 2:46 - 2:50
    did you break. So, let me take you on
  • 2:50 - 2:56
    a journey to another company that a friend
    of
  • 2:56 - 3:03
    mine once, recently, called "The Anti-Pattern
    Goldmine." Completely hypothetical
  • 3:04 - 3:06
    company. Not naming any names. That I may
    or
  • 3:06 - 3:08
    may not have worked for. Some of you in
  • 3:08 - 3:12
    the audience may or may not have worked for.
  • 3:12 - 3:14
    After some of this story, you might think
    you
  • 3:14 - 3:18
    did. Come in, it's a startup. It's new. Small
  • 3:18 - 3:20
    team. And come in and say, wow. For a
  • 3:20 - 3:27
    startup, you have a lot of code that's really,
  • 3:27 - 3:31
    really tangled. It's all Rails 2 code base.
    You
  • 3:31 - 3:34
    know, if you remember vendoring Rails, we,
    we did
  • 3:34 - 3:36
    that. If you remember how vendoring Rails
    can go
  • 3:36 - 3:39
    wrong? Yeah, yeah. Yeah, that was there. That
    was
  • 3:39 - 3:40
    there.
  • 3:40 - 3:42
    And I think a lot of this might have
  • 3:42 - 3:46
    come down to the fact that at least early
  • 3:46 - 3:51
    on, success of a product, success of a feature,
  • 3:51 - 3:54
    really was launching it as quickly as possible.
    And
  • 3:54 - 3:56
    no, no, no, no. Don't worry about that stuff.
  • 3:56 - 4:00
    Don't worry about design. And we have thirty
    engineers
  • 4:00 - 4:03
    doing that as rapidly as possible. Like, five
    or
  • 4:03 - 4:07
    six teams all doing that as rapidly as possible,
  • 4:07 - 4:10
    trying to get it into production. And releases
    were
  • 4:10 - 4:13
    a mess, you know. I'm sure a lot of
  • 4:13 - 4:19
    you can relate to this. Deployments. Multiple
    hours with
  • 4:19 - 4:21
    all of this engineer, all these engineers
    trying to
  • 4:21 - 4:23
    put all of this code in as quickly as
  • 4:23 - 4:29
    possible. Invariably, deployments went wrong.
  • 4:29 - 4:34
    And eventually this got a little bit faster
    from,
  • 4:34 - 4:39
    from monthly releases to weekly releases.
    But then we
  • 4:39 - 4:43
    would have code freezes, where for three months,
    everyone's
  • 4:43 - 4:45
    trying to cram in all the features without
    deploying,
  • 4:45 - 4:47
    and you can imagine where that goes.
  • 4:47 - 4:50
    And, over time, really, things are just getting
    worse.
  • 4:50 - 4:54
    We, our rough estimates that we're trying
    to give
  • 4:54 - 4:57
    to see how long things are gonna last come
  • 4:57 - 4:59
    back, and we say, oh, that means we were
  • 4:59 - 5:01
    deploying on this date. You know, hey, we
    told
  • 5:01 - 5:03
    the board, great. That's awesome. You're gonna
    deploy on
  • 5:03 - 5:07
    this date. Ah. Whoo. With a deadline like
    that,
  • 5:07 - 5:09
    the only really way to meet it is to
  • 5:09 - 5:13
    make serious shortcuts. And then as soon as
    a
  • 5:13 - 5:18
    product finishes, because we're invariably
    missing those deadlines, and
  • 5:18 - 5:21
    there's the next project that is supposed
    to be
  • 5:21 - 5:23
    out in, in a week, based on the estimates
  • 5:23 - 5:27
    that you were supposed to do. Team gets dispersed.
  • 5:27 - 5:31
    Finish these new projects. And no matter how
    worse
  • 5:31 - 5:32
    case we are in our estimates, it's just never
  • 5:32 - 5:35
    worst case enough. It just, it just keeps
    getting
  • 5:35 - 5:37
    worse.
  • 5:37 - 5:40
    So some of you might, might be familiar with
  • 5:40 - 5:44
    this story. So, during the course of this,
    I,
  • 5:44 - 5:48
    I, I, I think I've learned a lot. You
  • 5:48 - 5:50
    know, programming is one of the most fun careers
  • 5:50 - 5:52
    that I've, that I've had, and when it's not
  • 5:52 - 5:56
    fun, you know, you know something's wrong.
    And keep
  • 5:56 - 5:59
    reading about service-oriented architecture,
    and, you know, a lot
  • 5:59 - 6:02
    of us latch onto this. This is the solution
  • 6:02 - 6:04
    to all of our problems. And you know at
  • 6:04 - 6:06
    dev ops, that's pretty cool over there. You
    know,
  • 6:06 - 6:08
    dev ops is the answer. That's how we're gonna
  • 6:08 - 6:10
    do services. It's just gonna, it's a done
    deal.
  • 6:10 - 6:12
    All we have to do is do services, dev
  • 6:12 - 6:15
    opsy, and like, we're done.
  • 6:15 - 6:19
    So around this time, I move into the operations,
  • 6:19 - 6:23
    not, not the operations team, cause dev ops.
    Not
  • 6:23 - 6:25
    the operations team. Not the team over there
    that
  • 6:25 - 6:27
    you just throw the things over the wall and
  • 6:27 - 6:29
    they just make it work. No, no, no. Not,
  • 6:29 - 6:33
    not the operations team at all.
  • 6:33 - 6:36
    And certainly me, a number of other people
    in
  • 6:36 - 6:41
    the engineering team, I, I could say, really
    decided
  • 6:41 - 6:44
    services are the only way forward. And really
    quickly,
  • 6:44 - 6:48
    product, and, and I don't mean an individual
    project
  • 6:48 - 6:49
    manager or anything like that. By product,
    I mean
  • 6:49 - 6:52
    really, all of the people, all of the teams
  • 6:52 - 6:56
    going into designing the product, planning
    the product, really
  • 6:56 - 7:00
    how it was going forward, they quickly come
    to
  • 7:00 - 7:02
    the conclusion that services are really just
    that, just
  • 7:02 - 7:04
    that, that thing getting in the way of us
  • 7:04 - 7:08
    cranking out these features. Cause features
    is success.
  • 7:08 - 7:10
    But at first, if at first you can't succeed,
  • 7:10 - 7:13
    I have, I have, I have learned, you know,
  • 7:13 - 7:15
    there's, there's a few things. You can take
    a
  • 7:15 - 7:22
    firm stance, breathe deeply, and become the
    loudest person
  • 7:22 - 7:27
    in the room. Really, really helps. Also, if
    there's
  • 7:27 - 7:30
    anything that I've learned from my cats, it's
    throw
  • 7:30 - 7:34
    shit, you know. Done. It really, really helps
    in
  • 7:34 - 7:36
    situations like this.
  • 7:36 - 7:39
    So, we, we have a few things coming up.
  • 7:39 - 7:44
    A few products. These, these aren't necessarily
    concurrent, these,
  • 7:44 - 7:47
    these features. These projects. But we have
    a new
  • 7:47 - 7:52
    login feature and login, in this application,
    is as
  • 7:52 - 7:55
    homegrown as you could possibly imagine it
    could go
  • 7:55 - 8:00
    wrong. And it's this core, core login functionality,
    and
  • 8:00 - 8:02
    we're like, no, no, no, no, no, no. No,
  • 8:02 - 8:03
    no, no, no, no, no. That's not going in
  • 8:03 - 8:07
    this code base. That's gonna be a new application,
  • 8:07 - 8:11
    we're. That's the only way we're gonna do
    this.
  • 8:11 - 8:13
    Otherwise we're just not gonna do this. It's
    gonna
  • 8:13 - 8:15
    fail. We know it's gonna fail. So let's just
  • 8:15 - 8:17
    skip to not doing it.
  • 8:17 - 8:22
    And, also, we have this enterprise software
    over here,
  • 8:22 - 8:25
    and we have this homegrown Rails application,
    and all
  • 8:25 - 8:28
    the data really needs to kind of be synced
  • 8:28 - 8:31
    between it in order for the company to actually
  • 8:31 - 8:36
    work. So a lot of iterations on this, but
  • 8:36 - 8:38
    really this time, we're gonna do it right,
    and
  • 8:38 - 8:41
    it's gonna be a, a data service. We're gonna
  • 8:41 - 8:43
    have our Enterprise software in our Rails
    app and
  • 8:43 - 8:46
    that is totally just gonna make this an Enterprise-Rails
  • 8:46 - 8:46
    app. It's gonna be amazing.
  • 8:46 - 8:50
    And I remember saying this a lot to a
  • 8:50 - 8:52
    lot of different people. Like, we're gonna
    screw this
  • 8:52 - 8:55
    up. We're gonna fail. I know we're gonna fail.
  • 8:55 - 8:57
    But it's the only option that we have. It's
  • 8:57 - 8:59
    the only way that we're actually gonna be
    able
  • 8:59 - 9:01
    to get to be able to do this and
  • 9:01 - 9:05
    succeed at some point in the future.
  • 9:05 - 9:10
    OK, so on, on a side track, hopefully this
  • 9:10 - 9:14
    is not new to very many of you, but
  • 9:14 - 9:16
    really there's a lot of different ways to
    do
  • 9:16 - 9:18
    service-oriented architecture. It can mean
    a lot of different
  • 9:18 - 9:22
    things. Read blog posts. You get a lot of
  • 9:22 - 9:25
    different ideas. It can be synchronous, asynchronous.
    Use a
  • 9:25 - 9:28
    message bus. Maybe some services require actually
    hitting them
  • 9:28 - 9:32
    over HTTP, TCP sockets. You know, there's
    a lot
  • 9:32 - 9:35
    of ways of different doing, of doing this
    kind
  • 9:35 - 9:36
    of thing.
  • 9:36 - 9:38
    But why would you really want to? So, you
  • 9:38 - 9:39
    know, scale the organization. You have a lot
    of
  • 9:39 - 9:42
    different teams. A lot of different engineers.
    Maybe you
  • 9:42 - 9:44
    really want this team over here to just have
  • 9:44 - 9:47
    their own code base that they deploy separately.
    Also,
  • 9:47 - 9:49
    maybe you want to outsource this to a different
  • 9:49 - 9:51
    team, and you really don't want to give all
  • 9:51 - 9:53
    of the code to the other team. You really
  • 9:53 - 9:56
    just want to isolate this and say, you know,
  • 9:56 - 10:01
    you guys over here, you know, just, here,
    here's
  • 10:01 - 10:04
    this. Sorry. I'm, I'm actually trying to explain
    it
  • 10:04 - 10:09
    all gendered pronounce from my vocabulary
    but it's really
  • 10:09 - 10:12
    hard. Sorry.
  • 10:12 - 10:16
    So, you can also scale the code base, you
  • 10:16 - 10:20
    know. Performance of this thing over here
    might be
  • 10:20 - 10:24
    completely different than this thing over
    here, and that
  • 10:24 - 10:26
    might actually be easier in a service. You
    can
  • 10:26 - 10:28
    really tune the code to the work load. You
  • 10:28 - 10:31
    might have this really complicated code that,
    for various
  • 10:31 - 10:33
    reasons, needs to be complicated. It might
    be really
  • 10:33 - 10:36
    complicated functionality. But you can, you
    might be able
  • 10:36 - 10:41
    to hide that behind a, a clean interface.
    An
  • 10:41 - 10:42
    API.
  • 10:42 - 10:46
    And tests, usually, not always, but a small
    code
  • 10:46 - 10:49
    base can mean fast tests. And if you're sitting
  • 10:49 - 10:52
    around for hours waiting for tests to complete,
    you
  • 10:52 - 10:54
    know, that can be, that can really eat into
  • 10:54 - 10:56
    your productivity. But it, but it comes at
    a
  • 10:56 - 10:58
    cost. All of this comes at a cost.
  • 10:58 - 11:01
    And I think one of the things that, that
  • 11:01 - 11:04
    I've been learning is that sometimes the cost
    of
  • 11:04 - 11:07
    not doing this is greater than the cost of
  • 11:07 - 11:10
    doing. The cost of the infrastructure, new
    servers, how
  • 11:10 - 11:13
    they talk together. It's really complicated.
    Things will go
  • 11:13 - 11:15
    wrong. But sometimes not doing this is gonna,
    is
  • 11:15 - 11:17
    gonna mean that your productivity is going
    down and
  • 11:17 - 11:20
    down and down and, and it actually is more
  • 11:20 - 11:21
    costly.
  • 11:21 - 11:24
    OK, so back to these projects. We have this
  • 11:24 - 11:28
    data service. It's sometimes, I think six
    engineers, sometimes
  • 11:28 - 11:32
    eight. I don't, I don't really remember. And
    nine
  • 11:32 - 11:36
    months of, of work. It's really complicated,
    like state
  • 11:36 - 11:39
    transactions, and this is really critical
    data that really
  • 11:39 - 11:44
    needs to be done right. And there are, so,
  • 11:44 - 11:46
    there, there might have been, when deploying
    it, some,
  • 11:46 - 11:48
    some slight data things. But they were fixable.
    Really
  • 11:48 - 11:50
    quickly. It was fine. There were actually
    no major
  • 11:50 - 11:52
    data problems.
  • 11:52 - 11:54
    And there were some applications that were
    built on
  • 11:54 - 11:57
    top of this data service. And depending on
    who
  • 11:57 - 12:01
    you talk to, they, they were more or less
  • 12:01 - 12:03
    successful. Some people using that, these
    applications are like,
  • 12:03 - 12:06
    oh, thank you, this did exactly what, what
    I
  • 12:06 - 12:07
    need. It's actually helping me with my workflow.
    Some
  • 12:07 - 12:11
    people are like, oh, OK.
  • 12:11 - 12:13
    But engineering, you know what, this was really
    critical
  • 12:13 - 12:17
    data. It was really hard. Totally new for
    us.
  • 12:17 - 12:20
    This was a success. We did not break anything.
  • 12:20 - 12:26
    Product is like nine months? Nine months.
    Eight engineers,
  • 12:26 - 12:30
    nine months. How could you possibly call that
    a
  • 12:30 - 12:31
    success?
  • 12:31 - 12:37
    OK. So different application. Login flow.
    Depending on the
  • 12:37 - 12:40
    time period, two engineers, four engineers,
    plus the dev
  • 12:40 - 12:46
    ops team. Dev ops. Three months, you know.
    You
  • 12:46 - 12:50
    know, we were figuring out, like, the system's
    automation
  • 12:50 - 12:55
    was really tangled and in, in a few weeks
  • 12:55 - 13:00
    we had some staging servers. And about two
    months
  • 13:00 - 13:03
    later, someone comes up to me and says, hey,
  • 13:03 - 13:05
    where, where, where are the servers gonna,
    gonna be?
  • 13:05 - 13:08
    Can we get those? And I'm like, deep breath.
  • 13:08 - 13:12
    Deep breath. Which servers? Oh, this, those
    staging servers.
  • 13:12 - 13:17
    But it went, we worked it all out.
  • 13:17 - 13:19
    Something that I learned about dev ops. Everyone
    actually
  • 13:19 - 13:23
    needs to be invested and it's new to people.
  • 13:23 - 13:25
    So, and it was released with a feature flag.
  • 13:25 - 13:27
    Only a small amount of people were actually
    running
  • 13:27 - 13:31
    through it. So it, we had some really good
  • 13:31 - 13:34
    time to break it in production and really
    figure
  • 13:34 - 13:37
    out how, how it was really gonna run.
  • 13:37 - 13:39
    And we launched it to all of our users,
  • 13:39 - 13:42
    and it was actually, I would say, very successful.
  • 13:42 - 13:47
    It worked exactly intended. It was very resilient
    to
  • 13:47 - 13:49
    failures. We had to do some unexpected database
    maintenance.
  • 13:49 - 13:52
    Restart master databases and we're like, you
    know what,
  • 13:52 - 13:55
    just do it. You know, just, just restart the
  • 13:55 - 13:57
    database. No, no, no, no, no. Don't turn off
  • 13:57 - 13:59
    the service. It's gonna recover. It's gonna
    be fine.
  • 13:59 - 14:02
    Maybe like one user will notice.
  • 14:02 - 14:04
    And the company's actually sort of figuring
    out that
  • 14:04 - 14:08
    user metrics might be more important than
    dates as
  • 14:08 - 14:12
    metrics, and the user metrics were generally
    successful. So
  • 14:12 - 14:15
    engineering, like, this, this is good. This
    is good.
  • 14:15 - 14:17
    This is, this is how we do this. This
  • 14:17 - 14:20
    is, you know, the next project, this is how
  • 14:20 - 14:22
    we're gonna, we're gonna have to figure this.
  • 14:22 - 14:25
    And products is like three months? What are
    you
  • 14:25 - 14:28
    talking about? Success? That's not success.
    We have these
  • 14:28 - 14:31
    other product features that needed to be done.
    And
  • 14:31 - 14:32
    we have these four engineers that are sitting
    in
  • 14:32 - 14:36
    the corner, not able to do these things.
  • 14:36 - 14:42
    OK. So I would say that this is a
  • 14:42 - 14:44
    really important question to ask. What is,
    what is
  • 14:44 - 14:48
    success? If engineering says it's a success,
    and product
  • 14:48 - 14:52
    says it's a failure, who really wins? So,
    this
  • 14:52 - 14:56
    is actually a trick question, because it's
    a zero-sum
  • 14:56 - 14:59
    game. Like, nobody wins in this interaction.
  • 14:59 - 15:01
    So let's go a little bit deeper to ask
  • 15:01 - 15:05
    why we needed SOA in the first place. And,
  • 15:05 - 15:08
    I, this is really complicated. There's lots
    of moving
  • 15:08 - 15:10
    parts, but some of the things that, that I
  • 15:10 - 15:15
    think now were because engineering didn't
    trust product, and
  • 15:15 - 15:17
    we actually didn't, what that really means
    is we
  • 15:17 - 15:22
    didn't trust that we could do our jobs well
  • 15:22 - 15:24
    given the shortcuts that we needed to do to
  • 15:24 - 15:28
    actually do our job and actually meet our
    metrics.
  • 15:28 - 15:30
    And product didn't trust engineering to meet
    the products
  • 15:30 - 15:33
    we were given, and we, we couldn't actually
    meet
  • 15:33 - 15:38
    those promises. And, again, over time, this
    was changing,
  • 15:38 - 15:41
    but product was accountable for features,
    not or quality,
  • 15:41 - 15:45
    and, and the actual how users interacted with
    them.
  • 15:45 - 15:48
    And this is probably the subject of much more
  • 15:48 - 15:50
    discussion, and would love to continue this
    and, and
  • 15:50 - 15:51
    learn more myself, but I think that a lot
  • 15:51 - 15:56
    of this comes down to trust. If, if, if
  • 15:56 - 15:58
    you can't trust that you can do your job
  • 15:58 - 16:00
    successfully, how, how can you actually do
    your job
  • 16:00 - 16:02
    successfully? If, if product, if different
    parts of the
  • 16:02 - 16:04
    company don't trust each other to do their
    jobs
  • 16:04 - 16:07
    well, how can they actually do their jobs
    well?
  • 16:07 - 16:11
    So, what did, what did we learn? You know,
  • 16:11 - 16:14
    fuck it, next time it's SOA from the beginning.
  • 16:14 - 16:16
    Like, before we even do Rails new it's gonna
  • 16:16 - 16:19
    be RabbitMQ. We're gonna have a cluster. It's
    gonna
  • 16:19 - 16:23
    be amazing. So, no. No, no, no. Not, not,
  • 16:23 - 16:26
    not the right answer. I almost went here,
    and
  • 16:26 - 16:30
    thankfully I worked, then, with some very
    humble, empathetic
  • 16:30 - 16:33
    people, who were also very convincing. No.
  • 16:33 - 16:37
    So, I think what I've, what I have really
  • 16:37 - 16:39
    taken from this, is Agile's not just one sprint
  • 16:39 - 16:42
    after the next. It's like four miles is great.
  • 16:42 - 16:45
    You just break it up into a hundred meter
  • 16:45 - 16:47
    increments and you just, each one is a sprint.
  • 16:47 - 16:48
    It's gonna be fine.
  • 16:48 - 16:52
    What this really is about iterating. Deploying
    things, small
  • 16:52 - 16:54
    things, really quickly, using the data that
    you get
  • 16:54 - 16:57
    from that to figure out what to do next,
  • 16:57 - 17:01
    and refactoring. Refactoring is really, really
    important. You might
  • 17:01 - 17:04
    be able to do a small thing quickly, and
  • 17:04 - 17:08
    with some shortcuts, not really needing to
    know how
  • 17:08 - 17:10
    it needs to be designed. But when you see
  • 17:10 - 17:13
    the pattern, you, you have to fix it. And
  • 17:13 - 17:17
    SOA's not gonna solve larger organizational
    problems.
  • 17:17 - 17:20
    It's not gonna fix your code. Really what
    it
  • 17:20 - 17:24
    is is another tool at our disposal to solve
  • 17:24 - 17:27
    our pain points, and our, and our organization's,
    our
  • 17:27 - 17:31
    company's pain points. And how we do that
    is
  • 17:31 - 17:38
    through iteration. So, small changes deployed,
    deployed quickly, using
  • 17:38 - 17:40
    feature flags so that you can actually get
    code
  • 17:40 - 17:43
    into production as soon as possible, knowing
    that it's
  • 17:43 - 17:46
    off and it's not gonna affect users. And prioritizing
  • 17:46 - 17:48
    this when it's necessary.
  • 17:48 - 17:52
    So when might it be necessary? I would say
  • 17:52 - 17:53
    performance. That's a really big thing. This
    is actually
  • 17:53 - 17:58
    driving a lot of what we're doing. Code complexity
  • 17:58 - 18:00
    might be less in a service than it would
  • 18:00 - 18:02
    be outside of a service. So if you have
  • 18:02 - 18:04
    these two things and you're like, this is
    actually
  • 18:04 - 18:05
    gonna be easier to do over here than to
  • 18:05 - 18:08
    put in this tangled mess, maybe, maybe it
    is
  • 18:08 - 18:08
    better.
  • 18:08 - 18:11
    May, and also maybe, sometimes you have a
    new
  • 18:11 - 18:14
    feature and it is completely unrelated to
    everything else
  • 18:14 - 18:18
    that you've already done. With the caveat
    that you,
  • 18:18 - 18:19
    in the short term, you might be able to
  • 18:19 - 18:21
    put it in with all the rest of that
  • 18:21 - 18:25
    mess, trusting that when it becomes a problem
    you
  • 18:25 - 18:28
    will be empowered to fix that problem.
  • 18:28 - 18:32
    OK. So, performance. As I said, this is driving
  • 18:32 - 18:35
    a lot of, of our work. So, Winelow is
  • 18:35 - 18:38
    getting slower. We're running into some problems.
    We just
  • 18:38 - 18:41
    got ring that the databases are becoming I/O
    bound
  • 18:41 - 18:43
    on disk. This is a really, really bad place
  • 18:43 - 18:47
    to be. But our user growth is increasing dramatically.
  • 18:47 - 18:51
    The, the activity is increasing dramatically.
    We're starting to
  • 18:51 - 18:55
    see exponential tendencies in our graphs,
    and if you
  • 18:55 - 18:59
    see exponential tendencies in your user graphs,
    it's kind
  • 18:59 - 19:02
    of like giving a talk to hundreds of people.
  • 19:02 - 19:06
    You're like, why are you all looking at me?!
  • 19:06 - 19:10
    It's, it can be scary. It can be really
  • 19:10 - 19:14
    scary. But we have, so we have one table
  • 19:14 - 19:17
    that's really outstripping the others, and
    that's causing problems.
  • 19:17 - 19:19
    That's, it's, we discover, because of our
    data, because
  • 19:19 - 19:22
    of our graphs, that it's really one table
    that's
  • 19:22 - 19:25
    really destroying the performance of the rest
    of the
  • 19:25 - 19:28
    table. And we're in the cloud, cause we have
  • 19:28 - 19:32
    all those buzzwords. So there's really a maximum
    size
  • 19:32 - 19:34
    of a host that we can get. So there's
  • 19:34 - 19:36
    really, like, an upper limit of how much we
  • 19:36 - 19:39
    can actually solve this with one database.
  • 19:39 - 19:43
    Even after read-write splitting, we've already
    done that, and
  • 19:43 - 19:45
    we, and, and pretty soon, we realized that
    the
  • 19:45 - 19:49
    site is gonna break. If we don't do anything,
  • 19:49 - 19:51
    we're just not gonna have a company anymore.
    It's
  • 19:51 - 19:56
    just gonna, it's gonna fall down. But, we
    have
  • 19:56 - 20:00
    really, really, really active committed users
    joining us right
  • 20:00 - 20:03
    now. Now is not the time to stop feature-development.
  • 20:03 - 20:05
    Now's the time to really learn from what our
  • 20:05 - 20:08
    users are doing, double down on it, really
    tweak
  • 20:08 - 20:10
    our features and figure out what is gonna
    make
  • 20:10 - 20:12
    our business successful.
  • 20:12 - 20:14
    And we only have ten engineers at this point.
  • 20:14 - 20:16
    We don't really have that much, that many
    resources
  • 20:16 - 20:19
    to, to, to work with this.
  • 20:19 - 20:25
    So, our first step of iteration is realizing
    that
  • 20:25 - 20:27
    this is one problem. How do we solve this
  • 20:27 - 20:30
    one problem? And this is maybe going to be
  • 20:30 - 20:31
    a service. How do we get to a point
  • 20:31 - 20:33
    where it can be a service? So first step
  • 20:33 - 20:38
    is isolating the data. So ActiveRecord gives
    you these
  • 20:38 - 20:42
    really nice things. Associations, has_many,
    has_one. Things that really
  • 20:42 - 20:46
    make the joins between your tables easier.
  • 20:46 - 20:48
    When you have a service, you don't have joins.
  • 20:48 - 20:50
    So these need to go away. These, these just
  • 20:50 - 20:52
    don't exist. But it's actually really easy
    to get
  • 20:52 - 20:57
    rid of these, honestly. A product has saves,
    you
  • 20:57 - 21:00
    know. You save this product into a collection.
    You
  • 21:00 - 21:03
    know, we could just take that where clause
    that,
  • 21:03 - 21:05
    that ActiveRecord was gonna sort of do for
    us
  • 21:05 - 21:08
    with, with a join, and just pull it out
  • 21:08 - 21:11
    as a, as a where.
  • 21:11 - 21:14
    Really not that hard, actually. And you know
    what,
  • 21:14 - 21:17
    ActiveRecord also gives us ways of talking
    to a
  • 21:17 - 21:20
    different database. But, you know, we can
    actually use
  • 21:20 - 21:23
    this to just pretend it's in a different database.
  • 21:23 - 21:27
    Establish connection allows you to have this
    model live
  • 21:27 - 21:29
    in this database and all the rest of your
  • 21:29 - 21:31
    stuff live in your main frames. It's really
    not
  • 21:31 - 21:32
    that hard.
  • 21:32 - 21:34
    And, one of the key things is that each
  • 21:34 - 21:37
    step of this, each slight change, is deployable,
    and
  • 21:37 - 21:40
    it's testable. And you can deploy it to staging.
  • 21:40 - 21:43
    You can click around to see where, where your
  • 21:43 - 21:45
    test coverage is maybe missing. Figure out
    where, where
  • 21:45 - 21:46
    it breaks. And one thing is that, that I
  • 21:46 - 21:48
    will say, is you might be doubling your database
  • 21:48 - 21:51
    connections at this point. And when you database
    hits
  • 21:51 - 21:56
    the max connections, just everything stops.
    It just stops
  • 21:56 - 21:57
    working.
  • 21:57 - 22:04
    So, we've learned this lesson the hard way.
    But
  • 22:05 - 22:07
    now that we have this code deployed that pretends
  • 22:07 - 22:08
    like it's in a different database, we can
    make
  • 22:08 - 22:12
    it a different database. Without actually
    that much work.
  • 22:12 - 22:16
    You have a Postgres - we love Postgres -
  • 22:16 - 22:18
    we have a master database. And we spin up
  • 22:18 - 22:21
    a replica over here, and we put the site
  • 22:21 - 22:28
    into maintenance mode. If you have more critical
    interactions
  • 22:28 - 22:30
    with your company that maintenance mode might,
    might not
  • 22:30 - 22:33
    be possible, brain tree has some really great
    blogs
  • 22:33 - 22:38
    and, I think, talks about this. But, for us,
  • 22:38 - 22:40
    the operational overhead of making it so we
    can
  • 22:40 - 22:43
    do this without the site being down was way
  • 22:43 - 22:44
    more than it was worth.
  • 22:44 - 22:46
    So we just take the site down. Push in
  • 22:46 - 22:48
    new database dot yml, saying now this connection
    is
  • 22:48 - 22:50
    talking to this database. And we just promote
    that
  • 22:50 - 22:53
    to master and restart everything, bring the
    site back,
  • 22:53 - 22:58
    and now we have two databases. Five minutes
    of
  • 22:58 - 23:02
    downtime. Not, not that bad, actually. And
    you know,
  • 23:02 - 23:04
    after the fact, you can clean up. You know,
  • 23:04 - 23:06
    we have a redundant table over here. A bunch
  • 23:06 - 23:08
    of redundant tables over here. You just truncate
    them
  • 23:08 - 23:12
    and delete them. Very carefully.
  • 23:12 - 23:14
    Not that hard. And actually, you know what,
    at
  • 23:14 - 23:16
    this point, you might not need a service.
    You
  • 23:16 - 23:19
    might be done. Your site might just be working.
  • 23:19 - 23:24
    It's fine. For us, we, we knew, based on
  • 23:24 - 23:26
    how things were going, that we were gonna
    have
  • 23:26 - 23:28
    to horizontally shared this data. Now it's
    in a
  • 23:28 - 23:31
    different database. That is gonna have to
    be many
  • 23:31 - 23:32
    databases.
  • 23:32 - 23:34
    And we want to hide that complexity. We don't,
  • 23:34 - 23:36
    we do not want our main application to have
  • 23:36 - 23:40
    any of that code. So, we know we're gonna
  • 23:40 - 23:43
    have a service. Now isolate the interface.
    And now
  • 23:43 - 23:45
    what this, by this, I mean, how are you
  • 23:45 - 23:48
    actually accessing this data? And what is
    your long-term
  • 23:48 - 23:52
    goal? You know, ours is sharding, and Wanelo
    is
  • 23:52 - 23:54
    saves, and anytime we're actually getting
    saves, we're either
  • 23:54 - 23:56
    looking at by product - a product has these
  • 23:56 - 23:57
    saves - or we have it by user. A
  • 23:57 - 23:59
    user has saved these things.
  • 23:59 - 24:02
    So, this is actually really helpful, how to
    plan
  • 24:02 - 24:05
    out what, your DSL, what your API is gonna
  • 24:05 - 24:07
    look like, you know. We know that things are
  • 24:07 - 24:09
    gonna have to get to it via product or
  • 24:09 - 24:13
    via user. And so, you have some where clauses,
  • 24:13 - 24:16
    you know. Where is ActiveRecord? We are not
    gonna
  • 24:16 - 24:17
    have ActiveRecord.
  • 24:17 - 24:20
    So, instead a save has a by_product method
    that
  • 24:20 - 24:23
    is also. Oh, so one thing I will say
  • 24:23 - 24:26
    is, at this point it's really helpful to remove
  • 24:26 - 24:29
    redundancy. If you have different ways of
    accessing kind
  • 24:29 - 24:32
    of the same data, do you really need that?
  • 24:32 - 24:33
    You know. Can you change the product to mean
  • 24:33 - 24:35
    that you don't actually have as many of these
  • 24:35 - 24:38
    fingers as you have. And very soon, things
    are
  • 24:38 - 24:40
    gonna break. So if you don't have tests, this
  • 24:40 - 24:44
    is a really good place to add tests.
  • 24:44 - 24:49
    So, now, we have a, a small sort of
  • 24:49 - 24:52
    Ruby DSL. How do we actually pull that out?
  • 24:52 - 24:54
    And I would say, right now, it actually doesn't
  • 24:54 - 24:56
    need to be a service. Really what you need
  • 24:56 - 24:57
    is a client. And how do you build the
  • 24:57 - 25:01
    client out? And that's where adapters really
    come in.
  • 25:01 - 25:03
    So, we use the module. This could be a
  • 25:03 - 25:05
    base class. Some of the reasons why we thought
  • 25:05 - 25:07
    we needed a module. Maybe we didn't Maybe
    we
  • 25:07 - 25:09
    could have actually done this as, as a base
  • 25:09 - 25:13
    class. But now, a save is a SaveClient. And
  • 25:13 - 25:17
    that SaveClient is where your fingers go as,
    their
  • 25:17 - 25:20
    class methods. And one thing I would point
    out
  • 25:20 - 25:24
    is that that, that finder is calling through
    to
  • 25:24 - 25:27
    an adapter. A database adapter.
  • 25:27 - 25:29
    And really, that's what's wrapping up all
    your database
  • 25:29 - 25:33
    calls. Hiding them from, from your application.
    And really
  • 25:33 - 25:35
    one of the core pieces of this is that
  • 25:35 - 25:38
    your database, your, your adapter is your
    feature flag.
  • 25:38 - 25:41
    It's also deployable in place, you know. You,
    you
  • 25:41 - 25:43
    can have this in your lib folder. You can
  • 25:43 - 25:45
    actually start a gem now. And you can just
  • 25:45 - 25:48
    deploy it and it's, your main application
    is still
  • 25:48 - 25:51
    talking directly to this other database. But
    you're starting
  • 25:51 - 25:53
    to build out your client. And later, when
    you
  • 25:53 - 25:54
    have a service, you can replace it with a
  • 25:54 - 25:56
    different adapter.
  • 25:56 - 25:59
    So that adapter gives you back, when you,
    when
  • 25:59 - 26:03
    you call, like, a, you know, you get save.by_product
  • 26:03 - 26:05
    and you call all on it, that's actually, when
  • 26:05 - 26:11
    you call by_product, you're getting back a
    relation. And
  • 26:11 - 26:14
    this is something that we thought we didn't
    need,
  • 26:14 - 26:17
    but turns out ActiveRecord does this for very
    good
  • 26:17 - 26:21
    reason, and that's because threads and because
    state.
  • 26:21 - 26:23
    If you say I want this type of data
  • 26:23 - 26:26
    and you save it away to a variable, and
  • 26:26 - 26:29
    now you call some other method, order.by_this,
    and it
  • 26:29 - 26:31
    changes state, you might do something else
    on this
  • 26:31 - 26:34
    variable over here, not realizing that you've
    altered its
  • 26:34 - 26:37
    state later. So any time you make a change,
  • 26:37 - 26:38
    a state change on these objects, you really
    want
  • 26:38 - 26:40
    to get back a new instance. A different instance
  • 26:40 - 26:43
    with different state. And when you call, you
    know,
  • 26:43 - 26:46
    all, first, or pluck any of these things,
    what
  • 26:46 - 26:49
    you're really calling it on is your relation
    instance.
  • 26:49 - 26:52
    And the, the key thing that we learned is
  • 26:52 - 26:55
    that that relation is sharable between all
    of your
  • 26:55 - 26:57
    adapters. So the actual work done to get the
  • 26:57 - 27:01
    data is on your adapters. So the relation
    delegates
  • 27:01 - 27:03
    back.
  • 27:03 - 27:08
    So, in our database adapter, the thing actually
    getting
  • 27:08 - 27:12
    the data, is ActiveRecord. We've just moved
    our ActiveRecord
  • 27:12 - 27:14
    class into the library and hidden it from
    our
  • 27:14 - 27:18
    application. We, in this case, we were using
    ActiveRecord,
  • 27:18 - 27:21
    so you could just, we'd do ActiveRecord. If
    you
  • 27:21 - 27:24
    have another favorite database adapter, great.
  • 27:24 - 27:31
    So you call Save.by_product. You, you get
    an adapter
  • 27:31 - 27:35
    that, or so the, sorry, that calls through
    to
  • 27:35 - 27:38
    the adapter and gives you back relation. You
    call
  • 27:38 - 27:41
    Relation dot all and that just delegates back
    to
  • 27:41 - 27:45
    the adapter, which calls through to an ActiveRecord,
    gets
  • 27:45 - 27:48
    to your data, takes the attributes out of
    it
  • 27:48 - 27:50
    and gives you back an instance of, of your
  • 27:50 - 27:52
    core class. Because you're hiding ActiveRecord.
    You don't want
  • 27:52 - 27:55
    to get back an ActiveRecord class.
  • 27:55 - 27:57
    And I would say it's critical to deploy at
  • 27:57 - 28:00
    this steps, because you've made mistakes.
    I guarantee you've
  • 28:00 - 28:03
    made mistakes. And the cost of fixing this
    is
  • 28:03 - 28:06
    really low right now, as opposed to spending
    a
  • 28:06 - 28:08
    lot of time trying to design your server,
    how
  • 28:08 - 28:10
    that's going to interact, and realize, whoa,
    whoa, whoa,
  • 28:10 - 28:12
    whoa, we screwed up the client. All of this
  • 28:12 - 28:14
    work we've done on the service, we have to
  • 28:14 - 28:17
    through away because we did it wrong.
  • 28:17 - 28:21
    Now, you have a client. Now you need a
  • 28:21 - 28:25
    server. And it doesn't matter. What, whatever
    you want.
  • 28:25 - 28:27
    It's fine. It's actually the, the cost of
    writing
  • 28:27 - 28:31
    this is really, really low. Because the server
    is
  • 28:31 - 28:34
    the simplest part of this, and if you did
  • 28:34 - 28:36
    it wrong, if you chose the wrong transport
    method,
  • 28:36 - 28:39
    mechanism, you know what? You build a new
    adapter.
  • 28:39 - 28:41
    That's actually really quite easy.
  • 28:41 - 28:44
    So let me take a moment to just reiterate,
  • 28:44 - 28:47
    why should we have deployed by now? And I'd
  • 28:47 - 28:50
    say it's because the client is much, much
    more
  • 28:50 - 28:53
    complicated than the server, so your bugs
    are in
  • 28:53 - 28:55
    the client. Your bugs are not in the server
  • 28:55 - 28:58
    at this point. And the server is going to
  • 28:58 - 29:00
    be dictated by the choices you've made in
    the
  • 29:00 - 29:03
    client. So if you've made wrong choices and
    you
  • 29:03 - 29:07
    build your server, you've built the wrong
    server.
  • 29:07 - 29:10
    We used Sinatra and Oj, just cause it's awesome.
  • 29:10 - 29:12
    It just, it really just works. It's small
    and
  • 29:12 - 29:16
    it's useful. We thought we would need to move
  • 29:16 - 29:18
    away from HTTP, but we've grown a lot and
  • 29:18 - 29:19
    we haven't had to do this yet. It just
  • 29:19 - 29:22
    works. Things that we thought we would have
    to
  • 29:22 - 29:25
    change immediately, you know, it's almost
    a year later
  • 29:25 - 29:27
    and it's just.
  • 29:27 - 29:30
    OK, so now we use the service. And that's
  • 29:30 - 29:33
    really a feature flag. You just write a new
  • 29:33 - 29:37
    adapter that talks to the service instead
    of the
  • 29:37 - 29:40
    database. So now you call, you know, by_product,
    you
  • 29:40 - 29:43
    get a HTTP, it calls through to the HTTPAdapter
  • 29:43 - 29:45
    which gets you back the same time of relation.
  • 29:45 - 29:47
    When you call all on it, you know, it
  • 29:47 - 29:49
    calls adapter dot all, which now goes to an
  • 29:49 - 29:52
    HTTPClass that actually gets the JSON and
    takes the
  • 29:52 - 29:54
    attributes out of it and gives you back your
  • 29:54 - 29:57
    save class. You're getting back the same object
    you're
  • 29:57 - 29:59
    getting back as save.
  • 29:59 - 30:03
    So, retrospective. Great. We've isolated the
    data. We've isolated
  • 30:03 - 30:06
    the interface. We started to build our DSL.
    We've
  • 30:06 - 30:10
    pulled that DSL out into a gem. Now we've,
  • 30:10 - 30:11
    now that we actually kind of understand what
    that
  • 30:11 - 30:13
    gem needs to do, we can launch the service
  • 30:13 - 30:15
    and then just build a new adapter to switch
  • 30:15 - 30:16
    to this.
  • 30:16 - 30:19
    If, I would say that if we hadn't, if
  • 30:19 - 30:21
    we had realized that this was the order that
  • 30:21 - 30:22
    we needed to do it on, we, we would
  • 30:22 - 30:25
    have done this in two weeks. Instead. So that
  • 30:25 - 30:27
    first part of it was like a day worth
  • 30:27 - 30:31
    of work. That second part of it was like,
  • 30:31 - 30:34
    three hours worth of work. And deployed immediately.
  • 30:34 - 30:38
    The, the harder part was realizing that we
    needed
  • 30:38 - 30:40
    an adapter. And at this point, people, we
    didn't
  • 30:40 - 30:42
    really see anything about hexagonal architecture.
    This might have
  • 30:42 - 30:45
    been before some of those talks and papers
    have
  • 30:45 - 30:49
    been coming out. But, but it's actually really
    useful.
  • 30:49 - 30:53
    Tests. We, we use Sunspot for some of our
  • 30:53 - 30:55
    Solar things. And we're already used to spinning
    up
  • 30:55 - 30:59
    a Solar instance using a gem, trap-it-up.
    You know
  • 30:59 - 31:03
    you can do that for your integration tests.
    But
  • 31:03 - 31:05
    for unit tests, you know what, we have tests
  • 31:05 - 31:08
    around all of this. So we can have tests
  • 31:08 - 31:11
    around a fake adapter that proves that it
    behaves
  • 31:11 - 31:14
    the right way, and then that just saves, saves
  • 31:14 - 31:18
    data in, in memory, in your application.
  • 31:18 - 31:22
    And redundant tests, you know, you might say,
    eh,
  • 31:22 - 31:25
    do I really need this test? Yes. Because one
  • 31:25 - 31:27
    thing, you can delete your tests later that
    are
  • 31:27 - 31:30
    redundant, and you want to be really confident
    that,
  • 31:30 - 31:35
    that when you do switch over, it's gonna work.
  • 31:35 - 31:39
    Foreman and Subcontractor are, are really
    helpful for this
  • 31:39 - 31:42
    kind of thing. So subcontractor is a gem that
  • 31:42 - 31:46
    really says, for this service, change directory
    over here
  • 31:46 - 31:49
    and run this command in a completely isolated
    Bundler
  • 31:49 - 31:52
    environment. Cause you really don't want to
    mix your,
  • 31:52 - 31:55
    your dependencies. You don't want your server
    dependencies and
  • 31:55 - 31:58
    the versions to be conflicting with your main
    application
  • 31:58 - 32:00
    dependencies. You want to be able to, to change
  • 32:00 - 32:01
    those separately.
  • 32:01 - 32:04
    OK. So what about a new app? I'm spinning
  • 32:04 - 32:07
    up a completely new thing. Not extracting.
    Totally new.
  • 32:07 - 32:09
    How do I do that? How do I iterate
  • 32:09 - 32:12
    on something that doesn't exist yet? And I
    would
  • 32:12 - 32:14
    say that some of the lessons that, that we've
  • 32:14 - 32:16
    learned from this, and actually from just
    doing our
  • 32:16 - 32:20
    product development in general is iterate.
    Find a way
  • 32:20 - 32:23
    to get to the smallest deployable thing as
    quickly
  • 32:23 - 32:28
    as possible, and whatever tool you use to
    deploy,
  • 32:28 - 32:31
    to spin up infrastructure, one of the sort
    of
  • 32:31 - 32:35
    heuristics that, that, that we've found is
    really focus
  • 32:35 - 32:38
    on organizing that code around being able
    to change
  • 32:38 - 32:42
    things easily, and understand how this thing
    is different
  • 32:42 - 32:43
    from this thing.
  • 32:43 - 32:45
    You know, the Chef makes it really easy to
  • 32:45 - 32:49
    define a giant hash of global state over here
  • 32:49 - 32:51
    and then just run this thing over here and
  • 32:51 - 32:54
    it's magic and it'll just do it. When you
  • 32:54 - 32:56
    actually start to spin up different services,
    this thing
  • 32:56 - 32:59
    is gonna need to be slightly different than
    this
  • 32:59 - 33:03
    thing. So how can your code make that as
  • 33:03 - 33:06
    easily understandable as possible?
  • 33:06 - 33:10
    So feature flags, also, on or off. Do customers
  • 33:10 - 33:14
    see this, or they don't. But you know what?
  • 33:14 - 33:19
    Maybe it's just kind of half on. Maybe everything,
  • 33:19 - 33:23
    every request that's gonna actually call through
    this, use
  • 33:23 - 33:27
    Sidekiq to just every time, just spin off
    a
  • 33:27 - 33:30
    job to hammer your, your service. And if it
  • 33:30 - 33:33
    breaks, you've learned that before you've
    launched it to,
  • 33:33 - 33:35
    to your users. There's a lot of other ways
  • 33:35 - 33:37
    you can do this.
  • 33:37 - 33:39
    On to these five years users, and let's see
  • 33:39 - 33:42
    how we can break it, see how the interaction
  • 33:42 - 33:45
    feels. It's, it's really useful.
  • 33:45 - 33:48
    Also, one thing that we found is, it's often
  • 33:48 - 33:53
    helpful to inter, integrate very deeply before
    you go
  • 33:53 - 33:56
    widely. So, if you have a code-interaction
    that goes
  • 33:56 - 33:59
    through all this process, do it kind of once
  • 33:59 - 34:02
    through all the process, without worrying
    so much about
  • 34:02 - 34:05
    the edge cases or the errors, because those
    are,
  • 34:05 - 34:06
    you're gonna find those. Those are gonna,
    those are
  • 34:06 - 34:09
    gonna come up. But it's re- really useful
    to
  • 34:09 - 34:11
    kind of go all the way through the interaction
  • 34:11 - 34:13
    knowing that it's really kind of sketch and
    doesn't
  • 34:13 - 34:18
    do everything, and really let that drive the
    design.
  • 34:18 - 34:20
    And this is also a thing of like letting
  • 34:20 - 34:23
    the feature kind of drive the design and figuring
  • 34:23 - 34:25
    out, what is the pattern for how you really
  • 34:25 - 34:28
    need to organize the code, before you have.
    Don't
  • 34:28 - 34:30
    just like whiteboard everything and say this
    is gonna
  • 34:30 - 34:32
    be perfect. You know.
  • 34:32 - 34:35
    Production is going to destroy every single
    design that
  • 34:35 - 34:40
    you think you have. Also, if something seems
    clever,
  • 34:40 - 34:42
    it's bad. If you're like, eh, this is kind
  • 34:42 - 34:44
    of cool. No. No, no, no. It's bad. Complexity
  • 34:44 - 34:48
    is gonna come to you. Don't, don't seek it
  • 34:48 - 34:51
    out. It's, it's, it's evil.
  • 34:51 - 34:53
    So if there are any kind of take aways
  • 34:53 - 34:57
    from this, I would say you know, hexagonal
    architecture
  • 34:57 - 35:00
    is really cool, but you don't have to design
  • 35:00 - 35:03
    it from the start. If you have trust, if
  • 35:03 - 35:07
    everyone in the organization has trust that
    you can
  • 35:07 - 35:09
    do your job and that you're all going, working
  • 35:09 - 35:14
    together to build an awesome product, an awesome
    company,
  • 35:14 - 35:16
    you can fix this later. You can actually let
  • 35:16 - 35:21
    the needs of your product determine where
    your boundaries
  • 35:21 - 35:22
    are.
  • 35:22 - 35:27
    So, thank you. I actually have a few minutes
  • 35:27 - 35:30
    of, of questions, to answer questions.
Title:
RailsConf 2014 - An Iterative Approach to Service Oriented Architecture by Eric Saxby
Description:

more » « less
Duration:
35:58

English subtitles

Revisions