Git Product home page Git Product logo

pgproxy's Introduction

A story explaining what this is and why you probably don't want to use it.

At Etsy, it made a lot of sense for us to have a giant test suite with selenium early on, because we inherited a big messy codebase that wasn't testable any other way. And we also had no monitoring on production yet. So this was the only way we had to gain confidence in something we were going to push out. It was during this era that I wrote pgproxy.

Eventually, we instrumented the app and built out some really great production monitoring. At that point we changed strategies: we deployed smaller sets of changes more frequently, and if our nagios checks went awry we took changes back out. And we also started doing feature flags, so that we could deploy changes to production without having them change the executing code. And we could also turn on features a few percentage points at a time.

That might sound like a riskier approach but it's not. In practice it's not possible to prevent all problems, and you have to have the production monitoring. Quick detection and mitigation is much better prevention, at least in our case.

So we just deleted the big selenium test suite, because it was no longer providing us with the confidence in deployments that we wanted. Much to the contrary--it was hard to make tests like that that weren't flaky, and when tests flake all that happens is you lose confidence in the accuracy of the suite and you stop paying attention to it. Tests that flake are worse than no tests at all, I've found.

Over time we rebuilt a test suite, but it was 90% unit tests. That is, tests that mock things and don't use an external database or other services. We also built out a couple of selenium tests, but only in the super critical paths (for Etsy that meant checkout and user registration). In those places, the maintenance costs for a few tests was worth it, because breakage was expensive.

More on the original rationale for doing this, and documentation if you must use it

See here: PGProxy: A Testing Proxy for Postgres

pgproxy's People

Contributors

etrepum avatar mcfunley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pgproxy's Issues

PostgreSQL version mismatch?

Hi!

I just tried to use this, but I get the following with PostgreSQL 8.4.2. Also Python 2.6 doesn't have struct._compile anymore, it uses an internal cache.

  File "/Users/fschulze/Zope/jarn/bestform/bestform/buildout/src/pgproxy/pgproxy/protocol.py", line 57, in dataReceived
    done, extra = m.consume(data)
  File "/Users/fschulze/Zope/jarn/bestform/bestform/buildout/src/pgproxy/pgproxy/messages.py", line 52, in consume
    if not self.parse_header():
  File "/Users/fschulze/Zope/jarn/bestform/bestform/buildout/src/pgproxy/pgproxy/messages.py", line 100, in parse_header
    if not self.parse_special_header():
  File "/Users/fschulze/Zope/jarn/bestform/bestform/buildout/src/pgproxy/pgproxy/messages.py", line 193, in parse_special_header
    self.raise_unknown()
  File "/Users/fschulze/Zope/jarn/bestform/bestform/buildout/src/pgproxy/pgproxy/messages.py", line 119, in raise_unknown
    self.buffer.raw_value()[:200]))
exceptions.ValueError: Unknown FrontendMessage packet: '\x00\x00\x00\x08\x04\xd2\x16/'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.