SlideShare a Scribd company logo
Heroku Postgres
                            The Tale of Conceiving and Building
                            a Leading Cloud Database Service




                                                        Harold Giménez
                                                        @hgmnz




                                              1

Saturday, September 8, 12
Heroku Postgres
               •
                   Database-as-a-service

               •
                   Cloud

               •
                   Fully managed

               •
                   Over 2 years in production

               •
                   From tiny blogs to superbowl commercials


                                             2

Saturday, September 8, 12

Heroku Postgres is a Database as a Service provider
We provision and run databases in cloud infrastructure
It is fully managed, always on and available
Has been in production for over 2 years, and has powered everything from a personal blog to
sites backing superbowl commercial sites.
Heroku origins



                                               3

Saturday, September 8, 12

Heroku is born with a vision of increasing developer productivity and agility.

Anyone remember heroku garden? While that product no longer exists, that vision remains
part of our core culture.

We want to enable developers to bring their creations to market as fast and pleasantly as
possible.
focus on rails



                                              4

Saturday, September 8, 12

heroku got in the business of running web applications. As with any startup, it focused on
doing one thing well, and for heroku that was running rails applications.

The approach empowered developers like never before. As a heroku customer, as I was back
then, I was excited to make hobby apps available on the internet on a regular basis. It was so
easy.
rails apps need a database



                                                5

Saturday, September 8, 12

Clearly, rails apps need a database. Rails got really good at doing CRUD, after all.
web apps need a database



                                          6

Saturday, September 8, 12

but this is true of any web application
thankfully postgres was chosen



                                            7

Saturday, September 8, 12

The story was something like

“Hey, we need a database. What should we use?”

Heroku was a very small team. The security expert happened to speak up and recommends
Postgres,
 for it’s correctness track record and fine grained user role management
otherwise I wouldn’t be here



                                              8

Saturday, September 8, 12

I’ve been a Postgres user for years and know it is vastly superior to other open source RDBMS
projects. If Postgres had not been chosen, I wouldn’t be here.
“let’s make a production grade
                      postgres service”



                                                9

Saturday, September 8, 12

Heroku would give you a free database whenever you create an app.

One database server would hold a bunch of users.

But this is not sufficient for serious production applications that require exclusive access to
more resources, and higher availability ops.
10

Saturday, September 8, 12

This is our team’s mascot. It is a slide from IBM used in marketing materials in the 70s.

It’s funny how this vision was not true back then, but we are making it a reality over 30 years
later.
(hopefully yours)



                                    11

Saturday, September 8, 12
Heroku Postgres v.0.pre.alpha

    •
        A sinatra app implementing the heroku addons API

         •
             create servers

         •
             install postgres service

         •
             create databases for users - a “Resource”

    •
        Sequel talks to postgres

    •
        stem talks to AWS
                                               12

Saturday, September 8, 12

Let’s talk about the tools used to build the very first version of Heroku Postgres.

It was built in Ruby.
Sinatra is used to expose and APIs.
Sequel is used to talk to postgres databases as well as as an ORM
stem was built for this project - a very minimalistic and pleasant interface to the AWS APIs.
stem was made available as open source software.
Two main entities



                                                  13

Saturday, September 8, 12

There are two main entities in this application
Resource
       {
                database:           ‘d4f9wdf02’,
                port:               5432,
                username:           ‘uf0wjasdf’,
                password:           ‘pf14fhjas’,
                created_at:         ‘2012-05-02’,
                state:              ‘available’
       }


                                             14

Saturday, September 8, 12

A resource encapsulates a database, the actual tangible resource that customers buy. A
customer only cares about the database URL, used to connect to it.
Server
        {
                 elastic_ip:                         ‘192.168.0.1’,
                 instance_id:                        ‘i-2efjoiads’,
                 ami:                                ‘pg-prod’,
                 availability_zone:                  ‘us-east-1’,
                 created_at:                         ‘2012-05-02’,
                 state:                              ‘booting’
        }


                                               15

Saturday, September 8, 12

A server is the physical box where the resource is installed.

Customers don’t have direct access to it. It’s for our own bookkeeping and maintenance.

It includes an IP address, availability zone, and other AWS related attributes.
...and a thin admin web interface



      erb templates in sinatra
      endpoint




                                              16

Saturday, September 8, 12

The early application also had an admin interface, right in the very same codebase as erb
templates within some sinatra HTTP endpoints.
We are just an add-on




                                             17

Saturday, September 8, 12

The Heroku Postgres offering is just an heroku addon.
18

Saturday, September 8, 12

There are numerous components to Heroku, one of which is the addons system.

Heroku Postgres is an addon just like any other third party is an addon (such as Papertrail or
Sendgrid). We don’t utilize any backdoors of any kind, and instead interface with the rest of
Heroku in the same way other addon providers do.

This is a great position to be in, because as consumers of the heroku addons echosystem, we
help drive its evolution.
we run on




                                              19

Saturday, September 8, 12

Furthermore, the entire Heroku Postgres infrastructure runs on Heroku itself.
the simplest thing
                            that could possibly work,
                                  but no less


                                                20

Saturday, September 8, 12

Simplicity is key to building any sort of system, and in this case, the initial version of the
Heroku Postgres management app was as simple as it could be.

This allows us to modify behavior and evolve as quickly as possible, on a smaller more
pleasant code base.
We’ve come a long way since then



                                            21

Saturday, September 8, 12

Fast forward a few years, and we are now managing a very large number of databases,
keeping them alive, and creating new ones at a higher rate than ever.

This requires more sophisticated processes and managers.

Let’s dive into how it works today
Monitoring and Workflow



                                            22

Saturday, September 8, 12

Monitoring and Workflow are key to this type of system.
draw inspiration from gaming




                                              23

Saturday, September 8, 12

In programming we often draw inspiration from a number of things.

A good example is OOP itself, which is inspired by the way messages are sent between
organisms in a biological ecosystem

The project lead (@pvh) has a background in gaming.

Imagine the bad guy in a Diablo game. He’s just wandering around doing nothing, because
there’s nothing to attack around him. At some point, he sees your character and charges
toward you. You battle the Diablo. He fights back, and finally you kill him. He dies a slow and
painful death.

There are many ways to model these kinds of systems. One can be an events based system,
where observers listen on events that are occurring and react to them appropriately. You
could also load all objects that need monitoring and process that queue. This either gets too
complex easily, or doesn’t scale at all because of memory constraints and size of the
workload.

A state machine is another good way to model this. A state machine is, at heart, an entity that
is fed some inputs, and in return it takes some action, and then may or may not transition to
a different state.

The bad guy is in a `wondering around` state when nothing is around it. But as soon as it
saw your character, it entered a `battle` state, and so on.

We model what happens in real life, which is that we observe our environment, register it, and
react to it.
class Resource
        def feel                          monitoring
          observations.create(
            Feeler.new(self).current_environment
          )
        end
      end

      class Feeler
        def current_environment
          {
            service_available?:                        service_available?,
            open_connections:                          open_connections,
            row_count:                                 row_count,
            table_count:                               table_count,
            seq_scans:                                 seq_scans,
            index_scans:                               index_scans
          }
        end
      end
                                                  24

Saturday, September 8, 12

This is what the actual source code looks like.

A Resource has a #feel method, which stores an observation based on what the Feeler sees.

A Feeler is an object that observes the current environment around it. It checks things like is
the service available, how many connections are open, and many more health checks.
class Resource
        include Stateful               workflow

        state :available do
          unless service_available?
            transition :unavailable
          end
        end
      end

      resource = Resource.new
      resource.transition :available
      resource.feel
      resource.tick
      puts resource.state
        # ‘unavailable’


                            25

Saturday, September 8, 12
module Stateful
         def self.included(base)                                      workflow
           base.extend ClassMethods
         end

              module ClassMethods
                def state(name, &block)
                  states[name] = block
                end
                def states; @states ||= {}; end
              end

              def tick
                self.instance_eval(
                  &self.class.states[self.state.to_sym]
                )
              end

         def transition(state)
           # log and assign new state
         end
       end
                                              26

Saturday, September 8, 12

In terms of workflow, we built an extremely simple state machine system.

It allows you to define states via the `state` method which takes an arbitrary block of code to
execute when invoked via the `#tick` method.
resource.feel
                            resource.tick


                              Need to do this all the time




                                                27

Saturday, September 8, 12

We first call #feel on an object, and then call #tick on it.

Feel stores new observed information, while #tick uses this information to make system
decisions, such as transitioning to other states, sending alerts, and much more.

We must run these two methods continuously
db1 db2 db3 db4 db5 db6 db7 db8 db9   ...   dbn




                            db1.feel
                            db1.tick




                                              28

Saturday, September 8, 12

One way to run it continously is via a work queue.
db2 db3 db4 db5 db6 db7 db8 db9                       ...   dbn db1




                            db2.feel                  enqueue(db1)
                            db2.tick




                                               29

Saturday, September 8, 12

We create a queue and place all active resources on it. A set or workers pull jobs from the
queue, invoke feel and tick, and then enqueue themselves again.

This is in escense a poorly implemented distributed ring buffer, and it’s served us well.
QueueClassic
                            http://github.com/ryandotsmith/queue_classic




                                                 30

Saturday, September 8, 12

Our queue is implemented on top of the QueueClassic gem, which is a queue system built in
Ruby on top of Postgres with some interesting characteristics.
31

Saturday, September 8, 12

Let’s look at some of the states on our resource class. A resource can go through these
states.

One very important aspect of this system is idempotency. The system must be designed in
such a way that each state can be run any number of times and without affecting the end
result.

Examples where this is not immediately obvious are the creating and deprovisioning state.
Durability and Availability



                                               32

Saturday, September 8, 12

Let’s talk about how we handle durability and availability of databases.
33

Saturday, September 8, 12

In Postgres, as in other similar systems, when you issue a write transaction, it firsts writes the
transaction to what’s called the Write-Ahead Log (WAL), and only then does it write to the
data files.

This ensures that all data committed to the system exists first in the WAL stream.
34

Saturday, September 8, 12

Of course, if the WAL stream is on the same physical disks as the data files, there’s a high
risk of data loss.

Many opt to place the wal segments on a separate disk than the data files. This is a great first
step (and one we also take).

But really, we don’t consider data to be durable until the WAL segments are replicated across
many data centers.

We ship WAL segments to multi-datacenter storage every 60 seconds. We use Wal-e, a
python WAL archiver written at Heroku and now available as open source.
35

Saturday, September 8, 12

Now that the WAL segments are out of the box, we can do many other tricks.

For example, creating a “follower” is as easy as fetching the WAL segments from the
distributed storage, and replaying these logs on a brand new server - once it has caught up,
we set up direct streaming replication between primary and follower.
36

Saturday, September 8, 12

Similary, a fork of a database sets pulls down the WAL segments from distributed storage and
replays them on a new server.

Once it’s caught up, instead of setting up streaming replication as in the follow case, instead
this new server starts producing WAL segments of it’s own (when write transactions occur on
it). So now the fork is set up to ship WAL segments to distributed storage, just like its leader.
Continuous Protection
    •
        Write-Ahead Log segments shipped to durable storage every
        60 seconds

    •
        We can replay these logs on a new server to recover your
        data

    •
        https://github.com/heroku/WAL-E




                                              37

Saturday, September 8, 12

This is what we call Continuous Protection.

Having WAL segments always available is a primary concern of ours, as it allows us to easily
rebuild a server’s data state, and can be updated continuously as opposed to capturing full
backups of the system.
Need a more flexible object model



                                              38

Saturday, September 8, 12

Now, the introduction of all of these functions required us to rethink our object model.
timeline
                                             39

Saturday, September 8, 12

We have the concept of a timeline

A timeline at time = zero contains no data, no commits.
participant
                                                40

Saturday, September 8, 12

Participants are attached to a timeline. Participants can write data to the timeline.
41

Saturday, September 8, 12

Writing data to the timeline moves the timeline forward in time.
42

Saturday, September 8, 12
resource
                                              43

Saturday, September 8, 12

A resource is what our users get. It maps to a URL. A resource is attached to one participant.
follower44

Saturday, September 8, 12

This allows us to model followers easily.

A follower is just a participant on the same timeline as its reader.

The difference is that followers can’t write to the same timeline. Only one participant can
write to the timeline, the follower’s leader (or primary).
fork
                                             45

Saturday, September 8, 12

When we fork a database, it creates its own timeline. The new timeline now has drifted away
from it’s parent, and can be writable. So it will create it’s own path.
disaster
                                               46

Saturday, September 8, 12

Finally, this system can be used during the event of catastrophic hardware failure.

When a database’s hardware fails completely, instead of trying to recover the server itself, it’s
best to create a new node and “STONITH” (http://en.wikipedia.org/wiki/STONITH)
47

Saturday, September 8, 12

What we do is create a new participant, hidden from the user.
recovery48

Saturday, September 8, 12

And once it is caught up and ready to go, we tie the resource to it.

So, the user only sees a blip in availability, but behind the scenes they are actually sitting on
entirely new hardware, like magic.
big project



                                              49

Saturday, September 8, 12

Needless to say, this has become a big project over time.
lots of moving parts



                                     50

Saturday, September 8, 12
long test suite



                                   51

Saturday, September 8, 12
modularize and build APIs



                                              52

Saturday, September 8, 12

So it’s time to spread out responsabilities by modularizing the system and building APIs that
are used for them to talk to each other.
53

Saturday, September 8, 12

What we’ve built is a constellation of heroku apps. We may split this even further in the
future.
gain in agility



                                              54

Saturday, September 8, 12

This gains un in agility.

The test suites of each individual project is much smaller now, which improves our ability to
develop quicker.

It also means that each component can be deployed individually. For example, a deploy to the
admin front end UI has no effect on the main system’s APIs.
composable services



                                                55

Saturday, September 8, 12

It also allows us to build better abstractions at the systematic level, which gains us in the
ability to compose services better.

For example, a system that provisions and manages servers from our infrastructure provider
can be used by many other consumers, not only heroku postgres.
independently scalable



                                              56

Saturday, September 8, 12

They can furthermore be scaled individually. Some parts of the system require different loads
and response times than others, so now we are able to easily and clearly tweak our system
operations based on clearly decoupled subsystems.
Logging and Metrics



                                                   57

Saturday, September 8, 12

Finally, I’d like to talk about visibility into our app.
log generation



                                   58

Saturday, September 8, 12

First, let’s talk about logging.
59

Saturday, September 8, 12

In Heroku, there’s a service called Logplex (it’s open source).

Your application is able to send logs to the logplex service to a specific channel (it uses
Capability Based Security).

Then, one or more consumers can “drain” the logs for that channel.
logs are event streams



                                      60

Saturday, September 8, 12
how should you log?



                                               61

Saturday, September 8, 12

Having this logging infrastructure available, let’s talk about how to make best use of it.
post “/work” do
        puts “starting to do work”
        worker = Worker.new(params)
        begin
          worker.lift_things_up
          worker.put_them_down
        rescue WorkerError => e
          puts “Fail :( #{e.message}”
          status 500
        end
        puts “done doing work”
        status 200
      end



                                          62

Saturday, September 8, 12

This is an example of terrible logging.
$ heroku logs --tail

      2012-07-28T02:43:35 [web.4] starting to do
      work
      2012-07-28T02:43:35 [web.4] Fail :(
      invalid worker, nothing to do
      2012-07-28T02:43:35 heroku[router] POST
      myapp.com/work dyno=web.4 queue=0 wait=0ms
      service=14ms status=500 bytes=643




                                               63

Saturday, September 8, 12

There’s no structure to these logs, so it can’t be easily read and interpreted by a computer.
bad logging
    •
        What exactly happened?

    •
        When did it happen?

    •
        How long did it take?

    •
        How many times has it happened?




                                     64

Saturday, September 8, 12
good logging
    •
        parseable

    •
        consistent

    •
        plentiful




                                 65

Saturday, September 8, 12
post “/work” do
        log(create_work: true, request_id: uuid) do
        worker = Worker.new(params.merge(uuid: uuid))
          begin
            worker.lift_things_up
            worker.put_them_down
          rescue WorkerError => e
            log_exception(e, create_work: true)
          end
        end
      end

      helpers do
        def uuid
          @uuid ||= SecureRandom.uuid
        end
      end

                                                66

Saturday, September 8, 12

Instead, let’s do some more structured logging.

Also note how every request gets a UUID. This is critical to tying up all the logs for a given
request.
require ‘scrolls’
      module App
        module Logs
          extend self

                  def log(data, &block)
                    Scrolls.log(with_env(data), &block)
                  end

                  def log_exception(exception, data, &block)
                    Scrolls.log_exception(with_env(data), &block)
                  end

          def with_env(hash)
            { environment: ENV[‘RACK_ENV’] }.merge(data)
          end
        end
      end

                                              67

Saturday, September 8, 12

On the prior slide, we saw the `log` and `log_exception` methods.

This is a small module that provides those methods. It is a wrapper for the `scrolls` (open
source) gem.

Scrolls provides a framework for structured logging.
This module merely adds our environment name to the logs, which is useful for parsing later.
$ heroku logs --tail
      2012-07-28T02:43:35 [web.4] create_work
      request_id=afe2-f0d at=start
      2012-07-28T02:43:35 [web.4] create_work
      request_id=afe2-f0d at=exception
      message=invalid worker, nothing to do
      2012-07-28T02:43:35 [web.4] create_work
      request_id=afe2-f0d at=finish elapsed=53
      2012-07-28T02:43:35 heroku[router] POST
      myapp.com/work dyno=web.4 queue=0 wait=0ms
      service=14ms status=500 bytes=643




                                                    68

Saturday, September 8, 12
Now our logs look like this.

Easy to parse, and still easy to read by a human.
log consumption



                                             69

Saturday, September 8, 12

Let’s talk about consuming those logs, which should make it clear why structured logging is
so important.
(this is the fun part)



                                      70

Saturday, September 8, 12
71

Saturday, September 8, 12

As mentioned before, it’s possible to set up multiple log drains.

The heroku toolbelt has a utility to print out logs to your terminal (accessible via heroku logs
--tail).
But why stop there? You can have as many drains as you want!

We can set up a drain that stores data locally for further analysis and metrics generation.
Here, a postgres database is set up and logs stored to it on the key-value data type called
hstore.
select * from events;




                            72

Saturday, September 8, 12
73

Saturday, September 8, 12

Now that we have stored data on a postgres database, we can use SQL to query it and
generate some metrics.

We have a process that continuously queries this database and sends aggregated results to a
metrics collection service (third party).
good logging


                                        metrics


                                            alerts
                                               74

Saturday, September 8, 12

Visibility into your system starts with good logging

Great logs enable easy metrics collection

Metrics lead to system alerts.
current tooling
    •
        still using sequel and sinatra

    •
        fog displaced stem

    •
        backbone.js for web UIs

    •
        fernet for auth tokens, valcro for validations

    •
        python, go and bash in some subsystems


                                             75

Saturday, September 8, 12

So to wrap up, our current tooling includes these pieces of technology
lessons
    •
        managing databases is hard

    •
        start simple

    •
        extract (and share) reusable code

    •
        separate concerns into services

    •
        learn to love your event stream


                                     76

Saturday, September 8, 12
thanks!


                                      @hgmnz
                                      @herokupostgres



                               77

Saturday, September 8, 12

More Related Content

Similar to [B6]heroku postgres-hgmnz

Cloud Camp Chicago Dec 2012 Slides
Cloud Camp Chicago Dec 2012 SlidesCloud Camp Chicago Dec 2012 Slides
Cloud Camp Chicago Dec 2012 Slides
Ryan Koop
 
Cloud Camp Chicago Dec 2012 - All presentations
Cloud Camp Chicago Dec 2012 - All presentationsCloud Camp Chicago Dec 2012 - All presentations
Cloud Camp Chicago Dec 2012 - All presentations
CloudCamp Chicago
 
Getting Started with Splunk Breakout Session
Getting Started with Splunk Breakout SessionGetting Started with Splunk Breakout Session
Getting Started with Splunk Breakout Session
Splunk
 
Zenko @Cloud Native Foundation London Meetup March 6th 2018
Zenko @Cloud Native Foundation London Meetup March 6th 2018Zenko @Cloud Native Foundation London Meetup March 6th 2018
Zenko @Cloud Native Foundation London Meetup March 6th 2018
Laure Vergeron
 
Treasure Data Cloud Strategy
Treasure Data Cloud StrategyTreasure Data Cloud Strategy
Treasure Data Cloud Strategy
Treasure Data, Inc.
 
Backbone using Extensible Database APIs over HTTP
Backbone using Extensible Database APIs over HTTPBackbone using Extensible Database APIs over HTTP
Backbone using Extensible Database APIs over HTTP
Max Neunhöffer
 
Big data hadoop
Big data hadoopBig data hadoop
Big data hadoop
Agnieszka Zdebiak
 
Detailed presentation on big data hadoop +Hadoop Project Near Duplicate Detec...
Detailed presentation on big data hadoop +Hadoop Project Near Duplicate Detec...Detailed presentation on big data hadoop +Hadoop Project Near Duplicate Detec...
Detailed presentation on big data hadoop +Hadoop Project Near Duplicate Detec...
Ashok Royal
 
Apache Arrow - An Overview
Apache Arrow - An OverviewApache Arrow - An Overview
Apache Arrow - An Overview
Dremio Corporation
 
Joshfire Factory: Building Apps for Billion of Devices
Joshfire Factory: Building Apps for Billion of DevicesJoshfire Factory: Building Apps for Billion of Devices
Joshfire Factory: Building Apps for Billion of Devices
Francois Daoust
 
Continuous Deployment @ AWS Re:Invent
Continuous Deployment @ AWS Re:InventContinuous Deployment @ AWS Re:Invent
Continuous Deployment @ AWS Re:Invent
John Schneider
 
Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...
Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...
Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...
Amazon Web Services
 
Deploying deep learning models with Docker and Kubernetes
Deploying deep learning models with Docker and KubernetesDeploying deep learning models with Docker and Kubernetes
Deploying deep learning models with Docker and Kubernetes
PetteriTeikariPhD
 
Zenko & MetalK8s @ Dublin Docker Meetup, June 2018
Zenko & MetalK8s @ Dublin Docker Meetup, June 2018Zenko & MetalK8s @ Dublin Docker Meetup, June 2018
Zenko & MetalK8s @ Dublin Docker Meetup, June 2018
Laure Vergeron
 
Infrastructure as Code with Chef / Puppet
Infrastructure as Code with Chef / PuppetInfrastructure as Code with Chef / Puppet
Infrastructure as Code with Chef / Puppet
Edmund Siegfried Haselwanter
 
Introduction to NoSQL with Couchbase
Introduction to NoSQL with CouchbaseIntroduction to NoSQL with Couchbase
Introduction to NoSQL with Couchbase
Tugdual Grall
 
Standard Issue: Preparing for the Future of Data Management
Standard Issue: Preparing for the Future of Data ManagementStandard Issue: Preparing for the Future of Data Management
Standard Issue: Preparing for the Future of Data Management
Inside Analysis
 
Cloud foundry and openstackcloud
Cloud foundry and openstackcloudCloud foundry and openstackcloud
Cloud foundry and openstackcloud
Francisco Gonçalves
 
Cloud Foundry, the Open Platform as a Service - Oscon - July 2012
Cloud Foundry, the Open Platform as a Service - Oscon - July 2012Cloud Foundry, the Open Platform as a Service - Oscon - July 2012
Cloud Foundry, the Open Platform as a Service - Oscon - July 2012
Patrick Chanezon
 
Cloudcamp Athens 2011 Presenting Heroku
Cloudcamp Athens 2011 Presenting HerokuCloudcamp Athens 2011 Presenting Heroku
Cloudcamp Athens 2011 Presenting Heroku
Savvas Georgiou
 

Similar to [B6]heroku postgres-hgmnz (20)

Cloud Camp Chicago Dec 2012 Slides
Cloud Camp Chicago Dec 2012 SlidesCloud Camp Chicago Dec 2012 Slides
Cloud Camp Chicago Dec 2012 Slides
 
Cloud Camp Chicago Dec 2012 - All presentations
Cloud Camp Chicago Dec 2012 - All presentationsCloud Camp Chicago Dec 2012 - All presentations
Cloud Camp Chicago Dec 2012 - All presentations
 
Getting Started with Splunk Breakout Session
Getting Started with Splunk Breakout SessionGetting Started with Splunk Breakout Session
Getting Started with Splunk Breakout Session
 
Zenko @Cloud Native Foundation London Meetup March 6th 2018
Zenko @Cloud Native Foundation London Meetup March 6th 2018Zenko @Cloud Native Foundation London Meetup March 6th 2018
Zenko @Cloud Native Foundation London Meetup March 6th 2018
 
Treasure Data Cloud Strategy
Treasure Data Cloud StrategyTreasure Data Cloud Strategy
Treasure Data Cloud Strategy
 
Backbone using Extensible Database APIs over HTTP
Backbone using Extensible Database APIs over HTTPBackbone using Extensible Database APIs over HTTP
Backbone using Extensible Database APIs over HTTP
 
Big data hadoop
Big data hadoopBig data hadoop
Big data hadoop
 
Detailed presentation on big data hadoop +Hadoop Project Near Duplicate Detec...
Detailed presentation on big data hadoop +Hadoop Project Near Duplicate Detec...Detailed presentation on big data hadoop +Hadoop Project Near Duplicate Detec...
Detailed presentation on big data hadoop +Hadoop Project Near Duplicate Detec...
 
Apache Arrow - An Overview
Apache Arrow - An OverviewApache Arrow - An Overview
Apache Arrow - An Overview
 
Joshfire Factory: Building Apps for Billion of Devices
Joshfire Factory: Building Apps for Billion of DevicesJoshfire Factory: Building Apps for Billion of Devices
Joshfire Factory: Building Apps for Billion of Devices
 
Continuous Deployment @ AWS Re:Invent
Continuous Deployment @ AWS Re:InventContinuous Deployment @ AWS Re:Invent
Continuous Deployment @ AWS Re:Invent
 
Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...
Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...
Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...
 
Deploying deep learning models with Docker and Kubernetes
Deploying deep learning models with Docker and KubernetesDeploying deep learning models with Docker and Kubernetes
Deploying deep learning models with Docker and Kubernetes
 
Zenko & MetalK8s @ Dublin Docker Meetup, June 2018
Zenko & MetalK8s @ Dublin Docker Meetup, June 2018Zenko & MetalK8s @ Dublin Docker Meetup, June 2018
Zenko & MetalK8s @ Dublin Docker Meetup, June 2018
 
Infrastructure as Code with Chef / Puppet
Infrastructure as Code with Chef / PuppetInfrastructure as Code with Chef / Puppet
Infrastructure as Code with Chef / Puppet
 
Introduction to NoSQL with Couchbase
Introduction to NoSQL with CouchbaseIntroduction to NoSQL with Couchbase
Introduction to NoSQL with Couchbase
 
Standard Issue: Preparing for the Future of Data Management
Standard Issue: Preparing for the Future of Data ManagementStandard Issue: Preparing for the Future of Data Management
Standard Issue: Preparing for the Future of Data Management
 
Cloud foundry and openstackcloud
Cloud foundry and openstackcloudCloud foundry and openstackcloud
Cloud foundry and openstackcloud
 
Cloud Foundry, the Open Platform as a Service - Oscon - July 2012
Cloud Foundry, the Open Platform as a Service - Oscon - July 2012Cloud Foundry, the Open Platform as a Service - Oscon - July 2012
Cloud Foundry, the Open Platform as a Service - Oscon - July 2012
 
Cloudcamp Athens 2011 Presenting Heroku
Cloudcamp Athens 2011 Presenting HerokuCloudcamp Athens 2011 Presenting Heroku
Cloudcamp Athens 2011 Presenting Heroku
 

More from NAVER D2

[211] 인공지능이 인공지능 챗봇을 만든다
[211] 인공지능이 인공지능 챗봇을 만든다[211] 인공지능이 인공지능 챗봇을 만든다
[211] 인공지능이 인공지능 챗봇을 만든다
NAVER D2
 
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...
NAVER D2
 
[215] Druid로 쉽고 빠르게 데이터 분석하기
[215] Druid로 쉽고 빠르게 데이터 분석하기[215] Druid로 쉽고 빠르게 데이터 분석하기
[215] Druid로 쉽고 빠르게 데이터 분석하기
NAVER D2
 
[245]Papago Internals: 모델분석과 응용기술 개발
[245]Papago Internals: 모델분석과 응용기술 개발[245]Papago Internals: 모델분석과 응용기술 개발
[245]Papago Internals: 모델분석과 응용기술 개발
NAVER D2
 
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈
NAVER D2
 
[235]Wikipedia-scale Q&A
[235]Wikipedia-scale Q&A[235]Wikipedia-scale Q&A
[235]Wikipedia-scale Q&A
NAVER D2
 
[244]로봇이 현실 세계에 대해 학습하도록 만들기
[244]로봇이 현실 세계에 대해 학습하도록 만들기[244]로봇이 현실 세계에 대해 학습하도록 만들기
[244]로봇이 현실 세계에 대해 학습하도록 만들기
NAVER D2
 
[243] Deep Learning to help student’s Deep Learning
[243] Deep Learning to help student’s Deep Learning[243] Deep Learning to help student’s Deep Learning
[243] Deep Learning to help student’s Deep Learning
NAVER D2
 
[234]Fast & Accurate Data Annotation Pipeline for AI applications
[234]Fast & Accurate Data Annotation Pipeline for AI applications[234]Fast & Accurate Data Annotation Pipeline for AI applications
[234]Fast & Accurate Data Annotation Pipeline for AI applications
NAVER D2
 
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load BalancingOld version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
NAVER D2
 
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지
NAVER D2
 
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
NAVER D2
 
[224]네이버 검색과 개인화
[224]네이버 검색과 개인화[224]네이버 검색과 개인화
[224]네이버 검색과 개인화
NAVER D2
 
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)
NAVER D2
 
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기
NAVER D2
 
[213] Fashion Visual Search
[213] Fashion Visual Search[213] Fashion Visual Search
[213] Fashion Visual Search
NAVER D2
 
[232] TensorRT를 활용한 딥러닝 Inference 최적화
[232] TensorRT를 활용한 딥러닝 Inference 최적화[232] TensorRT를 활용한 딥러닝 Inference 최적화
[232] TensorRT를 활용한 딥러닝 Inference 최적화
NAVER D2
 
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지
NAVER D2
 
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터
NAVER D2
 
[223]기계독해 QA: 검색인가, NLP인가?
[223]기계독해 QA: 검색인가, NLP인가?[223]기계독해 QA: 검색인가, NLP인가?
[223]기계독해 QA: 검색인가, NLP인가?
NAVER D2
 

More from NAVER D2 (20)

[211] 인공지능이 인공지능 챗봇을 만든다
[211] 인공지능이 인공지능 챗봇을 만든다[211] 인공지능이 인공지능 챗봇을 만든다
[211] 인공지능이 인공지능 챗봇을 만든다
 
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...
 
[215] Druid로 쉽고 빠르게 데이터 분석하기
[215] Druid로 쉽고 빠르게 데이터 분석하기[215] Druid로 쉽고 빠르게 데이터 분석하기
[215] Druid로 쉽고 빠르게 데이터 분석하기
 
[245]Papago Internals: 모델분석과 응용기술 개발
[245]Papago Internals: 모델분석과 응용기술 개발[245]Papago Internals: 모델분석과 응용기술 개발
[245]Papago Internals: 모델분석과 응용기술 개발
 
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈
 
[235]Wikipedia-scale Q&A
[235]Wikipedia-scale Q&A[235]Wikipedia-scale Q&A
[235]Wikipedia-scale Q&A
 
[244]로봇이 현실 세계에 대해 학습하도록 만들기
[244]로봇이 현실 세계에 대해 학습하도록 만들기[244]로봇이 현실 세계에 대해 학습하도록 만들기
[244]로봇이 현실 세계에 대해 학습하도록 만들기
 
[243] Deep Learning to help student’s Deep Learning
[243] Deep Learning to help student’s Deep Learning[243] Deep Learning to help student’s Deep Learning
[243] Deep Learning to help student’s Deep Learning
 
[234]Fast & Accurate Data Annotation Pipeline for AI applications
[234]Fast & Accurate Data Annotation Pipeline for AI applications[234]Fast & Accurate Data Annotation Pipeline for AI applications
[234]Fast & Accurate Data Annotation Pipeline for AI applications
 
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load BalancingOld version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
 
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지
 
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
 
[224]네이버 검색과 개인화
[224]네이버 검색과 개인화[224]네이버 검색과 개인화
[224]네이버 검색과 개인화
 
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)
 
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기
 
[213] Fashion Visual Search
[213] Fashion Visual Search[213] Fashion Visual Search
[213] Fashion Visual Search
 
[232] TensorRT를 활용한 딥러닝 Inference 최적화
[232] TensorRT를 활용한 딥러닝 Inference 최적화[232] TensorRT를 활용한 딥러닝 Inference 최적화
[232] TensorRT를 활용한 딥러닝 Inference 최적화
 
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지
 
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터
 
[223]기계독해 QA: 검색인가, NLP인가?
[223]기계독해 QA: 검색인가, NLP인가?[223]기계독해 QA: 검색인가, NLP인가?
[223]기계독해 QA: 검색인가, NLP인가?
 

Recently uploaded

Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
Mark Billinghurst
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
shanthidl1
 
Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence
rajancomputerfbd
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
Stephanie Beckett
 
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges
huseindihon
 
Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers
Awais Yaseen
 
Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetryObservability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry
Eric D. Schabell
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
Kief Morris
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Bert Blevins
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
ScyllaDB
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
ArgaBisma
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
BookNet Canada
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
Safe Software
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
welrejdoall
 
The Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU CampusesThe Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU Campuses
Larry Smarr
 
How RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptxHow RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptx
SynapseIndia
 
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
RaminGhanbari2
 
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Erasmo Purificato
 
20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf
Sally Laouacheria
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc
 

Recently uploaded (20)

Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
 
Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
 
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges
 
Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers
 
Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetryObservability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
 
The Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU CampusesThe Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU Campuses
 
How RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptxHow RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptx
 
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
 
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
 
20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
 

[B6]heroku postgres-hgmnz

  • 1. Heroku Postgres The Tale of Conceiving and Building a Leading Cloud Database Service Harold Giménez @hgmnz 1 Saturday, September 8, 12
  • 2. Heroku Postgres • Database-as-a-service • Cloud • Fully managed • Over 2 years in production • From tiny blogs to superbowl commercials 2 Saturday, September 8, 12 Heroku Postgres is a Database as a Service provider We provision and run databases in cloud infrastructure It is fully managed, always on and available Has been in production for over 2 years, and has powered everything from a personal blog to sites backing superbowl commercial sites.
  • 3. Heroku origins 3 Saturday, September 8, 12 Heroku is born with a vision of increasing developer productivity and agility. Anyone remember heroku garden? While that product no longer exists, that vision remains part of our core culture. We want to enable developers to bring their creations to market as fast and pleasantly as possible.
  • 4. focus on rails 4 Saturday, September 8, 12 heroku got in the business of running web applications. As with any startup, it focused on doing one thing well, and for heroku that was running rails applications. The approach empowered developers like never before. As a heroku customer, as I was back then, I was excited to make hobby apps available on the internet on a regular basis. It was so easy.
  • 5. rails apps need a database 5 Saturday, September 8, 12 Clearly, rails apps need a database. Rails got really good at doing CRUD, after all.
  • 6. web apps need a database 6 Saturday, September 8, 12 but this is true of any web application
  • 7. thankfully postgres was chosen 7 Saturday, September 8, 12 The story was something like “Hey, we need a database. What should we use?” Heroku was a very small team. The security expert happened to speak up and recommends Postgres, for it’s correctness track record and fine grained user role management
  • 8. otherwise I wouldn’t be here 8 Saturday, September 8, 12 I’ve been a Postgres user for years and know it is vastly superior to other open source RDBMS projects. If Postgres had not been chosen, I wouldn’t be here.
  • 9. “let’s make a production grade postgres service” 9 Saturday, September 8, 12 Heroku would give you a free database whenever you create an app. One database server would hold a bunch of users. But this is not sufficient for serious production applications that require exclusive access to more resources, and higher availability ops.
  • 10. 10 Saturday, September 8, 12 This is our team’s mascot. It is a slide from IBM used in marketing materials in the 70s. It’s funny how this vision was not true back then, but we are making it a reality over 30 years later.
  • 11. (hopefully yours) 11 Saturday, September 8, 12
  • 12. Heroku Postgres v.0.pre.alpha • A sinatra app implementing the heroku addons API • create servers • install postgres service • create databases for users - a “Resource” • Sequel talks to postgres • stem talks to AWS 12 Saturday, September 8, 12 Let’s talk about the tools used to build the very first version of Heroku Postgres. It was built in Ruby. Sinatra is used to expose and APIs. Sequel is used to talk to postgres databases as well as as an ORM stem was built for this project - a very minimalistic and pleasant interface to the AWS APIs. stem was made available as open source software.
  • 13. Two main entities 13 Saturday, September 8, 12 There are two main entities in this application
  • 14. Resource { database: ‘d4f9wdf02’, port: 5432, username: ‘uf0wjasdf’, password: ‘pf14fhjas’, created_at: ‘2012-05-02’, state: ‘available’ } 14 Saturday, September 8, 12 A resource encapsulates a database, the actual tangible resource that customers buy. A customer only cares about the database URL, used to connect to it.
  • 15. Server { elastic_ip: ‘192.168.0.1’, instance_id: ‘i-2efjoiads’, ami: ‘pg-prod’, availability_zone: ‘us-east-1’, created_at: ‘2012-05-02’, state: ‘booting’ } 15 Saturday, September 8, 12 A server is the physical box where the resource is installed. Customers don’t have direct access to it. It’s for our own bookkeeping and maintenance. It includes an IP address, availability zone, and other AWS related attributes.
  • 16. ...and a thin admin web interface erb templates in sinatra endpoint 16 Saturday, September 8, 12 The early application also had an admin interface, right in the very same codebase as erb templates within some sinatra HTTP endpoints.
  • 17. We are just an add-on 17 Saturday, September 8, 12 The Heroku Postgres offering is just an heroku addon.
  • 18. 18 Saturday, September 8, 12 There are numerous components to Heroku, one of which is the addons system. Heroku Postgres is an addon just like any other third party is an addon (such as Papertrail or Sendgrid). We don’t utilize any backdoors of any kind, and instead interface with the rest of Heroku in the same way other addon providers do. This is a great position to be in, because as consumers of the heroku addons echosystem, we help drive its evolution.
  • 19. we run on 19 Saturday, September 8, 12 Furthermore, the entire Heroku Postgres infrastructure runs on Heroku itself.
  • 20. the simplest thing that could possibly work, but no less 20 Saturday, September 8, 12 Simplicity is key to building any sort of system, and in this case, the initial version of the Heroku Postgres management app was as simple as it could be. This allows us to modify behavior and evolve as quickly as possible, on a smaller more pleasant code base.
  • 21. We’ve come a long way since then 21 Saturday, September 8, 12 Fast forward a few years, and we are now managing a very large number of databases, keeping them alive, and creating new ones at a higher rate than ever. This requires more sophisticated processes and managers. Let’s dive into how it works today
  • 22. Monitoring and Workflow 22 Saturday, September 8, 12 Monitoring and Workflow are key to this type of system.
  • 23. draw inspiration from gaming 23 Saturday, September 8, 12 In programming we often draw inspiration from a number of things. A good example is OOP itself, which is inspired by the way messages are sent between organisms in a biological ecosystem The project lead (@pvh) has a background in gaming. Imagine the bad guy in a Diablo game. He’s just wandering around doing nothing, because there’s nothing to attack around him. At some point, he sees your character and charges toward you. You battle the Diablo. He fights back, and finally you kill him. He dies a slow and painful death. There are many ways to model these kinds of systems. One can be an events based system, where observers listen on events that are occurring and react to them appropriately. You could also load all objects that need monitoring and process that queue. This either gets too complex easily, or doesn’t scale at all because of memory constraints and size of the workload. A state machine is another good way to model this. A state machine is, at heart, an entity that is fed some inputs, and in return it takes some action, and then may or may not transition to a different state. The bad guy is in a `wondering around` state when nothing is around it. But as soon as it saw your character, it entered a `battle` state, and so on. We model what happens in real life, which is that we observe our environment, register it, and react to it.
  • 24. class Resource def feel monitoring observations.create( Feeler.new(self).current_environment ) end end class Feeler def current_environment { service_available?: service_available?, open_connections: open_connections, row_count: row_count, table_count: table_count, seq_scans: seq_scans, index_scans: index_scans } end end 24 Saturday, September 8, 12 This is what the actual source code looks like. A Resource has a #feel method, which stores an observation based on what the Feeler sees. A Feeler is an object that observes the current environment around it. It checks things like is the service available, how many connections are open, and many more health checks.
  • 25. class Resource include Stateful workflow state :available do unless service_available? transition :unavailable end end end resource = Resource.new resource.transition :available resource.feel resource.tick puts resource.state # ‘unavailable’ 25 Saturday, September 8, 12
  • 26. module Stateful def self.included(base) workflow base.extend ClassMethods end module ClassMethods def state(name, &block) states[name] = block end def states; @states ||= {}; end end def tick self.instance_eval( &self.class.states[self.state.to_sym] ) end def transition(state) # log and assign new state end end 26 Saturday, September 8, 12 In terms of workflow, we built an extremely simple state machine system. It allows you to define states via the `state` method which takes an arbitrary block of code to execute when invoked via the `#tick` method.
  • 27. resource.feel resource.tick Need to do this all the time 27 Saturday, September 8, 12 We first call #feel on an object, and then call #tick on it. Feel stores new observed information, while #tick uses this information to make system decisions, such as transitioning to other states, sending alerts, and much more. We must run these two methods continuously
  • 28. db1 db2 db3 db4 db5 db6 db7 db8 db9 ... dbn db1.feel db1.tick 28 Saturday, September 8, 12 One way to run it continously is via a work queue.
  • 29. db2 db3 db4 db5 db6 db7 db8 db9 ... dbn db1 db2.feel enqueue(db1) db2.tick 29 Saturday, September 8, 12 We create a queue and place all active resources on it. A set or workers pull jobs from the queue, invoke feel and tick, and then enqueue themselves again. This is in escense a poorly implemented distributed ring buffer, and it’s served us well.
  • 30. QueueClassic http://github.com/ryandotsmith/queue_classic 30 Saturday, September 8, 12 Our queue is implemented on top of the QueueClassic gem, which is a queue system built in Ruby on top of Postgres with some interesting characteristics.
  • 31. 31 Saturday, September 8, 12 Let’s look at some of the states on our resource class. A resource can go through these states. One very important aspect of this system is idempotency. The system must be designed in such a way that each state can be run any number of times and without affecting the end result. Examples where this is not immediately obvious are the creating and deprovisioning state.
  • 32. Durability and Availability 32 Saturday, September 8, 12 Let’s talk about how we handle durability and availability of databases.
  • 33. 33 Saturday, September 8, 12 In Postgres, as in other similar systems, when you issue a write transaction, it firsts writes the transaction to what’s called the Write-Ahead Log (WAL), and only then does it write to the data files. This ensures that all data committed to the system exists first in the WAL stream.
  • 34. 34 Saturday, September 8, 12 Of course, if the WAL stream is on the same physical disks as the data files, there’s a high risk of data loss. Many opt to place the wal segments on a separate disk than the data files. This is a great first step (and one we also take). But really, we don’t consider data to be durable until the WAL segments are replicated across many data centers. We ship WAL segments to multi-datacenter storage every 60 seconds. We use Wal-e, a python WAL archiver written at Heroku and now available as open source.
  • 35. 35 Saturday, September 8, 12 Now that the WAL segments are out of the box, we can do many other tricks. For example, creating a “follower” is as easy as fetching the WAL segments from the distributed storage, and replaying these logs on a brand new server - once it has caught up, we set up direct streaming replication between primary and follower.
  • 36. 36 Saturday, September 8, 12 Similary, a fork of a database sets pulls down the WAL segments from distributed storage and replays them on a new server. Once it’s caught up, instead of setting up streaming replication as in the follow case, instead this new server starts producing WAL segments of it’s own (when write transactions occur on it). So now the fork is set up to ship WAL segments to distributed storage, just like its leader.
  • 37. Continuous Protection • Write-Ahead Log segments shipped to durable storage every 60 seconds • We can replay these logs on a new server to recover your data • https://github.com/heroku/WAL-E 37 Saturday, September 8, 12 This is what we call Continuous Protection. Having WAL segments always available is a primary concern of ours, as it allows us to easily rebuild a server’s data state, and can be updated continuously as opposed to capturing full backups of the system.
  • 38. Need a more flexible object model 38 Saturday, September 8, 12 Now, the introduction of all of these functions required us to rethink our object model.
  • 39. timeline 39 Saturday, September 8, 12 We have the concept of a timeline A timeline at time = zero contains no data, no commits.
  • 40. participant 40 Saturday, September 8, 12 Participants are attached to a timeline. Participants can write data to the timeline.
  • 41. 41 Saturday, September 8, 12 Writing data to the timeline moves the timeline forward in time.
  • 43. resource 43 Saturday, September 8, 12 A resource is what our users get. It maps to a URL. A resource is attached to one participant.
  • 44. follower44 Saturday, September 8, 12 This allows us to model followers easily. A follower is just a participant on the same timeline as its reader. The difference is that followers can’t write to the same timeline. Only one participant can write to the timeline, the follower’s leader (or primary).
  • 45. fork 45 Saturday, September 8, 12 When we fork a database, it creates its own timeline. The new timeline now has drifted away from it’s parent, and can be writable. So it will create it’s own path.
  • 46. disaster 46 Saturday, September 8, 12 Finally, this system can be used during the event of catastrophic hardware failure. When a database’s hardware fails completely, instead of trying to recover the server itself, it’s best to create a new node and “STONITH” (http://en.wikipedia.org/wiki/STONITH)
  • 47. 47 Saturday, September 8, 12 What we do is create a new participant, hidden from the user.
  • 48. recovery48 Saturday, September 8, 12 And once it is caught up and ready to go, we tie the resource to it. So, the user only sees a blip in availability, but behind the scenes they are actually sitting on entirely new hardware, like magic.
  • 49. big project 49 Saturday, September 8, 12 Needless to say, this has become a big project over time.
  • 50. lots of moving parts 50 Saturday, September 8, 12
  • 51. long test suite 51 Saturday, September 8, 12
  • 52. modularize and build APIs 52 Saturday, September 8, 12 So it’s time to spread out responsabilities by modularizing the system and building APIs that are used for them to talk to each other.
  • 53. 53 Saturday, September 8, 12 What we’ve built is a constellation of heroku apps. We may split this even further in the future.
  • 54. gain in agility 54 Saturday, September 8, 12 This gains un in agility. The test suites of each individual project is much smaller now, which improves our ability to develop quicker. It also means that each component can be deployed individually. For example, a deploy to the admin front end UI has no effect on the main system’s APIs.
  • 55. composable services 55 Saturday, September 8, 12 It also allows us to build better abstractions at the systematic level, which gains us in the ability to compose services better. For example, a system that provisions and manages servers from our infrastructure provider can be used by many other consumers, not only heroku postgres.
  • 56. independently scalable 56 Saturday, September 8, 12 They can furthermore be scaled individually. Some parts of the system require different loads and response times than others, so now we are able to easily and clearly tweak our system operations based on clearly decoupled subsystems.
  • 57. Logging and Metrics 57 Saturday, September 8, 12 Finally, I’d like to talk about visibility into our app.
  • 58. log generation 58 Saturday, September 8, 12 First, let’s talk about logging.
  • 59. 59 Saturday, September 8, 12 In Heroku, there’s a service called Logplex (it’s open source). Your application is able to send logs to the logplex service to a specific channel (it uses Capability Based Security). Then, one or more consumers can “drain” the logs for that channel.
  • 60. logs are event streams 60 Saturday, September 8, 12
  • 61. how should you log? 61 Saturday, September 8, 12 Having this logging infrastructure available, let’s talk about how to make best use of it.
  • 62. post “/work” do puts “starting to do work” worker = Worker.new(params) begin worker.lift_things_up worker.put_them_down rescue WorkerError => e puts “Fail :( #{e.message}” status 500 end puts “done doing work” status 200 end 62 Saturday, September 8, 12 This is an example of terrible logging.
  • 63. $ heroku logs --tail 2012-07-28T02:43:35 [web.4] starting to do work 2012-07-28T02:43:35 [web.4] Fail :( invalid worker, nothing to do 2012-07-28T02:43:35 heroku[router] POST myapp.com/work dyno=web.4 queue=0 wait=0ms service=14ms status=500 bytes=643 63 Saturday, September 8, 12 There’s no structure to these logs, so it can’t be easily read and interpreted by a computer.
  • 64. bad logging • What exactly happened? • When did it happen? • How long did it take? • How many times has it happened? 64 Saturday, September 8, 12
  • 65. good logging • parseable • consistent • plentiful 65 Saturday, September 8, 12
  • 66. post “/work” do log(create_work: true, request_id: uuid) do worker = Worker.new(params.merge(uuid: uuid)) begin worker.lift_things_up worker.put_them_down rescue WorkerError => e log_exception(e, create_work: true) end end end helpers do def uuid @uuid ||= SecureRandom.uuid end end 66 Saturday, September 8, 12 Instead, let’s do some more structured logging. Also note how every request gets a UUID. This is critical to tying up all the logs for a given request.
  • 67. require ‘scrolls’ module App module Logs extend self def log(data, &block) Scrolls.log(with_env(data), &block) end def log_exception(exception, data, &block) Scrolls.log_exception(with_env(data), &block) end def with_env(hash) { environment: ENV[‘RACK_ENV’] }.merge(data) end end end 67 Saturday, September 8, 12 On the prior slide, we saw the `log` and `log_exception` methods. This is a small module that provides those methods. It is a wrapper for the `scrolls` (open source) gem. Scrolls provides a framework for structured logging. This module merely adds our environment name to the logs, which is useful for parsing later.
  • 68. $ heroku logs --tail 2012-07-28T02:43:35 [web.4] create_work request_id=afe2-f0d at=start 2012-07-28T02:43:35 [web.4] create_work request_id=afe2-f0d at=exception message=invalid worker, nothing to do 2012-07-28T02:43:35 [web.4] create_work request_id=afe2-f0d at=finish elapsed=53 2012-07-28T02:43:35 heroku[router] POST myapp.com/work dyno=web.4 queue=0 wait=0ms service=14ms status=500 bytes=643 68 Saturday, September 8, 12 Now our logs look like this. Easy to parse, and still easy to read by a human.
  • 69. log consumption 69 Saturday, September 8, 12 Let’s talk about consuming those logs, which should make it clear why structured logging is so important.
  • 70. (this is the fun part) 70 Saturday, September 8, 12
  • 71. 71 Saturday, September 8, 12 As mentioned before, it’s possible to set up multiple log drains. The heroku toolbelt has a utility to print out logs to your terminal (accessible via heroku logs --tail). But why stop there? You can have as many drains as you want! We can set up a drain that stores data locally for further analysis and metrics generation. Here, a postgres database is set up and logs stored to it on the key-value data type called hstore.
  • 72. select * from events; 72 Saturday, September 8, 12
  • 73. 73 Saturday, September 8, 12 Now that we have stored data on a postgres database, we can use SQL to query it and generate some metrics. We have a process that continuously queries this database and sends aggregated results to a metrics collection service (third party).
  • 74. good logging metrics alerts 74 Saturday, September 8, 12 Visibility into your system starts with good logging Great logs enable easy metrics collection Metrics lead to system alerts.
  • 75. current tooling • still using sequel and sinatra • fog displaced stem • backbone.js for web UIs • fernet for auth tokens, valcro for validations • python, go and bash in some subsystems 75 Saturday, September 8, 12 So to wrap up, our current tooling includes these pieces of technology
  • 76. lessons • managing databases is hard • start simple • extract (and share) reusable code • separate concerns into services • learn to love your event stream 76 Saturday, September 8, 12
  • 77. thanks! @hgmnz @herokupostgres 77 Saturday, September 8, 12