Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Apache APISIX without etcd

Posted on Jul 27 • Originally published at blog.frankel.ch etcd is an excellent key-value distributed database used internally by Kubernetes and managed by the CNCF. It's a great option, and that's the reason why Apache Apisix uses it too. Yet, it's not devoid of issues.First, some mention scalability, but one can expect this from a distributed data store that values consistency. Another issue may be the need for more familiarity with etcd. It's relatively new, so your Ops team may need help operating it correctly while having decades of operating MySQL or Postgres. Finally, only a few etcd users are aware that it lacks maintainers:In the last few months, primary maintainers G.L. (Amazon, announcement) and S.B. (Red Hat) have stopped actively participating in the project. This leaves the project with only one active and two occasionally-reviewing maintainers, M.S. (Google), P.T. (Google), both are relatively new to the project (1 month and 1 year of tenure) and S.P.Z. (IBM). Other maintainers are either dormant or have very minimal activity over the last six months. The project is effectively unmaintained (emphasis mine).-- Google Groups of Kubernetes Steering Committee, March 2022For all those reasons, you may prefer to use a standard SQL database with Apache APISIX. In this post, I'll show how you can use MySQL.It would be a lot of effort if each product had to introduce an abstraction layer and different adapters for both etcd and other databases. kine is a project that aims to offer a translation step between etcd calls and other implementations:Kine is an etcdshim that translates etcd API to:Features-- Kine (Kine is not etcd)In essence, kine is a Go library that translates etcd calls to the datastore you want (among those implemented).Yet, using kine directly is a non-trivial effort. Fortunately, api7, the company that gave Apache APISIX to the Apache Software Foundation, provides a component already focused on APISIX usage.ETCD adapter wraps kine to be APISIX-specific:ETCD Adapter mimics the ETCD V3 APIs best effort. It incorporates the kine as the Server side implementation, and it develops a totally in-memory watchable backend.Not all features in ETCD V3 APIs supported, this is designed for Apache APISIX, so it's inherently not a generic solution.-- ETCD adapterTwo things of note:Therefore, we can design our architecture as the following:Let's implement the above architecture with an additional admin UI over MySQL. I'll use Docker Compose:ETCD-adapter's configuration looks like this:Finally, here's Apache APISIX configuration:Now that we are set let's test our system by creating a route:We can now get it:We can also check via the Adminer interface that it has been persisted via MySQL:Unfortunately, we need to stop at this point. Getting all routes doesn't work:Worse, using the route fails:etcd is an excellent piece of infrastructure Kubernetes uses, but there might be better choices in some contexts. Worse, it might become a security threat in the future - or is already one, because of the lack of maintenance. Being able to move away from etcd is a considerable benefit.kine offers an etcd-compatible facade and multiple implementations. Using kine with Apache APISIX requires some adaptation effort, already done in ETCD-Adapter.Currently, ETCD-Adapter is not feature-complete (to say the least) and requires more love. That's why it was not donated to the Apache Foundation yet. If you're a Go developer and are interested in the project, feel free to subscribe to the Apache APISIX mailing list and/or join our Slack to offer your help.The complete source code for this post can be found on GitHub:To go further:Originally published at A Java Geek on July 23rd, 2023Templates let you quickly answer FAQs or store snippets for re-use.Click Here!Dec: Hex: xss'">javascript:{ alert0 }1'">%2sscript%2ualert()%2s/script%2u“> (working)test",prompt%0A/HelloWorld/(document.domain) (working)- @Brutelogic"onx+%00+onpointerenter%3dalert(domain)+x" (working)- @Brutelogic"> (working)- @IamRenganathan%27%09);%0d%0a%09%09[1].find(alert)//"> - @itsgeekymonk -@zapstiko (working) -@aufzayed -@ex_miClick Here!Dec: Hex: xss'">javascript:{ alert0 }1'">%2sscript%2ualert()%2s/script%2u“> (working)test",prompt%0A/HelloWorld/(document.domain) (working)- @Brutelogic"onx+%00+onpointerenter%3dalert(domain)+x" (working)- @Brutelogic"> (working)- @IamRenganathan%27%09);%0d%0a%09%09[1].find(alert)//"> - @itsgeekymonk -@zapstiko (working) -@aufzayed -@ex_mi Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well Confirm For further actions, you may consider blocking this person and/or reporting abuse Code And Deploy - Mar 23 '22 Code And Deploy - Mar 23 '22 Code And Deploy - Mar 23 '22 Code And Deploy - Mar 23 '22 Once suspended, apisix will not be able to comment or publish posts until their suspension is removed. Once unsuspended, apisix will be able to comment and publish posts again. Once unpublished, all posts by apisix will become hidden and only accessible to themselves. If apisix is not suspended, they can still re-publish their posts from their dashboard. Note: Once unpublished, this post will become invisible to the public and only accessible to Nicolas Frankel. They can still re-publish the post if they are not suspended. Thanks for keeping DEV Community safe. Here is what you can do to flag apisix: apisix consistently posts content that violates DEV Community's code of conduct because it is harassing, offensive or spammy. Unflagging apisix will restore default visibility to their posts. DEV Community — A constructive and inclusive social network for software developers. With you every step of your journey. Built on Forem — the open source software that powers DEV and other inclusive communities.Made with love and Ruby on Rails. DEV Community © 2016 - 2023. We're a place where coders share, stay up-to-date and grow their careers.



This post first appeared on VedVyas Articles, please read the originial post: here

Share the post

Apache APISIX without etcd

×

Subscribe to Vedvyas Articles

Get updates delivered right to your inbox!

Thank you for your subscription

×