High-Load Go Backend with Echo Framework

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Showing 1 of 1All 2062 services
High-Load Go Backend with Echo Framework
Medium
from 1 week to 3 months
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1358
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1250
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    956
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1188
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    929
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    947

High-Load Go Backend with Echo Framework

In production, a Go server must handle tens of thousands of concurrent connections, process requests in milliseconds, and gracefully shut down during restarts. The standard net/http package lacks built-in rate limiting, graceful shutdown, and flexible routing. That's why we choose Echo – a framework that doesn't impose architecture but provides all the tools for a production-ready solution. Our team has over 7 years of Go development experience and has delivered 50+ projects, from simple APIs to real-time platforms. As stated in the Echo documentation: Echo is a high performance, extensible, minimalist Go web framework.

Why Echo Over Gin?

Echo and Gin solve the same problem, but Echo emphasizes extensibility: middleware, context, binder – all are interfaces that can be replaced. Gin is slightly faster in synthetic benchmarks (e.g., 10k RPS vs 9.5k RPS), but Echo is more architecturally flexible, especially for writing middleware. In real projects, performance differences are negligible – the bottleneck is almost always the database, not the router.

Core Components of an Echo Backend

Initialization and Routing

// internal/server/server.go
package server

import (
    "net/http"
    "os"
    "os/signal"
    "syscall"
    "context"
    "time"

    "github.com/labstack/echo/v4"
    "github.com/labstack/echo/v4/middleware"
    "github.com/myapp/internal/domain/product"
    "github.com/myapp/internal/domain/auth"
    custmw "github.com/myapp/internal/middleware"
)

type Server struct {
    echo    *echo.Echo
    product *product.Handler
    auth    *auth.Handler
    logger  Logger
    cfg     Config
}

func New(deps Dependencies) *Server {
    e := echo.New()
    e.HideBanner = true
    e.Validator = custmw.NewValidator()

    // Built-in middleware
    e.Use(middleware.RequestLoggerWithConfig(middleware.RequestLoggerConfig{
        LogMethod: true, LogURI: true, LogStatus: true, LogLatency: true,
        LogValuesFunc: func(c echo.Context, v middleware.RequestLoggerValues) error {
            deps.Logger.Info("request",
                "method", v.Method, "uri", v.URI,
                "status", v.Status, "latency", v.Latency)
            return nil
        },
    }))
    e.Use(middleware.RecoverWithConfig(middleware.RecoverConfig{
        LogErrorFunc: func(c echo.Context, err error, stack []byte) error {
            deps.Logger.Error("panic recovered", "error", err)
            return nil
        },
    }))
    e.Use(middleware.CORSWithConfig(middleware.CORSConfig{
        AllowOrigins:     deps.Config.AllowedOrigins,
        AllowCredentials: true,
    }))
    e.Use(middleware.RateLimiter(middleware.NewRateLimiterMemoryStore(100)))

    s := &Server{echo: e, product: product.NewHandler(deps), auth: auth.NewHandler(deps), logger: deps.Logger, cfg: deps.Config}
    s.registerRoutes()
    return s
}

func (s *Server) registerRoutes() {
    api := s.echo.Group("/api/v1")

    // Public
    authGroup := api.Group("/auth")
    authGroup.POST("/login", s.auth.Login)
    authGroup.POST("/refresh", s.auth.Refresh)

    // Protected
    restricted := api.Group("", custmw.JWT(s.cfg.JWTSecret))
    restricted.GET("/profile", s.auth.Profile)

    products := api.Group("/products")
    products.GET("", s.product.List)
    products.GET("/:id", s.product.Get)

    adminProducts := products.Group("", custmw.JWT(s.cfg.JWTSecret), custmw.RequireRole("admin"))
    adminProducts.POST("", s.product.Create)
    adminProducts.PUT("/:id", s.product.Update)
    adminProducts.DELETE("/:id", s.product.Delete)
}

func (s *Server) Start(addr string) error {
    go func() {
        if err := s.echo.Start(addr); err != http.ErrServerClosed {
            s.logger.Error("server error", "err", err)
        }
    }()

    quit := make(chan os.Signal, 1)
    signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM)
    <-quit

    ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
    defer cancel()
    return s.echo.Shutdown(ctx)
}

Custom Validator

// internal/middleware/validator.go
package middleware

import (
    "github.com/go-playground/validator/v10"
    "github.com/labstack/echo/v4"
    "net/http"
)

type CustomValidator struct {
    v *validator.Validate
}

func NewValidator() *CustomValidator {
    v := validator.New()

    // Custom tag for slug
    v.RegisterValidation("slug", func(fl validator.FieldLevel) bool {
        val := fl.Field().String()
        for _, c := range val {
            if !((c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || c == '-') {
                return false
            }
        }
        return len(val) > 0
    })

    return &CustomValidator{v: v}
}

func (cv *CustomValidator) Validate(i interface{}) error {
    if err := cv.v.Struct(i); err != nil {
        errs := err.(validator.ValidationErrors)
        fields := make(map[string]string, len(errs))
        for _, e := range errs {
            fields[e.Field()] = e.Tag()
        }
        return echo.NewHTTPError(http.StatusUnprocessableEntity, fields)
    }
    return nil
}

Handler with Echo Context

// internal/domain/product/handler.go
package product

import (
    "net/http"
    "strconv"

    "github.com/labstack/echo/v4"
)

type Handler struct {
    svc *Service
}

type CreateRequest struct {
    Name        string   `json:"name" validate:"required,min=2,max=255"`
    Price       float64  `json:"price" validate:"required,gt=0"`
    CategoryID  *int     `json:"category_id" validate:"omitempty,gt=0"`
    Tags        []string `json:"tags" validate:"omitempty,max=10,dive,min=1,max=50"`
}

func (h *Handler) Create(c echo.Context) error {
    var req CreateRequest
    if err := c.Bind(&req); err != nil {
        return echo.NewHTTPError(http.StatusBadRequest, err.Error())
    }
    if err := c.Validate(&req); err != nil {
        return err // echo.HTTPError with fields
    }

    userID := c.Get("userID").(int)
    product, err := h.svc.Create(c.Request().Context(), req, userID)
    if err != nil {
        return mapServiceError(err)
    }

    return c.JSON(http.StatusCreated, product)
}

func (h *Handler) Get(c echo.Context) error {
    id, err := strconv.Atoi(c.Param("id"))
    if err != nil {
        return echo.NewHTTPError(http.StatusBadRequest, "invalid id")
    }

    product, err := h.svc.GetByID(c.Request().Context(), id)
    if err != nil {
        return mapServiceError(err)
    }

    return c.JSON(http.StatusOK, product)
}

WebSocket and SSE

// WebSocket
func (h *NotificationHandler) Subscribe(c echo.Context) error {
    userID := c.Get("userID").(int)

    conn, _, _, err := ws.UpgradeHTTP(c.Request(), c.Response())
    if err != nil {
        return err
    }
    defer conn.Close()

    ch := h.broker.Subscribe(userID)
    defer h.broker.Unsubscribe(userID, ch)

    for msg := range ch {
        if err := wsutil.WriteServerMessage(conn, ws.OpText, msg); err != nil {
            break
        }
    }
    return nil
}

// Server-Sent Events
func (h *EventHandler) Stream(c echo.Context) error {
    c.Response().Header().Set(echo.HeaderContentType, "text/event-stream")
    c.Response().Header().Set("Cache-Control", "no-cache")
    c.Response().Header().Set("Connection", "keep-alive")
    c.Response().WriteHeader(http.StatusOK)

    ticker := time.NewTicker(5 * time.Second)
    defer ticker.Stop()

    for {
        select {
        case <-c.Request().Context().Done():
            return nil
        case t := <-ticker.C:
            fmt.Fprintf(c.Response(), "data: %s\n\n", t.Format(time.RFC3339))
            c.Response().Flush()
        }
    }
}

Caching with Redis

// internal/cache/redis.go
type Cache struct {
    client *redis.Client
}

func (c *Cache) GetOrSet(ctx context.Context, key string, ttl time.Duration, fn func() (interface{}, error)) (interface{}, error) {
    cached, err := c.client.Get(ctx, key).Bytes()
    if err == nil {
        var result interface{}
        if err := json.Unmarshal(cached, &result); err == nil {
            return result, nil
        }
    }

    value, err := fn()
    if err != nil {
        return nil, err
    }

    if data, err := json.Marshal(value); err == nil {
        c.client.Set(ctx, key, data, ttl)
    }

    return value, nil
}

// Usage in handler
func (h *Handler) List(c echo.Context) error {
    cacheKey := fmt.Sprintf("products:list:%s", c.QueryString())

    result, err := h.cache.GetOrSet(c.Request().Context(), cacheKey, 5*time.Minute, func() (interface{}, error) {
        return h.svc.List(c.Request().Context(), parseListParams(c))
    })
    if err != nil {
        return echo.NewHTTPError(http.StatusInternalServerError)
    }

    return c.JSON(http.StatusOK, result)
}

How Echo Handles High Load

Echo's mechanisms – allocation-free middleware, context pooling, and built-in rate limiter – deliver low TTFB (e.g., <50ms at 10k RPS) and predictable memory usage. Combined with Redis caching, we keep LCP in the green zone of Core Web Vitals even at 10k RPS. The GetOrSet pattern above is the cache-aside approach we apply to every GET endpoint.

Case study: On a recent e-commerce project, we reduced average response time from 1.2 seconds to 180ms by implementing Redis cache-aside and optimizing SQL queries. The system now handles 10k RPS while maintaining consistent LCP under 2.5 seconds. Infrastructure costs decreased by 40% due to reduced server load.

Common Pitfalls and Solutions

  • N+1 queries: Avoid by using Repository pattern with explicit JOINs and pagination. We always use eager loading and single-query approaches.
  • Missing graceful shutdown: Implement echo.Shutdown with a 10-second timeout to drain connections on restart.
  • Weak validation: Register a custom validator with business rules (e.g., slug format) to get structured error responses.
  • CORS misconfiguration: Set AllowOrigins precisely in CORS middleware to prevent broad origins.

What's Included in Our Work (Deliverables)

Our Go backend development service includes:

  • Architecture design: pattern selection (Repository, BFF), DB schema, API contracts (OpenAPI 3.0)
  • Full implementation: middleware, handlers, services, integration tests (80%+ coverage)
  • Infrastructure setup: Docker, docker-compose, CI/CD (GitHub Actions), Nginx config
  • Performance optimization: profiling, caching strategy, load testing (k6)
  • Documentation: OpenAPI (Swagger), README with run instructions, deployment guide
  • Access: full source code, commit history, credentials, admin panel
  • Training: optional 1-day team session on running and extending the solution
  • Warranty: 2 weeks post-delivery support for bug fixes and questions

How We Work: Process and Scope

Component Description
Architecture Pattern selection (Repository, BFF), DB schema, API contracts
Development Middleware, handlers, services, integration tests
Infrastructure Docker, docker-compose, CI/CD (GitHub Actions)
Documentation OpenAPI (Swagger), README with run instructions
Deployment Nginx setup, certificates, monitoring (Prometheus/Grafana)
Warranty 2 weeks post-delivery support, bug fixes per contract
  1. Analysis – We audit the current architecture, profile bottlenecks.
  2. Design – Schemas, stack choices (PostgreSQL/Redis/Elasticsearch).
  3. Implementation – Write code, cover with unit and e2e tests.
  4. Testing – Load tests (vegeta/k6), check LCP/CLS/INP.
  5. Deployment – Deploy on your hosting (Selectel, Beget, REG.RU) or cloud.
  6. Handover – Full documentation, access, optional team training.

Timeline and Budget Estimates

  • Scaffold + DI + database: 3–5 days
  • Routes, handlers, middleware: 1–1.5 weeks
  • Services + repositories: 1–3 weeks
  • WebSocket/SSE: 3–5 days extra
  • Tests + Docker: 1 week

An API for a typical site takes 4 to 8 weeks. Budget ranges from $15,000 to $40,000 depending on complexity (e.g., real-time features, number of integrations). Proper caching can reduce infrastructure costs substantially – we've seen up to 40% monthly savings for clients. For a detailed estimate, contact us with your project scope.

Get a free engineering consultation – we'll evaluate your project within 24 hours. Contact us to discuss details.

What is included in the warranty? After project delivery, we provide 2 weeks of support during which we fix bugs and answer questions. We can extend the warranty period under a separate contract.

Backend Development Services: Laravel, Node.js, Go, Django, PostgreSQL

On a production server at 3:14 AM, the Laravel Jobs queue stopped processing. 40,000 unprocessed jobs in Redis. Cause: worker crashed due to a memory leak in one of the Jobs (leak via a static variable in an Eloquent observer), supervisor didn't restart it because of misconfigured stopwaitsecs. This is not a hypothetical scenario — it's Tuesday. We analyzed such an incident on a project with 500 RPS load: diagnosis took 4 hours, fix — 20 minutes. So you don't lose money on downtime, we offer backend development services with a focus on production-grade reliability. We'll assess your project in 2 days.

Backend is what works when no one is watching. Or doesn't work. We guarantee you'll have the first option.

How do we ensure production-grade reliability from day one?

What we do correctly from day one

Service Layer over Fat Controllers. Controller receives HTTP request, validates it via Form Request, passes data to Service, returns response. Business logic in Service, not Controller. This sounds trivial, but most legacy projects have controllers with 500 lines and SQL queries inside.

Repository Pattern we use cautiously. If you just wrap Model::where(...) in a repository method — that's boilerplate without benefit. Repository is justified when: you need to abstract from the data source (DB + cache + external API) or when query logic is complex enough to isolate.

Jobs, Events, Listeners. Everything that can be async — make async. Sending email, PDF generation, external API sync, aggregate recalculation — into Queue. Laravel Horizon for queue monitoring in Redis: see throughput, failed jobs, processing time per queue.

How Octane handles high load

Laravel Octane with RoadRunner or Swoole keeps the app in memory between requests — removes bootstrap overhead (config loading, class autoloading) on each HTTP request. Gain: 3–8x on synthetic benchmarks, 2–4x on real applications. Important: no state between requests in static variables — that leads to exactly the incidents from the beginning. We use this in projects with >1000 RPS.

What to do about N+1 queries

N+1 is the most common cause of slow pages in Laravel apps. Standard story: page worked fine on dev with 10 records, on production with 10,000 — 8-second load.

Laravel Debugbar in dev environment shows the number of queries per page. More than 20 queries per page — signal for audit.

Model::preventLazyLoading(! app()->isProduction());

Telescope for profiling in staging: logs all queries, jobs, mail, notifications with time detail. Numbers: after implementing eager loading, page load time drops from 8s to 0.3s — 27 times faster.

PostgreSQL: indexes that are actually needed

PostgreSQL 14+ is the primary DB on all projects. We use PgBouncer + PostgreSQL combination. 10+ years experience, more than 50 backend projects, 5 years on the market.

How PostgreSQL helps avoid slow queries

Composite indexes for frequent WHERE + ORDER BY. If you have WHERE user_id = ? AND status = ? ORDER BY created_at DESC — you need (user_id, status, created_at DESC). A separate index on (user_id) doesn't help much with sorting.

Partial indexes. If 95% of queries go with WHERE status = 'active':

CREATE INDEX idx_orders_active ON orders (created_at DESC)
WHERE status = 'active';

The index is small, fast, covers the main load.

GIN indexes for JSONB and arrays. @> operator without GIN index — seq scan. With index — fast even on millions of rows.

GIN for full-text search. to_tsvector + GIN instead of LIKE '%query%'. LIKE without index is always seq scan. With pg_trgm extension and gin_trgm_ops — supports LIKE with index, useful for CRM search by partial match.

Connection pooling: why it's more important than it seems

Rails, Laravel, Django open a new connection to PostgreSQL for each PHP/Python process. With 100 workers — 100 connections. PostgreSQL starts degrading from 200–300 active connections — overhead on connection management becomes significant.

PgBouncer — connection pooler in front of PostgreSQL. Transaction pooling mode: connection to PostgreSQL is occupied only during a transaction, returned to pool between requests. 1000 application workers → 20–50 actual connections to PostgreSQL. This reduces latency by 40% and hosting costs by 30%.

Node.js with Fastify: when it's better than Laravel

Node.js is justified for:

  • Realtime: WebSocket servers, Server-Sent Events, chat, live updates
  • Streaming: large files, video, streaming data
  • High I/O concurrency: many parallel requests to external APIs without heavy business logic
  • Serverless: Lambda/Cloud Functions — Node.js starts faster than PHP

Fastify over Express: 2–3 times faster on benchmarks, built-in JSON Schema validation, better TypeScript support, plugin architecture.

Typical realtime architecture: Laravel — core business logic and REST API. Node.js + Socket.io or ws — WebSocket server. Laravel publishes events to Redis Pub/Sub, Node.js subscribes and broadcasts to clients. This separation allows scaling the WebSocket server independently of the main app.

Go: microservices and high load

Go we use for:

  • High-load microservices (>10,000 RPS)
  • Background workers with strict latency requirements
  • DevOps tools and CLI
  • gRPC services in microservice architecture

Goroutines — thousands of times cheaper than OS threads. 10,000 concurrent connections on Go is normal on one server.

But Go is not a silver bullet. Development is slower than Laravel: more boilerplate, no ORM at Eloquent level, error handling with if err != nil everywhere. Justified only when performance is a real requirement, not an assumption.

Django and Python backend

Django with DRF (Django REST Framework) — for tasks where Python is needed: ML pipelines, data processing, integrations with AI tools.

Celery for background tasks — similar to Laravel Queue but more complex to configure. Celery Beat for cron tasks.

Django ORM vs raw SQL: ORM is convenient for CRUD. For analytical queries with multiple JOINs, window functions, and CTEs — connection.execute() with raw SQL is more readable and predictable.

Redis: not just cache

Redis in our projects plays multiple roles:

Role Details
Cache Caching results of heavy queries, HTML fragments
Queues Backend for Laravel Queue / Celery
Session store Distributed sessions in multi-instance environment
Pub/Sub Realtime events between services
Rate limiting Sliding window counters for API throttling
Leaderboards Sorted Sets for rankings

Redis Cluster for horizontal scaling. Sentinel for automatic failover on standalone setups.

Deployment and infrastructure

Docker + docker-compose — standard for local development and production. Each service in a container: PHP-FPM/Octane, Nginx, PostgreSQL, Redis, Queue Worker, Scheduler.

CI/CD via GitHub Actions:

  1. Run tests (PHPUnit / Pest, Vitest, Playwright)
  2. Build Docker image
  3. Push to Container Registry
  4. Deploy: docker pull → docker-compose up -d on server, or Kubernetes rolling update

Zero-downtime deploy for Laravel: php artisan down --secret=TOKEN is not needed with proper configuration. Strategy: new container starts next to the old one, Nginx switches traffic after health check, old container stops.

Monitoring: Sentry for exception tracking with alerting in Slack/Telegram. Grafana + Prometheus (or Grafana Cloud) for metrics: CPU, memory, request rate, queue depth, database connection count. Alerts on: error rate > 1%, p99 latency > 2s, queue depth > 1000 jobs.

What's included in turnkey work

  • Architecture design (API documentation, DB schema, service diagram)
  • Implementation according to agreed specification with code review
  • CI/CD, monitoring, alerting setup
  • Load testing (k6, wrk) with report
  • Handover of source code, access, deployment instructions
  • Training of customer's team (2-3 sessions)
  • Warranty support for 1 month after delivery

Timeline benchmarks

Task Timeline
REST API for mobile/SPA (medium complexity) 6–12 weeks
Backend with complex business logic + integrations 12–20 weeks
High-load service on Go 8–16 weeks
Migration from legacy PHP to Laravel 16–32 weeks

Pricing is calculated individually after analyzing load, integrations, and business logic. Contact us for a free audit of your current backend — get an optimization plan in 2 days. Request a consultation.