Alternatives to Google Cloud SQL logo

Alternatives to Google Cloud SQL

MySQL, Apache Aurora, Google Cloud Datastore, Google Cloud Spanner, and PostgreSQL are the most popular alternatives and competitors to Google Cloud SQL.
543
571
+ 1
46

What is Google Cloud SQL and what are its top alternatives?

Run the same relational databases you know with their rich extension collections, configuration flags and developer ecosystem, but without the hassle of self management.
Google Cloud SQL is a tool in the SQL Database as a Service category of a tech stack.

Top Alternatives to Google Cloud SQL

  • MySQL
    MySQL

    The MySQL software delivers a very fast, multi-threaded, multi-user, and robust SQL (Structured Query Language) database server. MySQL Server is intended for mission-critical, heavy-load production systems as well as for embedding into mass-deployed software. ...

  • Apache Aurora
    Apache Aurora

    Apache Aurora is a service scheduler that runs on top of Mesos, enabling you to run long-running services that take advantage of Mesos' scalability, fault-tolerance, and resource isolation. ...

  • Google Cloud Datastore
    Google Cloud Datastore

    Use a managed, NoSQL, schemaless database for storing non-relational data. Cloud Datastore automatically scales as you need it and supports transactions as well as robust, SQL-like queries. ...

  • Google Cloud Spanner
    Google Cloud Spanner

    It is a globally distributed database service that gives developers a production-ready storage solution. It provides key features such as global transactions, strongly consistent reads, and automatic multi-site replication and failover. ...

  • PostgreSQL
    PostgreSQL

    PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. ...

  • Firebase
    Firebase

    Firebase is a cloud service designed to power real-time, collaborative applications. Simply add the Firebase library to your application to gain access to a shared data structure; any changes you make to that data are automatically synchronized with the Firebase cloud and with other clients within milliseconds. ...

  • JavaScript
    JavaScript

    JavaScript is most known as the scripting language for Web pages, but used in many non-browser environments as well such as node.js or Apache CouchDB. It is a prototype-based, multi-paradigm scripting language that is dynamic,and supports object-oriented, imperative, and functional programming styles. ...

  • Git
    Git

    Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. ...

Google Cloud SQL alternatives & related posts

MySQL logo

MySQL

122.4K
103.5K
3.7K
The world's most popular open source database
122.4K
103.5K
+ 1
3.7K
PROS OF MYSQL
  • 800
    Sql
  • 679
    Free
  • 562
    Easy
  • 528
    Widely used
  • 489
    Open source
  • 180
    High availability
  • 160
    Cross-platform support
  • 104
    Great community
  • 78
    Secure
  • 75
    Full-text indexing and searching
  • 25
    Fast, open, available
  • 16
    SSL support
  • 15
    Reliable
  • 14
    Robust
  • 8
    Enterprise Version
  • 7
    Easy to set up on all platforms
  • 2
    NoSQL access to JSON data type
  • 1
    Relational database
  • 1
    Easy, light, scalable
  • 1
    Sequel Pro (best SQL GUI)
  • 1
    Replica Support
CONS OF MYSQL
  • 16
    Owned by a company with their own agenda
  • 3
    Can't roll back schema changes

related MySQL posts

Nick Rockwell
SVP, Engineering at Fastly · | 46 upvotes · 3.2M views

When I joined NYT there was already broad dissatisfaction with the LAMP (Linux Apache HTTP Server MySQL PHP) Stack and the front end framework, in particular. So, I wasn't passing judgment on it. I mean, LAMP's fine, you can do good work in LAMP. It's a little dated at this point, but it's not ... I didn't want to rip it out for its own sake, but everyone else was like, "We don't like this, it's really inflexible." And I remember from being outside the company when that was called MIT FIVE when it had launched. And been observing it from the outside, and I was like, you guys took so long to do that and you did it so carefully, and yet you're not happy with your decisions. Why is that? That was more the impetus. If we're going to do this again, how are we going to do it in a way that we're gonna get a better result?

So we're moving quickly away from LAMP, I would say. So, right now, the new front end is React based and using Apollo. And we've been in a long, protracted, gradual rollout of the core experiences.

React is now talking to GraphQL as a primary API. There's a Node.js back end, to the front end, which is mainly for server-side rendering, as well.

Behind there, the main repository for the GraphQL server is a big table repository, that we call Bodega because it's a convenience store. And that reads off of a Kafka pipeline.

See more
Tim Abbott

We've been using PostgreSQL since the very early days of Zulip, but we actually didn't use it from the beginning. Zulip started out as a MySQL project back in 2012, because we'd heard it was a good choice for a startup with a wide community. However, we found that even though we were using the Django ORM for most of our database access, we spent a lot of time fighting with MySQL. Issues ranged from bad collation defaults, to bad query plans which required a lot of manual query tweaks.

We ended up getting so frustrated that we tried out PostgresQL, and the results were fantastic. We didn't have to do any real customization (just some tuning settings for how big a server we had), and all of our most important queries were faster out of the box. As a result, we were able to delete a bunch of custom queries escaping the ORM that we'd written to make the MySQL query planner happy (because postgres just did the right thing automatically).

And then after that, we've just gotten a ton of value out of postgres. We use its excellent built-in full-text search, which has helped us avoid needing to bring in a tool like Elasticsearch, and we've really enjoyed features like its partial indexes, which saved us a lot of work adding unnecessary extra tables to get good performance for things like our "unread messages" and "starred messages" indexes.

I can't recommend it highly enough.

See more
Apache Aurora logo

Apache Aurora

69
96
0
An Apcahe Mesos framework for scheduling jobs, originally developed by Twitter
69
96
+ 1
0
PROS OF APACHE AURORA
    Be the first to leave a pro
    CONS OF APACHE AURORA
      Be the first to leave a con

      related Apache Aurora posts

      Docker containers on Mesos run their microservices with consistent configurations at scale, along with Aurora for long-running services and cron jobs.

      See more
      Google Cloud Datastore logo

      Google Cloud Datastore

      251
      356
      12
      A Fully Managed NoSQL Data Storage Service
      251
      356
      + 1
      12
      PROS OF GOOGLE CLOUD DATASTORE
      • 7
        High scalability
      • 2
        Serverless
      • 2
        Ability to query any property
      • 1
        Pay for what you use
      CONS OF GOOGLE CLOUD DATASTORE
        Be the first to leave a con

        related Google Cloud Datastore posts

        Google Cloud Spanner logo

        Google Cloud Spanner

        44
        111
        3
        Fully managed, scalable, relational database service for regional and global application data
        44
        111
        + 1
        3
        PROS OF GOOGLE CLOUD SPANNER
        • 1
          Strongly consistent
        • 1
          Horizontal scaling
        • 1
          Scalable
        CONS OF GOOGLE CLOUD SPANNER
          Be the first to leave a con

          related Google Cloud Spanner posts

          PostgreSQL logo

          PostgreSQL

          95.8K
          80.2K
          3.5K
          A powerful, open source object-relational database system
          95.8K
          80.2K
          + 1
          3.5K
          PROS OF POSTGRESQL
          • 762
            Relational database
          • 510
            High availability
          • 439
            Enterprise class database
          • 383
            Sql
          • 304
            Sql + nosql
          • 173
            Great community
          • 147
            Easy to setup
          • 131
            Heroku
          • 130
            Secure by default
          • 113
            Postgis
          • 50
            Supports Key-Value
          • 48
            Great JSON support
          • 34
            Cross platform
          • 32
            Extensible
          • 28
            Replication
          • 26
            Triggers
          • 23
            Rollback
          • 22
            Multiversion concurrency control
          • 21
            Open source
          • 18
            Heroku Add-on
          • 17
            Stable, Simple and Good Performance
          • 15
            Powerful
          • 13
            Lets be serious, what other SQL DB would you go for?
          • 11
            Good documentation
          • 8
            Intelligent optimizer
          • 8
            Free
          • 8
            Scalable
          • 8
            Reliable
          • 7
            Transactional DDL
          • 7
            Modern
          • 6
            One stop solution for all things sql no matter the os
          • 5
            Relational database with MVCC
          • 5
            Faster Development
          • 4
            Developer friendly
          • 4
            Full-Text Search
          • 3
            Free version
          • 3
            Great DB for Transactional system or Application
          • 3
            Relational datanbase
          • 3
            search
          • 3
            Open-source
          • 3
            Excellent source code
          • 2
            Full-text
          • 2
            Text
          • 0
            Native
          CONS OF POSTGRESQL
          • 10
            Table/index bloatings

          related PostgreSQL posts

          Simon Reymann
          Senior Fullstack Developer at QUANTUSflow Software GmbH · | 30 upvotes · 9M views

          Our whole DevOps stack consists of the following tools:

          • GitHub (incl. GitHub Pages/Markdown for Documentation, GettingStarted and HowTo's) for collaborative review and code management tool
          • Respectively Git as revision control system
          • SourceTree as Git GUI
          • Visual Studio Code as IDE
          • CircleCI for continuous integration (automatize development process)
          • Prettier / TSLint / ESLint as code linter
          • SonarQube as quality gate
          • Docker as container management (incl. Docker Compose for multi-container application management)
          • VirtualBox for operating system simulation tests
          • Kubernetes as cluster management for docker containers
          • Heroku for deploying in test environments
          • nginx as web server (preferably used as facade server in production environment)
          • SSLMate (using OpenSSL) for certificate management
          • Amazon EC2 (incl. Amazon S3) for deploying in stage (production-like) and production environments
          • PostgreSQL as preferred database system
          • Redis as preferred in-memory database/store (great for caching)

          The main reason we have chosen Kubernetes over Docker Swarm is related to the following artifacts:

          • Key features: Easy and flexible installation, Clear dashboard, Great scaling operations, Monitoring is an integral part, Great load balancing concepts, Monitors the condition and ensures compensation in the event of failure.
          • Applications: An application can be deployed using a combination of pods, deployments, and services (or micro-services).
          • Functionality: Kubernetes as a complex installation and setup process, but it not as limited as Docker Swarm.
          • Monitoring: It supports multiple versions of logging and monitoring when the services are deployed within the cluster (Elasticsearch/Kibana (ELK), Heapster/Grafana, Sysdig cloud integration).
          • Scalability: All-in-one framework for distributed systems.
          • Other Benefits: Kubernetes is backed by the Cloud Native Computing Foundation (CNCF), huge community among container orchestration tools, it is an open source and modular tool that works with any OS.
          See more
          Jeyabalaji Subramanian

          Recently we were looking at a few robust and cost-effective ways of replicating the data that resides in our production MongoDB to a PostgreSQL database for data warehousing and business intelligence.

          We set ourselves the following criteria for the optimal tool that would do this job: - The data replication must be near real-time, yet it should NOT impact the production database - The data replication must be horizontally scalable (based on the load), asynchronous & crash-resilient

          Based on the above criteria, we selected the following tools to perform the end to end data replication:

          We chose MongoDB Stitch for picking up the changes in the source database. It is the serverless platform from MongoDB. One of the services offered by MongoDB Stitch is Stitch Triggers. Using stitch triggers, you can execute a serverless function (in Node.js) in real time in response to changes in the database. When there are a lot of database changes, Stitch automatically "feeds forward" these changes through an asynchronous queue.

          We chose Amazon SQS as the pipe / message backbone for communicating the changes from MongoDB to our own replication service. Interestingly enough, MongoDB stitch offers integration with AWS services.

          In the Node.js function, we wrote minimal functionality to communicate the database changes (insert / update / delete / replace) to Amazon SQS.

          Next we wrote a minimal micro-service in Python to listen to the message events on SQS, pickup the data payload & mirror the DB changes on to the target Data warehouse. We implemented source data to target data translation by modelling target table structures through SQLAlchemy . We deployed this micro-service as AWS Lambda with Zappa. With Zappa, deploying your services as event-driven & horizontally scalable Lambda service is dumb-easy.

          In the end, we got to implement a highly scalable near realtime Change Data Replication service that "works" and deployed to production in a matter of few days!

          See more
          Firebase logo

          Firebase

          40.1K
          34.4K
          2K
          The Realtime App Platform
          40.1K
          34.4K
          + 1
          2K
          PROS OF FIREBASE
          • 371
            Realtime backend made easy
          • 270
            Fast and responsive
          • 242
            Easy setup
          • 215
            Real-time
          • 191
            JSON
          • 134
            Free
          • 128
            Backed by google
          • 83
            Angular adaptor
          • 68
            Reliable
          • 36
            Great customer support
          • 32
            Great documentation
          • 25
            Real-time synchronization
          • 21
            Mobile friendly
          • 18
            Rapid prototyping
          • 14
            Great security
          • 12
            Automatic scaling
          • 11
            Freakingly awesome
          • 8
            Chat
          • 8
            Angularfire is an amazing addition!
          • 8
            Super fast development
          • 6
            Built in user auth/oauth
          • 6
            Firebase hosting
          • 6
            Ios adaptor
          • 6
            Awesome next-gen backend
          • 4
            Speed of light
          • 4
            Very easy to use
          • 3
            Great
          • 3
            It's made development super fast
          • 3
            Brilliant for startups
          • 2
            Free hosting
          • 2
            Cloud functions
          • 2
            JS Offline and Sync suport
          • 2
            Low battery consumption
          • 2
            .net
          • 2
            The concurrent updates create a great experience
          • 2
            Push notification
          • 2
            I can quickly create static web apps with no backend
          • 2
            Great all-round functionality
          • 2
            Free authentication solution
          • 1
            Easy Reactjs integration
          • 1
            Google's support
          • 1
            Free SSL
          • 1
            CDN & cache out of the box
          • 1
            Easy to use
          • 1
            Large
          • 1
            Faster workflow
          • 1
            Serverless
          • 1
            Good Free Limits
          • 1
            Simple and easy
          CONS OF FIREBASE
          • 31
            Can become expensive
          • 16
            No open source, you depend on external company
          • 15
            Scalability is not infinite
          • 9
            Not Flexible Enough
          • 7
            Cant filter queries
          • 3
            Very unstable server
          • 3
            No Relational Data
          • 2
            Too many errors
          • 2
            No offline sync

          related Firebase posts

          Johnny Bell

          I was building a personal project that I needed to store items in a real time database. I am more comfortable with my Frontend skills than my backend so I didn't want to spend time building out anything in Ruby or Go.

          I stumbled on Firebase by #Google, and it was really all I needed. It had realtime data, an area for storing file uploads and best of all for the amount of data I needed it was free!

          I built out my application using tools I was familiar with, React for the framework, Redux.js to manage my state across components, and styled-components for the styling.

          Now as this was a project I was just working on in my free time for fun I didn't really want to pay for hosting. I did some research and I found Netlify. I had actually seen them at #ReactRally the year before and deployed a Gatsby site to Netlify already.

          Netlify was very easy to setup and link to my GitHub account you select a repo and pretty much with very little configuration you have a live site that will deploy every time you push to master.

          With the selection of these tools I was able to build out my application, connect it to a realtime database, and deploy to a live environment all with $0 spent.

          If you're looking to build out a small app I suggest giving these tools a go as you can get your idea out into the real world for absolutely no cost.

          See more
          Collins Ogbuzuru
          Front-end dev at Evolve credit · | 15 upvotes · 7.3K views

          Your tech stack is solid for building a real-time messaging project.

          React and React Native are excellent choices for the frontend, especially if you want to have both web and mobile versions of your application share code.

          ExpressJS is an unopinionated framework that affords you the flexibility to use it's features at your term, which is a good start. However, I would recommend you explore Sails.js as well. Sails.js is built on top of Express.js and it provides additional features out of the box, especially the Websocket integration that your project requires.

          Don't forget to set up Graphql codegen, this would improve your dev experience (Add Typescript, if you can too).

          I don't know much about databases but you might want to consider using NO-SQL. I used Firebase real-time db and aws dynamo db on a few of my personal projects and I love they're easy to work with and offer more flexibility for a chat application.

          See more
          JavaScript logo

          JavaScript

          349.6K
          266.3K
          8.1K
          Lightweight, interpreted, object-oriented language with first-class functions
          349.6K
          266.3K
          + 1
          8.1K
          PROS OF JAVASCRIPT
          • 1.7K
            Can be used on frontend/backend
          • 1.5K
            It's everywhere
          • 1.2K
            Lots of great frameworks
          • 896
            Fast
          • 745
            Light weight
          • 425
            Flexible
          • 392
            You can't get a device today that doesn't run js
          • 286
            Non-blocking i/o
          • 236
            Ubiquitousness
          • 191
            Expressive
          • 55
            Extended functionality to web pages
          • 49
            Relatively easy language
          • 46
            Executed on the client side
          • 30
            Relatively fast to the end user
          • 25
            Pure Javascript
          • 21
            Functional programming
          • 15
            Async
          • 13
            Full-stack
          • 12
            Setup is easy
          • 12
            Its everywhere
          • 11
            JavaScript is the New PHP
          • 11
            Because I love functions
          • 10
            Like it or not, JS is part of the web standard
          • 9
            Can be used in backend, frontend and DB
          • 9
            Expansive community
          • 9
            Future Language of The Web
          • 9
            Easy
          • 8
            No need to use PHP
          • 8
            For the good parts
          • 8
            Can be used both as frontend and backend as well
          • 8
            Everyone use it
          • 8
            Most Popular Language in the World
          • 8
            Easy to hire developers
          • 7
            Love-hate relationship
          • 7
            Powerful
          • 7
            Photoshop has 3 JS runtimes built in
          • 7
            Evolution of C
          • 7
            Popularized Class-Less Architecture & Lambdas
          • 7
            Agile, packages simple to use
          • 7
            Supports lambdas and closures
          • 6
            1.6K Can be used on frontend/backend
          • 6
            It's fun
          • 6
            Hard not to use
          • 6
            Nice
          • 6
            Client side JS uses the visitors CPU to save Server Res
          • 6
            Versitile
          • 6
            It let's me use Babel & Typescript
          • 6
            Easy to make something
          • 6
            Its fun and fast
          • 6
            Can be used on frontend/backend/Mobile/create PRO Ui
          • 5
            Function expressions are useful for callbacks
          • 5
            What to add
          • 5
            Client processing
          • 5
            Everywhere
          • 5
            Scope manipulation
          • 5
            Stockholm Syndrome
          • 5
            Promise relationship
          • 5
            Clojurescript
          • 4
            Because it is so simple and lightweight
          • 4
            Only Programming language on browser
          • 1
            Hard to learn
          • 1
            Test
          • 1
            Test2
          • 1
            Easy to understand
          • 1
            Not the best
          • 1
            Easy to learn
          • 1
            Subskill #4
          • 0
            Hard 彤
          CONS OF JAVASCRIPT
          • 22
            A constant moving target, too much churn
          • 20
            Horribly inconsistent
          • 15
            Javascript is the New PHP
          • 9
            No ability to monitor memory utilitization
          • 8
            Shows Zero output in case of ANY error
          • 7
            Thinks strange results are better than errors
          • 6
            Can be ugly
          • 3
            No GitHub
          • 2
            Slow

          related JavaScript posts

          Zach Holman

          Oof. I have truly hated JavaScript for a long time. Like, for over twenty years now. Like, since the Clinton administration. It's always been a nightmare to deal with all of the aspects of that silly language.

          But wowza, things have changed. Tooling is just way, way better. I'm primarily web-oriented, and using React and Apollo together the past few years really opened my eyes to building rich apps. And I deeply apologize for using the phrase rich apps; I don't think I've ever said such Enterprisey words before.

          But yeah, things are different now. I still love Rails, and still use it for a lot of apps I build. But it's that silly rich apps phrase that's the problem. Users have way more comprehensive expectations than they did even five years ago, and the JS community does a good job at building tools and tech that tackle the problems of making heavy, complicated UI and frontend work.

          Obviously there's a lot of things happening here, so just saying "JavaScript isn't terrible" might encompass a huge amount of libraries and frameworks. But if you're like me, yeah, give things another shot- I'm somehow not hating on JavaScript anymore and... gulp... I kinda love it.

          See more
          Conor Myhrvold
          Tech Brand Mgr, Office of CTO at Uber · | 44 upvotes · 9.6M views

          How Uber developed the open source, end-to-end distributed tracing Jaeger , now a CNCF project:

          Distributed tracing is quickly becoming a must-have component in the tools that organizations use to monitor their complex, microservice-based architectures. At Uber, our open source distributed tracing system Jaeger saw large-scale internal adoption throughout 2016, integrated into hundreds of microservices and now recording thousands of traces every second.

          Here is the story of how we got here, from investigating off-the-shelf solutions like Zipkin, to why we switched from pull to push architecture, and how distributed tracing will continue to evolve:

          https://eng.uber.com/distributed-tracing/

          (GitHub Pages : https://www.jaegertracing.io/, GitHub: https://github.com/jaegertracing/jaeger)

          Bindings/Operator: Python Java Node.js Go C++ Kubernetes JavaScript OpenShift C# Apache Spark

          See more
          Git logo

          Git

          288.6K
          173.6K
          6.6K
          Fast, scalable, distributed revision control system
          288.6K
          173.6K
          + 1
          6.6K
          PROS OF GIT
          • 1.4K
            Distributed version control system
          • 1.1K
            Efficient branching and merging
          • 959
            Fast
          • 845
            Open source
          • 726
            Better than svn
          • 368
            Great command-line application
          • 306
            Simple
          • 291
            Free
          • 232
            Easy to use
          • 222
            Does not require server
          • 27
            Distributed
          • 22
            Small & Fast
          • 18
            Feature based workflow
          • 15
            Staging Area
          • 13
            Most wide-spread VSC
          • 11
            Role-based codelines
          • 11
            Disposable Experimentation
          • 7
            Frictionless Context Switching
          • 6
            Data Assurance
          • 5
            Efficient
          • 4
            Just awesome
          • 3
            Github integration
          • 3
            Easy branching and merging
          • 2
            Compatible
          • 2
            Flexible
          • 2
            Possible to lose history and commits
          • 1
            Rebase supported natively; reflog; access to plumbing
          • 1
            Light
          • 1
            Team Integration
          • 1
            Fast, scalable, distributed revision control system
          • 1
            Easy
          • 1
            Flexible, easy, Safe, and fast
          • 1
            CLI is great, but the GUI tools are awesome
          • 1
            It's what you do
          • 0
            Phinx
          CONS OF GIT
          • 16
            Hard to learn
          • 11
            Inconsistent command line interface
          • 9
            Easy to lose uncommitted work
          • 7
            Worst documentation ever possibly made
          • 5
            Awful merge handling
          • 3
            Unexistent preventive security flows
          • 3
            Rebase hell
          • 2
            When --force is disabled, cannot rebase
          • 2
            Ironically even die-hard supporters screw up badly
          • 1
            Doesn't scale for big data

          related Git posts

          Simon Reymann
          Senior Fullstack Developer at QUANTUSflow Software GmbH · | 30 upvotes · 9M views

          Our whole DevOps stack consists of the following tools:

          • GitHub (incl. GitHub Pages/Markdown for Documentation, GettingStarted and HowTo's) for collaborative review and code management tool
          • Respectively Git as revision control system
          • SourceTree as Git GUI
          • Visual Studio Code as IDE
          • CircleCI for continuous integration (automatize development process)
          • Prettier / TSLint / ESLint as code linter
          • SonarQube as quality gate
          • Docker as container management (incl. Docker Compose for multi-container application management)
          • VirtualBox for operating system simulation tests
          • Kubernetes as cluster management for docker containers
          • Heroku for deploying in test environments
          • nginx as web server (preferably used as facade server in production environment)
          • SSLMate (using OpenSSL) for certificate management
          • Amazon EC2 (incl. Amazon S3) for deploying in stage (production-like) and production environments
          • PostgreSQL as preferred database system
          • Redis as preferred in-memory database/store (great for caching)

          The main reason we have chosen Kubernetes over Docker Swarm is related to the following artifacts:

          • Key features: Easy and flexible installation, Clear dashboard, Great scaling operations, Monitoring is an integral part, Great load balancing concepts, Monitors the condition and ensures compensation in the event of failure.
          • Applications: An application can be deployed using a combination of pods, deployments, and services (or micro-services).
          • Functionality: Kubernetes as a complex installation and setup process, but it not as limited as Docker Swarm.
          • Monitoring: It supports multiple versions of logging and monitoring when the services are deployed within the cluster (Elasticsearch/Kibana (ELK), Heapster/Grafana, Sysdig cloud integration).
          • Scalability: All-in-one framework for distributed systems.
          • Other Benefits: Kubernetes is backed by the Cloud Native Computing Foundation (CNCF), huge community among container orchestration tools, it is an open source and modular tool that works with any OS.
          See more
          Tymoteusz Paul
          Devops guy at X20X Development LTD · | 23 upvotes · 8M views

          Often enough I have to explain my way of going about setting up a CI/CD pipeline with multiple deployment platforms. Since I am a bit tired of yapping the same every single time, I've decided to write it up and share with the world this way, and send people to read it instead ;). I will explain it on "live-example" of how the Rome got built, basing that current methodology exists only of readme.md and wishes of good luck (as it usually is ;)).

          It always starts with an app, whatever it may be and reading the readmes available while Vagrant and VirtualBox is installing and updating. Following that is the first hurdle to go over - convert all the instruction/scripts into Ansible playbook(s), and only stopping when doing a clear vagrant up or vagrant reload we will have a fully working environment. As our Vagrant environment is now functional, it's time to break it! This is the moment to look for how things can be done better (too rigid/too lose versioning? Sloppy environment setup?) and replace them with the right way to do stuff, one that won't bite us in the backside. This is the point, and the best opportunity, to upcycle the existing way of doing dev environment to produce a proper, production-grade product.

          I should probably digress here for a moment and explain why. I firmly believe that the way you deploy production is the same way you should deploy develop, shy of few debugging-friendly setting. This way you avoid the discrepancy between how production work vs how development works, which almost always causes major pains in the back of the neck, and with use of proper tools should mean no more work for the developers. That's why we start with Vagrant as developer boxes should be as easy as vagrant up, but the meat of our product lies in Ansible which will do meat of the work and can be applied to almost anything: AWS, bare metal, docker, LXC, in open net, behind vpn - you name it.

          We must also give proper consideration to monitoring and logging hoovering at this point. My generic answer here is to grab Elasticsearch, Kibana, and Logstash. While for different use cases there may be better solutions, this one is well battle-tested, performs reasonably and is very easy to scale both vertically (within some limits) and horizontally. Logstash rules are easy to write and are well supported in maintenance through Ansible, which as I've mentioned earlier, are at the very core of things, and creating triggers/reports and alerts based on Elastic and Kibana is generally a breeze, including some quite complex aggregations.

          If we are happy with the state of the Ansible it's time to move on and put all those roles and playbooks to work. Namely, we need something to manage our CI/CD pipelines. For me, the choice is obvious: TeamCity. It's modern, robust and unlike most of the light-weight alternatives, it's transparent. What I mean by that is that it doesn't tell you how to do things, doesn't limit your ways to deploy, or test, or package for that matter. Instead, it provides a developer-friendly and rich playground for your pipelines. You can do most the same with Jenkins, but it has a quite dated look and feel to it, while also missing some key functionality that must be brought in via plugins (like quality REST API which comes built-in with TeamCity). It also comes with all the common-handy plugins like Slack or Apache Maven integration.

          The exact flow between CI and CD varies too greatly from one application to another to describe, so I will outline a few rules that guide me in it: 1. Make build steps as small as possible. This way when something breaks, we know exactly where, without needing to dig and root around. 2. All security credentials besides development environment must be sources from individual Vault instances. Keys to those containers should exist only on the CI/CD box and accessible by a few people (the less the better). This is pretty self-explanatory, as anything besides dev may contain sensitive data and, at times, be public-facing. Because of that appropriate security must be present. TeamCity shines in this department with excellent secrets-management. 3. Every part of the build chain shall consume and produce artifacts. If it creates nothing, it likely shouldn't be its own build. This way if any issue shows up with any environment or version, all developer has to do it is grab appropriate artifacts to reproduce the issue locally. 4. Deployment builds should be directly tied to specific Git branches/tags. This enables much easier tracking of what caused an issue, including automated identifying and tagging the author (nothing like automated regression testing!).

          Speaking of deployments, I generally try to keep it simple but also with a close eye on the wallet. Because of that, I am more than happy with AWS or another cloud provider, but also constantly peeking at the loads and do we get the value of what we are paying for. Often enough the pattern of use is not constantly erratic, but rather has a firm baseline which could be migrated away from the cloud and into bare metal boxes. That is another part where this approach strongly triumphs over the common Docker and CircleCI setup, where you are very much tied in to use cloud providers and getting out is expensive. Here to embrace bare-metal hosting all you need is a help of some container-based self-hosting software, my personal preference is with Proxmox and LXC. Following that all you must write are ansible scripts to manage hardware of Proxmox, similar way as you do for Amazon EC2 (ansible supports both greatly) and you are good to go. One does not exclude another, quite the opposite, as they can live in great synergy and cut your costs dramatically (the heavier your base load, the bigger the savings) while providing production-grade resiliency.

          See more