HN user

yatsyk

502 karma

http://andrey.yatsyk.com

yatsyk@gmail.com

Posts23
Comments219
View on HN
news.ycombinator.com 1y ago

Ask HN: Advanced Use Cases for Cursor AI?

yatsyk
4pts0
treemap.yatsyk.com 4y ago

Show HN: FolderStatsApp – analyse your disk usage with treemap visualisation

yatsyk
1pts1
www.engadget.com 6y ago

Snapchat’s third-party ‘Mini’ apps are live

yatsyk
1pts0
react-spectrum.adobe.com 6y ago

React Spectrum by Adobe

yatsyk
17pts1
transportschemaeditor.com 6y ago

Show HN: Transport Schema Editor

yatsyk
2pts1
github.com 7y ago

Telegram Open Network Research Group

yatsyk
2pts0
news.ycombinator.com 8y ago

Ask HN: Does anybody uses DBs like pouchdb or minimongo for offline-first apps?

yatsyk
2pts0
news.ycombinator.com 9y ago

Ask HN: Arbitrage examples

yatsyk
1pts0
andrey.yatsyk.com 9y ago

Server-Side Applications Sandboxing with nsjail

yatsyk
2pts0
fuzzyreflection.com 9y ago

Maximizing code performance by thinking data first

yatsyk
2pts0
en.wikipedia.org 12y ago

High quality image magnification

yatsyk
2pts0
news.ycombinator.com 12y ago

Ask HN: Decided to start a business and regret later. Share your story.

yatsyk
30pts7
www.onepf.org 13y ago

List of Android Appstores

yatsyk
2pts0
gh.hnresources.com 14y ago

Show HN: GitHub Watches for User

yatsyk
7pts2
hnresources.com 14y ago

Show HN: Weekend project: Recommended Reading Lists

yatsyk
1pts0
blogs.wsj.com 14y ago

Russia elections will be monitored by AllOfMp3's founder webcams

yatsyk
2pts0
news.ycombinator.com 14y ago

Ask HN: How do you use your home server?

yatsyk
7pts2
www.opera.com 14y ago

Opera acquires Handster (mobile application store platform company)

yatsyk
14pts3
www.mobilecrunch.com 15y ago

Microsoft: 1.5 million Windows Phone 7 handsets sold in first six weeks

yatsyk
5pts3
jqapi.ru 15y ago

JQuery 1.4.4 API Cheat Sheet

yatsyk
3pts0
hnresources.com 15y ago

Show HN: HNResources.com: directory with HN resources

yatsyk
7pts3
www.faqs.org 15y ago

The Importance of Being Textual

yatsyk
3pts0
andrey.yatsyk.com 16y ago

Startup Ideas Spreadsheet Exported

yatsyk
21pts7

I prefer to use Zod or JSON Schema as the source of truth. Then I use QuickType [1] in the build process to generate code in different languages. This lets me share data structures. I mostly do this in Tauri apps to keep the same data shape in TypeScript and Rust. I also use it to define protocols, like for REST APIs.

Here are the advantages of this approach compared to using guts lib: - I get validation with clear error messages. - It supports many languages out of the box. - I don’t need to maintain a custom library. - JSON Schema is well supported in LLMs (for example, with structured output or vibe coding).

[1] https://quicktype.io/

I’m more focused on the situation from Musk’s point of view, not yours. Maybe your view is less controversial. But I don’t think Musk sees China and Russia as failed states. He’s said many positive things about both countries.

I share Durov’s disappointment about where the internet is heading.

But I think it’s hypocritical to talk about freedom of speech issues in Western Europe while ignoring similar or worse restrictions in China, Russia, or Dubai, where he lives.

It’s similar to Musk’s approach — when Twitter is shut down in Brazil, it’s a freedom of speech violation, but having a Tesla factory in China suddenly makes that problem disappear there.

Author here.

This tool allows to create transport schemas such as metro maps. You can import data from open street map data to save time or start from scratch. Maps stored in git repository so you can consider this editor like headless CMS for static site and in order to edit schema created by other user you need to fork it.

There are few similar libraries. I think most feature reach is https://github.com/projectstorm/react-diagrams , but there is also https://github.com/DrummerHead/react-flow-diagram https://github.com/alibaba/GGEditor , actually I’ve found about 15 different js open source react and non-react editors for node-based UI. But unfortunately most of them is not very extensible. One of the reason is that the authors prefer to store state inside component, so it’s impossible to create non-trivial behaviour.

When you start development version of Windows CE or Windows Embedded (don’t remember exactly which one) tick count timer wasn’t set to zero but max dword minus number of milliseconds in two minutes. So counter overflows in 2 minutes after system start. This is very smart way to catch such bugs.

Congratulation on launching!

I like rails, but in js world may be not so good idea to reimplement or integrate everything related to ui, routing etc. Meteor.js was not very successful with this model. I think routing or UI on react-native/web/blessed/VR is too different to be part of one framework.

But I see the usefulness of framework with functionality related to data fetching and business logic.

I consider perfect stack for this things is Postgress->Hasura (or also Prisma)->mst-gql->mobx-state-tree. You create database schema and everything up to models on client is autogenerated and each part of this stack could be updated, customized or completely rewritten. This stack could be used on react-native or web or any other js platform.

CouchDB 3.0 6 years ago

I'm not asserting that couch is unsecure, I need such database but the problem that I can't see any resource that could help me design secure production system.

You can check even trivial rails blog or todo example from some book and it will be limited in scope but more or less secure. I'm having hard time to find secure couchdb example.

Security for all systems is non trivial. But not equally hard.

If you use firebase you should understand that you getting vendor lock-in and in some cases you can spend much more money, but for some types of projects this platform is ok for me.

Same with couchdb, I understand that if I get replication with client, I need to pay by reorganising data or may be spend more resources to make system secure. There is no free lunch.

CouchDB 3.0 6 years ago

No I'm not assuming constraint on the number of comments. First example shows how easy limit number created objects. Spam prevention is other topic not so trivial but mostly solved problem.

CouchDB 3.0 6 years ago

Couch is not equivalent to mongo or relational because it accessible to clients if we want synchronisation. Securing app server is manageable problem and there is huge number of resources how to do it correctly.

In case of couch I've not seen any secure open-source example.

I'm not focused on DOS attacks, I'm just proposing different attack vectors.

CouchDB 3.0 6 years ago

If you need to limit the number of items it is trivial. You need to write something like `has_many :things, :before_add => :limit_things` in app server or create constraint in sql.

Spam prevention is not trivial but mostly solved problem. You can find a lot of articles about this topic.

But creating secure couchdb looks like very non-trivial.

CouchDB 3.0 6 years ago

It’s trivial to limit number of created documents in postgres, couchdb or application server though validation, I’m talking about updating document not creating new. In posgres if I update 1mb document used space will not always grow. In couch db situation is different. In case of relation db you have application server with custom logic and validations, couchdb from other side is accessible from outsize.

My idea that it’s very hard to create safe couchdb based system and most recommendations limited to setup nginx proxy and authenticate users which is not enough.

CouchDB 3.0 6 years ago

What kind of document are you looking for here? There is [1], but yeah, that covers access controls. As do the MongoDB [2] and Postgres [3] documents.

Mongo and postgress usually is not accessible for clients only for backend. Security handled by backend mostly and there is a plenty of resources how to implement secure server side applications which discusses attack vectors and how to make secure apps. Thankfully to this thread I’ve got few good ideas, that may help to design secure couchdb architecture (such as remove _find endpoint) but I’ve not seen any in-depth document about couchdb.

I feel like your thinking about Couch as exposing your entire PostgreSQL DB to the internet

No, why do you think so?

CouchDB 3.0 6 years ago

I’m not clear what you mean by limiting "not only particular document but database".

I’ve limited document size to 10mb and ratelimited updates to 10 per second. Client starts to update document with random data 10 requests per second. As far as I understand couch stores all versions at least some time. This means that this one client could fill space on my server 100mb/s. There is no such issues with postgress, and no one allow clients execute raw queries on database without any application server. Document only 10mb but database is huge.

What kind of "expensive" query are you envisioning?

I have never used couch, so I don’t know what could be expensive. May be some lookup without index or something like this.

Sorry for my ignorance, is it true that if I limit couch only to replication it will not be any not indexed lookups?

Looks like implement secure system with couch is very hard but I can’t find any best practices, mostly only authentication and basic validation.

CouchDB 3.0 6 years ago

Is it any documents that describes secure couchdb architecture? Most of the articles I find are limited to authentication and basic permissions.

CouchDB 3.0 6 years ago

Thank you for pointing at validation, I'll check it. It's not completely clear what is it possible to limit not only particular document but database, or how to handle conflict if document changed on pouch, but rejected on couchdb server.

I'm not sure about current time but previously it was a problem that couchdb file grow until some limit on filesystem and couchdb just crashed.

Start of the envoy readme: it's not battle tested or supported in any way. Also it doesn't do any validation apart from limiting permissions for different users.

It's easier to reimplement couchdb than to create smart proxy that will estimate is this query expensive or not.

I'm not saying about rate-limiting proxy or load-balancing to different backends which could be implemented on nginx or something else.

CouchDB 3.0 6 years ago

If I use backend I can create all validation logic in application server. But in this case no automatic synchronisation.

One of the major selling point of couchdb is replication protocol for client-server data syncing. When you design product with posgress you don't allow to execute raw sql queries from clients without any application server. But looks like it is recommended way to update data in couchdb world if you want to have synchronisation. I can't understand how can this architecture be secure?

CouchDB 3.0 6 years ago

This server can't prevent authenticated user from uploading huge document of running expensive query.

CouchDB 3.0 6 years ago

Custom backend means no synchronisation and no advantages over postgres.

Do you propose to create proxy that parses query and estimates complexity? I think this task at least as hard as implementing couchdb myself (actually harder)

Is there any secure open source code with pouchdb/couchdb integrations?