Kong / kong

🦍 The Cloud-Native API Gateway and AI Gateway.
https://konghq.com/install/#kong-community
Apache License 2.0
38.78k stars 4.77k forks source link

Support for ScyllaDB as alternative to Cassandra. #754

Closed sonicaghi closed 3 years ago

sonicaghi commented 8 years ago

http://www.scylladb.com/

subnetmarco commented 8 years ago

Currently this cannot be done for ScyllaDB's lack of support for counters and ALTER TABLE statements.

duarten commented 7 years ago

Just a heads up that ScyllaDB now has support for counters and ALTER TABLE.

thibaultcha commented 7 years ago

@duarten How close to the C* binary protocol (and if so, which version) is the ScyllaDB one?

duarten commented 7 years ago

@thibaultcha Scylla is compatible with v4 of the CQL binary protocol.

thibaultcha commented 7 years ago

@duarten Good to know. Thank you. I will do some initial tests with lua-cassandra.

duarten commented 7 years ago

@thibaultcha Cool, that's fast! Note that counters are available only in 1.7; packages should be available soon.

tiago-msilva commented 7 years ago

Hi all,

Great idea! Did you get to test this @thibaultcha ? Any news on this? We're highly interested in using scylladb as backend for kong.

Thank you!

dorlaor commented 7 years ago

AFAIK we needed counters to enable Kong. From 1.7 we have counters, in this release they were in --experimental mode but are just safe to use. in our upcoming release (2-3 weeks time) we'll release them in GA mode.

If you enable experimental mode, Kong should just work. Looking forward for it

On Thu, Jul 20, 2017 at 10:38 PM, tiago-msilva notifications@github.com wrote:

Hi all,

Great idea! Did you get to test this @thibaultcha https://github.com/thibaultcha ? Any news on this? We're highly interested in using scylladb as backend for kong.

Thank you!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Mashape/kong/issues/754#issuecomment-316808195, or mute the thread https://github.com/notifications/unsubscribe-auth/ABp6RXspUkZE7Px7TZVFiiXa5B0xlS5zks5sP6zDgaJpZM4GsE07 .

PAStheLoD commented 7 years ago

Hello @dorlaor ,

After enabling experimental mode, using latest docker image kong still cannot start.

scylladb/scylla     latest              1a4ad6757098        2 days ago          810MB
kong                latest              506d877085f6        7 weeks ago         319MB
INFO  2017-07-26 13:24:34,228 [shard 0] gossip - Feature COUNTERS is enabled
INFO  2017-07-26 13:24:34,230 [shard 0] gossip - Feature MATERIALIZED_VIEWS is enabled
[root@smwhr /]# KONG_NGINX_DAEMON=off kong start -vv
...
2017/07/26 13:25:39 [verbose] running datastore migrations
2017/07/26 13:25:39 [info] migrating core for keyspace kong
2017/07/26 13:25:39 [verbose] could not start Kong, stopping services
2017/07/26 13:25:39 [verbose] leaving serf cluster
2017/07/26 13:25:39 [verbose] stopped services
Error: 
/usr/local/share/lua/5.1/kong/cmd/start.lua:34: /usr/local/share/lua/5.1/kong/cmd/start.lua:21: [cassandra error] Error during migration 2015-01-12-175310_init_schema: [Server error] Indexes are not supported yet
stack traceback:  
        [C]: in function 'error'  
        /usr/local/share/lua/5.1/kong/cmd/start.lua:34: in function 'cmd_exec'
        /usr/local/share/lua/5.1/kong/cmd/init.lua:88: in function </usr/local/share/lua/5.1/kong/cmd/init.lua:88>  
        [C]: in function 'xpcall'
        /usr/local/share/lua/5.1/kong/cmd/init.lua:88: in function </usr/local/share/lua/5.1/kong/cmd/init.lua:45>
        /usr/local/bin/kong:7: in function 'file_gen'
        init_worker_by_lua:38: in function <init_worker_by_lua:36>
        [C]: in function 'pcall'
        init_worker_by_lua:45: in function <init_worker_by_lua:43>
[root@smwhr /]#
dorlaor commented 7 years ago

Oh, it seems like you use secondary indexes too. It's coming around September

subnetmarco commented 7 years ago

@dorlaor is September still the target date for secondary indexes?

dorlaor commented 7 years ago

It takes more time, in case we're super lucky, you may get an experimental version on Master at the end of Sep but it won't be production level. More details here: https://github.com/scylladb/scylla/issues/401#issuecomment-328185504

On Fri, Sep 8, 2017 at 2:38 PM, Marco Palladino notifications@github.com wrote:

@dorlaor https://github.com/dorlaor is September still the target date for secondary indexes?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Mashape/kong/issues/754#issuecomment-328220087, or mute the thread https://github.com/notifications/unsubscribe-auth/ABp6RfVZS033V2INojBgZEcRotghnaFxks5sgbPmgaJpZM4GsE07 .

lgalabru commented 6 years ago

Hello there! What's the status/ETA for the compatibility with ScillaDB?

dorlaor commented 6 years ago

The secondary index feature is now committed in master but in experimental mode and it will practically take till the end of the year to make it usable with Kong. Thanks for your patient, we're doing our best

lgalabru commented 6 years ago

@dorlaor thank you! I want to deploy Kong, and I'm also looking for a way to avoid maintaining a Cassandra infra. I was looking at ScillaDB because Compose have an affordable plan for this (https://www.compose.com/databases/scylladb). What would you recommend?

dorlaor commented 6 years ago

Sure, compose are a very good DBaaS solution

mrusme commented 6 years ago

Any status-update on this? Thinking about using Kong for https://github.com/twostairs/paperwork/tree/2 since I already planned using ScyllaDB as its main database.

subnetmarco commented 6 years ago

@mrusme Kong supports Cassandra 2.x, so as long as Scylla implemented the missing features Kong should work with it. In particular I remember we were waiting for secondary indexes and ALTER TABLE functionality. If you try it please let me know if it works, so I can update the status of this ticket.

dorlaor commented 6 years ago

Scylla 2.1 (now at RC3 state) supports secondary indexes in experimental mode, it means you need to simply enable it in the yaml file. We support ALTER TABLE for a long while so it's worth to give it a try

On Thu, Feb 8, 2018 at 4:05 PM, Marco Palladino notifications@github.com wrote:

@mrusme https://github.com/mrusme Kong supports Cassandra 2.x, so as long as Scylla implemented the missing features Kong should work with it. In particular I remember we were waiting for secondary indexes and ALTER TABLE functionality. If you try it please let me know if it works, so I can update the status of this ticket.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Kong/kong/issues/754#issuecomment-364291277, or mute the thread https://github.com/notifications/unsubscribe-auth/ABp6RZPJumXhaXpp1D86wrA4ITOdWWFFks5tS4vegaJpZM4GsE07 .

mrusme commented 6 years ago

@thefosk @dorlaor thanks for getting back so quickly! I just took the default docker-compose.yml that Kong provides and replaced the PostgreSQL/Cassandra setup with the latest ScyllaDB RC I could find, running with --experimental 1. Here's the file. However, I'm getting this error when trying to run it:

kong-database_1   | INFO  2018-02-10 14:39:28,317 [shard 0] database - Schema version changed to 272d9a48-63cb-37b9-8d2b-cf03b38e68a0
kong-migration_1  | Error: [cassandra error] Error during migration 2017-05-19-173100_remove_nodes_table: [Invalid] Cannot drop table when materialized views still depend on it (kong.{nodes_cluster_listening_address_idx_index})

So apparently the INDEX feature works, but now some issue inside the migration is blocking. I'm not sure whether that's a Scylla issue or the migration is not functioning properly, as I haven't tested the original docker-compose.yml using Cassandra. Maybe you guys could have a look?

Here's the full log.

duarten commented 6 years ago

This is probably a bug in Scylla, where indexes are based on Materialized Views. Tables for which there exists a MV can't be dropped until all the MV is dropped, but I guess there isn't such a restriction for indexes. /cc @penberg

penberg commented 6 years ago

@duarten Indeed. I opened a ticket for this: https://github.com/scylladb/scylla/issues/3202

brandonlamb commented 6 years ago

👍 for interest in using ScyllaDB for Kong. I'm stuck on Index support is not enabled, sounds like based on above comment that it's not quite working yet.

dorlaor commented 6 years ago

It's still experimental feature. I just checked that if you enable experimental flag you can use it:

sudo docker run --name some-scylla1 -d scylladb/scylla --experimental 1

or in the yaml file

On Tue, Feb 27, 2018 at 1:08 AM, Brandon Lamb notifications@github.com wrote:

👍 for interest in using ScyllaDB for Kong. I'm stuck on Index support is not enabled, sounds like based on above comment that it's not quite working yet.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Kong/kong/issues/754#issuecomment-368798116, or mute the thread https://github.com/notifications/unsubscribe-auth/ABp6RZcW-BYLMjMcbVcwWWiArR6zTsalks5tY8YEgaJpZM4GsE07 .

IgorBMSTU commented 6 years ago

I'm looking forward to it

mrusme commented 6 years ago

So, apparently this issue was (partially?) solved in https://github.com/scylladb/scylla/issues/3202 At least @psarna wrote that the dropping of keyspaces/tables with active secondary indexes might be something that should be split into two issues.

However, should this be re-tested already with the latest Scylla docker image? Could anyone from Scyalle ping me as soon as I could try again, so I can report back if the Scylla now successfully works with Kong? :)

Thanks a lot!

psarna commented 6 years ago

@mrusme for the record, I suggested in scylladb/scylla#3202 that it should be split into two, but meanwhile I made patches for both problems, so hopefully they should be totally solved.

mrusme commented 6 years ago

Thanks and sorry for the long delay. I can confirm that Kong is now successfully migrating on ScyllaDB 2.2.0! I guess this issue can be closed. 👍

//edit: I've implemented a running version within https://github.com/twostairs/paperwork/blob/master/docker-compose.infrastructure.yml#L85 using the official ScyllaDB docker image, just in case anyone is interested.

brandonlamb commented 6 years ago

Whoo! Nice, now we can check this out. pgsql has worked fine for us, but we wanted to move more to scylla

mrusme commented 6 years ago

Unfortunately I was a bit to hasty: https://github.com/Kong/kong/issues/3695

mrusme commented 6 years ago

That's what we're now waiting for: https://github.com/scylladb/scylla/issues/1359

thibaultcha commented 5 years ago

Anybody from ScyllaDB could shed some light on what happened to scylla-ccm? I find mentions of it here: https://github.com/scylladb/scylla/wiki/Using-CCM, but the repository does not exist anymore (https://github.com/scylladb/scylla-ccm). The lua-cassandra driver depends on ccm for its integration test suite, and I was hoping minimal amount of changes would be required to setup a ScyllaDB test job.

dorlaor commented 5 years ago

It was private and I just opened it up (was a good opportunity :)

On Sat, Sep 22, 2018 at 11:06 AM Thibault Charbonnier < notifications@github.com> wrote:

Anybody from ScyllaDB could shed some light on what happened to scylla-ccm? I find mentions of it here: https://github.com/scylladb/scylla/wiki/Using-CCM, but the repository does not exist anymore (https://github.com/scylladb/scylla-ccm). The lua-cassandra https://github.com/thibaultcha/lua-cassandra driver depends on ccm https://github.com/pcmanus/ccm for its integration test suite, and I was hoping minimal amount of changes would be required to setup a ScyllaDB test job.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Kong/kong/issues/754#issuecomment-423762538, or mute the thread https://github.com/notifications/unsubscribe-auth/ABp6RRvu9sLb4E0ZJeomxwT1F1um0B3oks5udnwigaJpZM4GsE07 .

thibaultcha commented 5 years ago

@dorlaor Thank you :)

jeremyjpj0916 commented 5 years ago

Support for Scylla db still underway in Kong? The crazy advertised perf compared to C certainly piqued my interest(haven't tried a local benchmark myself yet). Would be awesome if there was a way to export a Kong C keyspace and populate scylla db in a migration process if it ever becomes the defacto choice for the db backing of an HA Kong cluster.

subnetmarco commented 5 years ago

@jeremyjpj0916 Kong supports Cassandra, and we were waiting on some missing features on Scylla's side to be completed in order to be able to support it. It's been a long time since I have given it a try, perhaps it now works with the latest version of Scylla.

brandonlamb commented 5 years ago

Disclaimer: not being cheeky

FYI - Kong has added DB-less configuration, using declarative yaml configs. If your use-case supports it, you may be able to create automation and simply pass Kong a config file.

My team has switched to this, we have between 70-80 microservices with routes/services for them all in yaml. No more PostgreSQL management, migrations, or needing persistence.

The cons of course are not being able to make on-the-fly configuration changes.

Just something to be aware of/check out

jeremyjpj0916 commented 5 years ago

@subnetmarco its funny I had a chat with a scylla db rep yesterday on linkedin asking me about our C* usecase. Apparently the only thing missing from scylla modern Kong needs now is lightweight tx: https://github.com/Kong/kong/issues/3695

The guy mentioned they expect it to be done in their 2019 roadmap(but also said no promises, seems they are shooting for November for beta release) so we will see.

@brandonlamb I agree db-less is ideal and more performant, but when you already leverage Kong with auth patterns db-less can't support(say Kong OAuth2 plugin). Then a DB stays a requirement.

dorlaor commented 5 years ago

Indeed LWT is the last item which is missing, we're working on it at it should arrive towards the end of 2019

On Tue, Jun 4, 2019 at 7:16 AM jeremyjpj0916 notifications@github.com wrote:

@subnetmarco https://github.com/subnetmarco its funny I had a chat with a scylla db rep yesterday on linkedin asking me about our C* usecase. Apparently the only thing missing from scylla modern Kong needs now is lightweight tx:

3695 https://github.com/Kong/kong/issues/3695

The guy mentioned they expect it to be done in their 2019 roadmap(but also said no promises) so we will see.

@brandonlamb https://github.com/brandonlamb I agree db-less is ideal and generally more performant, but when you already leverage Kong with auth patterns db-less can't support(say Kong OAuth2 plugin). Then a DB stays a requirement.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Kong/kong/issues/754?email_source=notifications&email_token=AANHUROC66QUYDWXKTCZK23PYZ2MJA5CNFSM4BVQJU52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODW4WTWI#issuecomment-498690521, or mute the thread https://github.com/notifications/unsubscribe-auth/AANHUROYCTUB45PWRS46NV3PYZ2MJANCNFSM4BVQJU5Q .

jeremyjpj0916 commented 4 years ago

As promised scylla db delivered on lightweight tx merged to master close to end of 2019: https://github.com/scylladb/scylla/issues/1359#issuecomment-547554581

I suppose Kong could integrate with it now as a new 3rd db type to support. I noticed they do have some follow up optimizations and features opened on another git issue. Will be interested in some db performance comparisons between Kong on Scylla vs Cassandra in the future at scale.

gnumoreno commented 4 years ago

I just tested scylla 3.3 with experimental features enabled

I followed https://hub.docker.com/_/kong and https://docs.konghq.com/2.0.x/getting-started/configuring-a-service/

And it seem to work out the box.

On docker:

docker run --rm \
    --network="docker_scylla_net" \
    --ip="172.19.0.10" \
    -e "KONG_DATABASE=cassandra" \
    -e "KONG_CASSANDRA_CONTACT_POINTS=172.19.0.2" \
    kong kong migrations bootstrap
docker run -d --name kong \
    --network="docker_scylla_net" \
    --ip="172.19.0.10" \
    -e "KONG_DATABASE=cassandra" \
    -e "KONG_CASSANDRA_CONTACT_POINTS=172.19.0.2" \
    -e "KONG_PROXY_ACCESS_LOG=/dev/stdout" \
    -e "KONG_ADMIN_ACCESS_LOG=/dev/stdout" \
    -e "KONG_PROXY_ERROR_LOG=/dev/stderr" \
    -e "KONG_ADMIN_ERROR_LOG=/dev/stderr" \
    -e "KONG_ADMIN_LISTEN=0.0.0.0:8001, 0.0.0.0:8444 ssl" \
    -p 8000:8000 \
    -p 8443:8443 \
    -p 8001:8001 \
    -p 8444:8444 \
    kong
curl -i -X POST \
  --url http://localhost:8001/services/ \
  --data 'name=example-service' \
  --data 'url=http://mockbin.org'

HTTP/1.1 201 Created
Date: Tue, 05 May 2020 23:56:13 GMT
Content-Type: application/json; charset=utf-8
Connection: keep-alive
Access-Control-Allow-Origin: *
Server: kong/2.0.4
Content-Length: 296
X-Kong-Admin-Latency: 190

{"host":"mockbin.org","created_at":1588722973,"connect_timeout":60000,"id":"f161be66-6e3a-446b-bbf9-476273c97c46","protocol":"http","name":"example-service","read_timeout":60000,"port":80,"path":null,"updated_at":1588722973,"retries":5,"write_timeout":60000,"tags":null,"client_certificate":null}
curl -i -X POST \
  --url http://localhost:8001/services/example-service/routes \
  --data 'hosts[]=example.com'

HTTP/1.1 201 Created
Date: Tue, 05 May 2020 23:56:35 GMT
Content-Type: application/json; charset=utf-8
Connection: keep-alive
Access-Control-Allow-Origin: *
Server: kong/2.0.4
Content-Length: 429
X-Kong-Admin-Latency: 35

{"id":"2e71adc1-9288-4158-82f8-bbc51a396c8a","path_handling":"v0","paths":null,"destinations":null,"headers":null,"protocols":["http","https"],"methods":null,"snis":null,"service":{"id":"f161be66-6e3a-446b-bbf9-476273c97c46"},"name":null,"strip_path":true,"preserve_host":false,"regex_priority":0,"updated_at":1588722995,"sources":null,"hosts":["example.com"],"https_redirect_status_code":426,"tags":null,"created_at":1588722995}
curl -i -X GET \
  --url http://localhost:8000/ \
  --header 'Host: example.com'

HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Content-Length: 10695
Connection: keep-alive
Server: Cowboy
Etag: W/"29c7-XG+PICJmz/J+UYWt5gkKqqAUXjc"
Vary: Accept-Encoding
Date: Tue, 05 May 2020 23:56:55 GMT
Via: kong/2.0.4
X-Kong-Upstream-Status: 200
X-Kong-Upstream-Latency: 327
X-Kong-Proxy-Latency: 321
Kong-Cloud-Request-ID: 6ca1df0741376c822e03108a2ca79df5

<!DOCTYPE html><html><head><meta charset="utf-8"><title>Mockbin by Kong</title><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"><link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.4/css/bootstrap.min.css" media="all"><link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Open+Sans:400,600|Source+Code+Pro:200,300,400,500,600,700,900" media="all"><link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.css" media="all"><link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css" media="all"><link rel="stylesheet" type="text/css" href="/static/main.css" media="all"><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.4/js/bootstrap.min.js"></script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/zeroclipboard/2.2.0/ZeroClipboard.min.js"></script><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="robots" content="index,follow"><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"><meta itemprop="name" content="Mockbin by Kong"><meta property="og:title" content="Mockbin by Kong"><meta name="twitter:title" content="Mockbin by Kong"><link rel="author" href="https://www.mashape.com/"><meta name="author" content="Kong"><meta name="twitter:creator" content="@thekonginc"><meta name="description" content="Mockbin allows you to generate custom endpoints to test, mock, and track HTTP requests &amp; responses between libraries, sockets and APIs. Made with Love by Kong."><meta itemprop="description" content="Mockbin allows you to generate custom endpoints to test, mock, and track HTTP requests &amp; responses between libraries, sockets and APIs. Made with Love by Kong."><meta property="og:description" content="Mockbin allows you to generate custom endpoints to test, mock, and track HTTP requests &amp; responses between libraries, sockets and APIs. Made with Love by Kong."><meta name="twitter:description" content="Mockbin allows you to generate custom endpoints to test, mock, and track HTTP requests &amp; responses between libraries, sockets and APIs. Made with Love by Kong."><meta itemprop="image" content="https://mockbin.org/public/share.png"><meta property="og:image" content="https://mockbin.org/public/share.png"><meta name="twitter:image:src" content="https://mockbin.org/public/share.png"><meta name="twitter:card" content="summary_large_image"><meta name="twitter:site" content="@mashape"><meta name="twitter:domain" content="mockbin.org"><link rel="canonical" href="http://mockbin.org/"><meta name="twitter:url" content="http://mockbin.org/"><meta property="og:url" content="http://mockbin.org/"><meta property="og:type" content="website"><meta property="og:site_name" content="Mockbin by Kong"><meta property="fb:admins" content="227304446"><meta property="fb:admins" content="576641408"><link rel="shortcut icon" href="/public/favicon.ico"><link rel="icon" type="image/x-icon" href="/public/favicon.ico"><link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,800,700,600,300|Source+Code+Pro:200,300,400,500,600,700,900" media="all"><link rel="stylesheet" type="text/css" href="/public/style.css" media="all"><meta name="google-site-verification" content="OIx3DxcNRJ_Kyd7hAtGRhZnggKpv6DRWutY7Ih9R3Ww"></head><body><header><nav class="navbar navbar-default"><div class="container"><div class="navbar-header"><button type="button" data-toggle="collapse" data-target="#navbar" class="navbar-toggle collapsed"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><div class="navbar-brand logo"><span><a href="/"><span class="logo fa fa-terminal"></span> mockbin</a> <span class="text-muted">by <a href="https://www.konghq.com">Kong</a></span></span></div></div><div id="navbar" class="collapse navbar-collapse"><ul class="nav navbar-nav navbar-right"><li><a href="/docs">Docs</a></li><li><a href="/bin/create">Create Bin</a></li><li><a href="https://github.com/Kong/mockbin">Github</a></li></ul></div></div></nav></header><div class="home"><div class="showcase"><div class="container"><h1>Mockbin</h1><p class="col-lg-offset-2 col-lg-8 lead">Mockbin allows you to generate <a href="/bin/create">custom endpoints</a> to test, mock, and track HTTP requests &amp; responses between libraries, sockets and APIs.</p></div></div><div class="container"><div class="btn-toolbar"><a href="/bin/bbe7f656-12d6-4877-9fa8-5cd61f9522a9/view" class="btn btn-primary">View Sample Bin</a><a href="/bin/create" class="btn btn-success">Create Bin</a><a href="#example" class="btn btn-primary hidden-xs">Send a Request</a></div><hr><h2 class="text-center">Feature Highlights</h2><div class="row features"><div class="col-md-6"><div class="media"><div class="media-left"><img src="/public/friendly.png" class="media-object"></div><div class="media-body"><h4 class="media-heading">Mock Custom Endpoints</h4><p>Mock custom endpoints using any <a href="https://ahmadnassri.github.io/har-resources/" target="_blank">HTTP Archive (HAR)</a> response object <em>(can be used as webhooks, api mocks, or anything you want!)</em></p><p><a href="/docs">Learn More <span class="fa fa-angle-right"></span></a></p></div></div><div class="media"><div class="media-left"><img src="/public/formats.png" class="media-object"></div><div class="media-body"><h4 class="media-heading">JSON, XML, YAML, HTML</h4><p>Don't like JSON? No problem! Mockbin supports output in JSON, YAML and XML, as well as an HTML view for in-browser testing</p><p><a href="/docs#content-negotiation">Learn More <span class="fa fa-angle-right"></span></a></p></div></div><div class="media"><div class="media-left"><img src="/public/history.png" class="media-object"></div><div class="media-body"><h4 class="media-heading">Log and Inspect Calls</h4><p>Log and inspect incoming calls to your custom endpoints <em>(get detailed view to how clients are calling your api/webhook)</em></p><p><a href="/docs">Learn More <span class="fa fa-angle-right"></span></a></p></div></div></div><div class="col-md-6"><div class="media"><div class="media-left"><img src="/public/mock.png" class="media-object"></div><div class="media-body"><h4 class="media-heading">Custom HTTP Method</h4><p>No longer are you limited to <code>GET</code> &amp; <code>POST</code>, Mockbin accepts all standard Methods and allows method overriding</p><p><a href="/docs#http-methods">Learn More <span class="fa fa-angle-right"></span></a></p></div></div><div class="media"><div class="media-left"><img src="/public/inspect.png" class="media-object"></div><div class="media-body"><h4 class="media-heading">CORS Headers</h4><p>Debug your front-end JavaScript HTTP calls from any domain, Mockbin will dynamically generate Cross-Origin resource sharing headers</p><p><a href="/docs">Learn More <span class="fa fa-angle-right"></span></a></p></div></div><div class="media"><div class="media-left"><img src="/public/har.png" class="media-object"></div><div class="media-body"><h4 class="media-heading">HTTP Archive (HAR)</h4><p>Mockbin relies on the popular <a href="https://ahmadnassri.github.io/har-resources/" target="_blank">HTTP Archive (HAR)</a> format to create mock endpoints (Bins), import data and describe HTTP call logs.</p><p><a href="/docs">Learn More <span class="fa fa-angle-right"></span></a></p></div></div></div></div><hr><h2 class="text-center">Test using your preferred language:</h2><iframe id="example" src="https://api.apiembed.com/?source=http://mockbin.org/public/samples/request.json&amp;targets=all" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" width="100%" height="500" seamless class="embed"></iframe></div></div><footer class="hidden-xs"><nav class="navbar navbar-default navbar-fixed-bottom"><div class="container"><div class="navbar-text"><a href="https://github.com/Kong/mockbin" data-icon="octicon-star" data-count-href="/Kong/mockbin/stargazers" data-count-api="/repos/Kong/mockbin#stargazers_count" class="github-button">Star</a><span>&nbsp;</span><a href="https://github.com/Kong/mockbin" data-icon="octicon-eye" data-count-href="/Kong/mockbin/watchers" data-count-api="/repos/Kong/mockbin#subscribers_count" class="github-button">Watch</a><span>&nbsp;</span><a href="https://github.com/Kong/mockbin/issues" data-icon="octicon-issue-opened" data-count-api="/repos/Kong/mockbin#open_issues_count" class="github-button">Issue</a></div><div class="nav navbar-right navbar-text hidden-xs"><a href="https://twitter.com/share" data-url="http://mockbin.org" data-via="thekonginc" data-related="thekonginc" data-hashtags="Mock, Test, Track, HTTP" data-dnt="true" class="twitter-share-button">Tweet</a><span>&nbsp;</span></div></div></nav></footer><script type="text/javascript" id="twitter-wjs" src="https://platform.twitter.com/widgets.js" async defer></script><script type="text/javascript" id="github-bjs" src="https://buttons.github.io/buttons.js" async defer></script><script type="text/javascript" src="//Kong.github.io/notification-bar/embed.js" async defer></script><script type="text/javascript">!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","group","track","ready","alias","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t){var e=document.createElement("script");e.type="text/javascript";e.async=!0;e.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)};analytics.SNIPPET_VERSION="3.0.1";
  analytics.load('tUiM2iBCz991uF4rDF0a4WSr6NEjiVuU');
  analytics.page()
}}();</script></body></html>

Let me know if there is anything else I can help with.

dorlaor commented 4 years ago

Super! Our 4.0 is almost out of the gate, folks can try 4.0.rc3, it works w/o experimental mode

On Tue, May 5, 2020 at 5:14 PM Moreno Garcia e Silva < notifications@github.com> wrote:

I just tested scylla 3.3 with experimental features https://docs.scylladb.com/operating-scylla/scylla-yaml/#enabling-experimental-features enabled

I followed https://hub.docker.com/_/kong and https://docs.konghq.com/2.0.x/getting-started/configuring-a-service/

And it seem to work out the box.

On docker:

docker run --rm \ --network="docker_scylla_net" \ --ip="172.19.0.10" \ -e "KONG_DATABASE=cassandra" \ -e "KONG_CASSANDRA_CONTACT_POINTS=172.19.0.2" \ kong kong migrations bootstrap

docker run -d --name kong \ --network="docker_scylla_net" \ --ip="172.19.0.10" \ -e "KONG_DATABASE=cassandra" \ -e "KONG_CASSANDRA_CONTACT_POINTS=172.19.0.2" \ -e "KONG_PROXY_ACCESS_LOG=/dev/stdout" \ -e "KONG_ADMIN_ACCESS_LOG=/dev/stdout" \ -e "KONG_PROXY_ERROR_LOG=/dev/stderr" \ -e "KONG_ADMIN_ERROR_LOG=/dev/stderr" \ -e "KONG_ADMIN_LISTEN=0.0.0.0:8001, 0.0.0.0:8444 ssl" \ -p 8000:8000 \ -p 8443:8443 \ -p 8001:8001 \ -p 8444:8444 \ kong

curl -i -X POST \ --url http://localhost:8001/services/ \ --data 'name=example-service' \ --data 'url=http://mockbin.org'

HTTP/1.1 201 Created Date: Tue, 05 May 2020 23:56:13 GMT Content-Type: application/json; charset=utf-8 Connection: keep-alive Access-Control-Allow-Origin: * Server: kong/2.0.4 Content-Length: 296 X-Kong-Admin-Latency: 190

{"host":"mockbin.org","created_at":1588722973,"connect_timeout":60000,"id":"f161be66-6e3a-446b-bbf9-476273c97c46","protocol":"http","name":"example-service","read_timeout":60000,"port":80,"path":null,"updated_at":1588722973,"retries":5,"write_timeout":60000,"tags":null,"client_certificate":null}

curl -i -X POST \ --url http://localhost:8001/services/example-service/routes \ --data 'hosts[]=example.com'

HTTP/1.1 201 Created Date: Tue, 05 May 2020 23:56:35 GMT Content-Type: application/json; charset=utf-8 Connection: keep-alive Access-Control-Allow-Origin: * Server: kong/2.0.4 Content-Length: 429 X-Kong-Admin-Latency: 35

{"id":"2e71adc1-9288-4158-82f8-bbc51a396c8a","path_handling":"v0","paths":null,"destinations":null,"headers":null,"protocols":["http","https"],"methods":null,"snis":null,"service":{"id":"f161be66-6e3a-446b-bbf9-476273c97c46"},"name":null,"strip_path":true,"preserve_host":false,"regex_priority":0,"updated_at":1588722995,"sources":null,"hosts":["example.com"],"https_redirect_status_code":426,"tags":null,"created_at":1588722995}

curl -i -X GET \ --url http://localhost:8000/ \ --header 'Host: example.com'

HTTP/1.1 200 OK Content-Type: text/html; charset=utf-8 Content-Length: 10695 Connection: keep-alive Server: Cowboy Etag: W/"29c7-XG+PICJmz/J+UYWt5gkKqqAUXjc" Vary: Accept-Encoding Date: Tue, 05 May 2020 23:56:55 GMT Via: kong/2.0.4 X-Kong-Upstream-Status: 200 X-Kong-Upstream-Latency: 327 X-Kong-Proxy-Latency: 321 Kong-Cloud-Request-ID: 6ca1df0741376c822e03108a2ca79df5

<!DOCTYPE html>Mockbin by Kong

Mockbin

Mockbin allows you to generate custom endpoints to test, mock, and track HTTP requests & responses between libraries, sockets and APIs.


Feature Highlights

Mock Custom Endpoints

Mock custom endpoints using any HTTP Archive (HAR) response object (can be used as webhooks, api mocks, or anything you want!)

Learn More

JSON, XML, YAML, HTML

Don't like JSON? No problem! Mockbin supports output in JSON, YAML and XML, as well as an HTML view for in-browser testing

Learn More

Log and Inspect Calls

Log and inspect incoming calls to your custom endpoints (get detailed view to how clients are calling your api/webhook)

Learn More

Custom HTTP Method

No longer are you limited to GET & POST, Mockbin accepts all standard Methods and allows method overriding

Learn More

CORS Headers

Debug your front-end JavaScript HTTP calls from any domain, Mockbin will dynamically generate Cross-Origin resource sharing headers

Learn More

HTTP Archive (HAR)

Mockbin relies on the popular HTTP Archive (HAR) format to create mock endpoints (Bins), import data and describe HTTP call logs.

Learn More


Test using your preferred language:

Let me know if there is anything else I can help with.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Kong/kong/issues/754#issuecomment-624373235, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANHURP7PSU5UDWTBQVR2VDRQCTWHANCNFSM4BVQJU5Q .

jeremyjpj0916 commented 4 years ago

Super cool, I will be interested to hear what the preliminary performance comparison is with Kong + Scylla cluster vs Kong + Cassandra in terms of read and write performance(with strict consistency settings and full replication in a 6 node cluster) and general CPU + Mem utilization. Later down the road I may be able to do such perf tests myself as long as cloning my existing C* cluster to a Scylla cluster is fairly straight forward.

Also just genuinely curious on the Kong admin API resource creation up to 10k + services and routes and consumers and plugins individually show any issues around paging or all is dandy on read and writes with it in a realistic network environment. thanks @dorlaor and @gnumoreno for testing, this has been in my todo list as an interesting possibility to cut over as a Kong community user.

rsbrisci commented 4 years ago

@jeremyjpj0916 thanks for sharing this; yeah - I think it's safe to say we'll be giving this a tryout in sandbox. Might be able to share pretty "before & after"'s!

dorlaor commented 4 years ago

@jeremyjpj0916 @rsbrisci how's your setup looks like in terms of C cluster size/hardware? Also, in C, you need to configure the commitlog_sync value from periodic to group or to batch? Otherwise the LWT transactions are exposed to a loss on a node crash. Scylla automatically flashes the commit log to disk on every LWT operation, so nothing needs to be done but it may have some performance penalty with certain disks that are slow to flash. I'm mainly wondering whether it's common knowledge or not

jeremyjpj0916 commented 4 years ago

@dorlaor if you have an email or such feel free to shoot me one and I can give you some insights, jeremyjustus0916@gmail.com . This effort to experiment with ScyllaDB would not be a priority to us for a few months though likely but good to have the insights needed beforehand. Right now we run plain Apache opensource 3.x C, haven't had too many issues, there is some latency involved, especially when we run a nightly cluster repair cron, and there are the occasional timeouts randomly in the day that don't even seem to correlate with high utilization which I have always found odd but no major complaints with C.

We did not modify the commitlog_sync value and I do see its still default periodic and 10 seconds, my understanding is if all replicas fail we would lose 10 seconds of data, and to change would be slightly more costly on latency. 10 seconds of data is within our tolerance level, and we have such high replication and LOCAL_QUORUM read/writes I am not too concerned atm.

We run 6 node cluster 3 per DC w full replication, some output logs for yah: Each node gets 2 CPU and 8 GB RAM + 32 GB partition default and then we tack on a 30GB /data partition for C* data and a 10GB partiton for /logs

CREATE KEYSPACE kong_dev WITH replication = {'class': 'NetworkTopologyStrategy', 'DC1': '3', 'DC2': '3'}  AND durable_writes = true;

# nodetool status
Datacenter: DC1
===============
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address         Load       Tokens       Owns (effective)  Host ID                               Rack
UN  10.xxx.xx.xxx   30.52 MiB  256          100.0%            de44f0ea-9ac4-4bef-ac05-c92926e6fc89  RACK3
UN  10.xxx.xx.xxx   31.29 MiB  256          100.0%            42f16255-69c6-4aee-b39e-6f2c97513e56  RACK1
UN  10.xxx.xx.xxx   29.55 MiB  256          100.0%            b62d5d30-0b88-4dd6-b1c1-4f800606a562  RACK4

Datacenter: DC2
===============
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address         Load       Tokens       Owns (effective)  Host ID                               Rack
UN  10.xxx.xx.xxx   28.13 MiB  256          100.0%            121e6024-092f-426d-af0d-a4af99b6e16b  RACK5
UN  10.xxx.xx.xxx   28.68 MiB  256          100.0%            f340733a-8641-4ed7-b489-0b4174eba29b  RACK6
UN  10.xxx.xx.xxx   28.88 MiB  256          100.0%            398341d8-b5f9-4004-b2ce-3a0322c30821  RACK2

The reason we run such a high RF and we also as a client to C* with Kong run LOCAL_QUORUM can be seen here, due to the OAuth2.0 CC grant flow, discussion with their principle engineer can be found here, ideally would have our clients(Kong) be doing consistency of ONE for lower latency but alas:

https://discuss.konghq.com/t/question-on-db-configuration-setup-kong-v-0-14-c/1620/5?u=jeremyjpj0916

So essentially what would make me switch would be better stability(no more odd timeouts) and faster read+writes given the above conditions and cluster size. Not having to worry about java versions and the JVM is another + in my mind with Scylla. Essentially the DBs heaviest r/w logic from our perspective comes from OAuth2.0 token generation calls, which we get many millions in a day because people don't know how to cache and reuse a token properly 😄 .

Then the very last thing that crossed my mind(after seeing that LWT has been solved) as a DBA for our Kong cluster would be the db backup process. ScyllaDB needs to give me a way to do DB backups and restores like C does, I use a tool called Cassandra Snapshot currently: https://github.com/tbarbugli/cassandra_snapshotter (to store to our internal S3 buckets), hopefully ScyllaDB has something similar or the code that does it for C can work with ScyllaDB too. Kong implemented a native backup process using their Admin API I am interested in moving towards anyways, I imagine that would also be compatible with ScyllaDB likely too.

Don't want to clog up the Kong git issue with our specific discussion though so we can continue via email if you like, hopefully these details gives you the insight you wanted. Looking forward to testing ScyllaDB in a bit and seeing how it compares to our existing, hopefully it super charges our Kong instance 👍 .

Best, Jeremy

dorlaor commented 4 years ago

Thanks for the detailed response Jeremy. Scylla's paxos has only 3 round trips, so the latency will improve. We by default do flush LWT commit logs so it may have a negative effect, it depends on the disk controller used, anyway, it's possible to instruct Scylla not to do it.

Our snapshot/backup/restore process is similar to Cassandra, so your existing tool has a high chance of working unmodified. If not, Scylla manager supports it too.

On Sun, May 10, 2020 at 10:38 PM jeremyjpj0916 notifications@github.com wrote:

@dorlaor if you have an email or such feel free to shoot me one and I can give you some insights, jeremyjustus0916@gmail.com . This effort to experiment with ScyllaDB would not be a priority to us for a few months though likely but good to have the insights needed beforehand. Right now we run plain Apache opensource 3.x C, haven't had too many issues, there is some latency involved, especially when we run a nightly cluster repair cron, and there are odd timeouts periodically in parts of the day that don't even seem to correlate with high utilization which I have always found odd but no major complaints with C.

We did not modify the commitlog_sync value and I do see its still default periodic and 10 seconds, my understanding is if all replicas fail we would lose 10 seconds of data, and to change would be slightly more costly on latency. 10 seconds of data is within our tolerance level, and we have such high replication and LOCAL_QUORUM read/writes I am not too concerned atm.

We run 6 node cluster 3 per DC w full replication, some output logs for yah:

CREATE KEYSPACE kong_dev WITH replication = {'class': 'NetworkTopologyStrategy', 'DC1': '3', 'DC2': '3'} AND durable_writes = true;

nodetool status

Datacenter: DC1

===============

Status=Up/Down

|/ State=Normal/Leaving/Joining/Moving

-- Address Load Tokens Owns (effective) Host ID Rack

UN 10.xxx.xx.xxx 30.52 MiB 256 100.0% de44f0ea-9ac4-4bef-ac05-c92926e6fc89 RACK3

UN 10.xxx.xx.xxx 31.29 MiB 256 100.0% 42f16255-69c6-4aee-b39e-6f2c97513e56 RACK1

UN 10.xxx.xx.xxx 29.55 MiB 256 100.0% b62d5d30-0b88-4dd6-b1c1-4f800606a562 RACK4

Datacenter: DC2

===============

Status=Up/Down

|/ State=Normal/Leaving/Joining/Moving

-- Address Load Tokens Owns (effective) Host ID Rack

UN 10.xxx.xx.xxx 28.13 MiB 256 100.0% 121e6024-092f-426d-af0d-a4af99b6e16b RACK5

UN 10.xxx.xx.xxx 28.68 MiB 256 100.0% f340733a-8641-4ed7-b489-0b4174eba29b RACK6

UN 10.xxx.xx.xxx 28.88 MiB 256 100.0% 398341d8-b5f9-4004-b2ce-3a0322c30821 RACK2

The reason we run such a high RF and we also as a client to C* with Kong run LOCAL_QUORUM can be seen here, due to the OAuth2.0 CC grant flow, discussion with their principle engineer can be found here, Ideally would have our clients be doing consistency of ONE for lower latency but alas:

https://discuss.konghq.com/t/question-on-db-configuration-setup-kong-v-0-14-c/1620/5?u=jeremyjpj0916

So essentially what would make me switch would be better stability(no more odd timeouts) and faster read+writes given the above conditions and cluster size. Not having to worry about java versions and the JVM is another + in my mind with Scylla. Essentially the DBs heaviest r/w logic from our perspective comes from OAuth2.0 token generation calls, which we get many millions in a day because people don't know how to cache and reuse a token properly .

Then the very last thing that crossed my mind(after seeing that LWT has been solved) as a DBA for our Kong cluster would be the db backup process. ScyllaDB needs to give me a way to do DB backups and restores like C does, I use a tool called Cassandra Snapshot currently: https://github.com/tbarbugli/cassandra_snapshotter (to store to our internal S3 buckets), hopefully ScyllaDB has something similar or the code that does it for C can work with ScyllaDB too. Kong implemented a native backup process using their Admin API I am interested in moving towards anyways, I imagine that would also be compatible with ScyllaDB likely too.

Don't want to clog up the Kong git issue with our specific discussion though so we can continue via email if you like, hopefully these details gives you the insight you wanted. Looking forward to testing ScyllaDB in a bit and seeing how it compares to our existing, hopefully it super charges our Kong instance .

Best, Jeremy

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.